You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/12/03 15:53:24 UTC

[GitHub] mdeuser closed pull request #4153: optionally prohibit test cases using --auth to override the namespace target

mdeuser closed pull request #4153: optionally prohibit test cases using --auth to override the namespace target
URL: https://github.com/apache/incubator-openwhisk/pull/4153
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/tests/src/test/scala/common/RunCliCmd.scala b/tests/src/test/scala/common/RunCliCmd.scala
index e3e7e44743..67a4264f4f 100644
--- a/tests/src/test/scala/common/RunCliCmd.scala
+++ b/tests/src/test/scala/common/RunCliCmd.scala
@@ -33,6 +33,8 @@ trait RunCliCmd extends Matchers {
    */
   def baseCommand: Buffer[String]
 
+  val prohibitAuthOverride = false
+
   /**
    * Delegates execution of the command to an underlying implementation.
    *
@@ -69,14 +71,18 @@ trait RunCliCmd extends Matchers {
 
     val args = baseCommand
     if (verbose) args += "--verbose"
-    if (showCmd) println(args.mkString(" ") + " " + params.mkString(" "))
+    val finalParams = if (!prohibitAuthOverride) { params } else {
+      params.filter(s =>
+        !s.equals("--auth") && !(params.indexOf(s) > 0 && params(params.indexOf(s) - 1).equals("--auth")))
+    }
+    if (showCmd) println(args.mkString(" ") + " " + finalParams.mkString(" "))
 
     val rr = retry(
       0,
       retriesOnNetworkError,
-      () => runCmd(DONTCARE_EXIT, workingDir, sys.env ++ env, stdinFile, args ++ params))
+      () => runCmd(DONTCARE_EXIT, workingDir, sys.env ++ env, stdinFile, args ++ finalParams))
 
-    withClue(hideStr(reportFailure(args ++ params, expectedExitCode, rr).toString(), hideFromOutput)) {
+    withClue(hideStr(reportFailure(args ++ finalParams, expectedExitCode, rr).toString(), hideFromOutput)) {
       if (expectedExitCode != TestUtils.DONTCARE_EXIT) {
         val ok = (rr.exitCode == expectedExitCode) || (expectedExitCode == TestUtils.ANY_ERROR_EXIT && rr.exitCode != 0)
         if (!ok) {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services