openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From berst...@apache.org
Subject [incubator-openwhisk] branch master updated: Clean Up CLI Tests (#2541)
Date Wed, 02 Aug 2017 19:37:44 GMT
This is an automated email from the ASF dual-hosted git repository.

berstler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new 62cb0c6  Clean Up CLI Tests (#2541)
62cb0c6 is described below

commit 62cb0c631ccb1be7fca1117bd02556b3683ea7e6
Author: James Dubee <jwdubee@us.ibm.com>
AuthorDate: Wed Aug 2 15:37:41 2017 -0400

    Clean Up CLI Tests (#2541)
    
    * Assert CLI Exists in Wsk Object Constructor
    * Remove getCLIPath
---
 tests/src/test/scala/common/Wsk.scala                        | 12 ++++--------
 tests/src/test/scala/system/basic/WskBasicTests.scala        |  4 ----
 tests/src/test/scala/system/basic/WskPackageTests.scala      |  4 ----
 .../test/scala/whisk/core/cli/test/WskBasicUsageTests.scala  |  4 ----
 4 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/tests/src/test/scala/common/Wsk.scala b/tests/src/test/scala/common/Wsk.scala
index ac489cf..ad17921 100644
--- a/tests/src/test/scala/common/Wsk.scala
+++ b/tests/src/test/scala/common/Wsk.scala
@@ -276,7 +276,6 @@ class WskAction()
     with HasActivation {
 
     override protected val noun = "action"
-    override def baseCommand = Wsk.baseCommand
 
     /**
      * Creates action. Parameters mirror those available in the CLI.
@@ -1007,19 +1006,16 @@ trait WaitFor {
 
 object Wsk {
     private val binaryName = "wsk"
+    private val cliPath = if (WhiskProperties.useCLIDownload) getDownloadedGoCLIPath else
WhiskProperties.getCLIPath
+
+    assert((new File(cliPath)).exists, s"did not find $cliPath")
 
     /** What is the path to a downloaded CLI? **/
     private def getDownloadedGoCLIPath = {
         s"${System.getProperty("user.home")}${File.separator}.local${File.separator}bin${File.separator}${binaryName}"
     }
 
-    def exists() = {
-        val cliPath = if (WhiskProperties.useCLIDownload) getDownloadedGoCLIPath else WhiskProperties.getCLIPath
-        assert((new File(cliPath)).exists, s"did not find $cliPath")
-    }
-
-    def baseCommand() =
-        if (WhiskProperties.useCLIDownload) Buffer(getDownloadedGoCLIPath) else Buffer(WhiskProperties.getCLIPath)
+    def baseCommand = Buffer(cliPath)
 }
 
 trait RunWskCmd extends Matchers {
diff --git a/tests/src/test/scala/system/basic/WskBasicTests.scala b/tests/src/test/scala/system/basic/WskBasicTests.scala
index f48a14d..61b4cf0 100644
--- a/tests/src/test/scala/system/basic/WskBasicTests.scala
+++ b/tests/src/test/scala/system/basic/WskBasicTests.scala
@@ -46,10 +46,6 @@ class WskBasicTests
 
     behavior of "Wsk CLI"
 
-    it should "confirm wsk exists" in {
-        Wsk.exists
-    }
-
     it should "reject creating duplicate entity" in withAssetCleaner(wskprops) {
         (wp, assetHelper) =>
             val name = "testDuplicateCreate"
diff --git a/tests/src/test/scala/system/basic/WskPackageTests.scala b/tests/src/test/scala/system/basic/WskPackageTests.scala
index f196233..f844bbb 100644
--- a/tests/src/test/scala/system/basic/WskPackageTests.scala
+++ b/tests/src/test/scala/system/basic/WskPackageTests.scala
@@ -44,10 +44,6 @@ class WskPackageTests
 
     behavior of "Wsk Package"
 
-    it should "confirm wsk exists" in {
-        Wsk.exists
-    }
-
     it should "allow creation and deletion of a package" in withAssetCleaner(wskprops) {
         (wp, assetHelper) =>
             val name = "simplepackage"
diff --git a/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala b/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
index 354bbe7..a4109e7 100644
--- a/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
+++ b/tests/src/test/scala/whisk/core/cli/test/WskBasicUsageTests.scala
@@ -65,10 +65,6 @@ class WskBasicUsageTests
 
     behavior of "Wsk CLI usage"
 
-    it should "confirm wsk exists" in {
-        Wsk.exists
-    }
-
     it should "show help and usage info" in {
         val stdout = wsk.cli(Seq()).stdout
         stdout should include regex ("""(?i)Usage:""")

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <commits@openwhisk.apache.org>'].

Mime
View raw message