You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ho...@apache.org on 2017/07/19 15:06:40 UTC
[incubator-openwhisk-cli] 03/03: Harden system tests for --last
flag. (#2497)
This is an automated email from the ASF dual-hosted git repository.
houshengbo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git
commit d492a179b50c19e0f294878f8be42d8fb423fef0
Author: Markus Thömmes <ma...@me.com>
AuthorDate: Sun Jul 16 14:36:26 2017 +0200
Harden system tests for --last flag. (#2497)
Using a hardcoded Thread.sleep timeout will inevitably fail in different test environments. Using the test helpers that retry under the hood will make those tests less intermittent failure prone.
The rejection test doesn't actually need to invoke an action.
---
.../test/scala/system/basic/WskBasicTests.scala | 30 ++++++++++------------
tools/travis/test_openwhisk.sh | 8 +++---
2 files changed, 18 insertions(+), 20 deletions(-)
diff --git a/tests/src/test/scala/system/basic/WskBasicTests.scala b/tests/src/test/scala/system/basic/WskBasicTests.scala
index ef86c1b..ed926a2 100644
--- a/tests/src/test/scala/system/basic/WskBasicTests.scala
+++ b/tests/src/test/scala/system/basic/WskBasicTests.scala
@@ -864,19 +864,19 @@ class WskBasicTests
(action, _) => wsk.action.create("lastName", defaultAction)
}
val lastInvoke = wsk.action.invoke("lastName")
- val includeID = wsk.activation.extractActivationId(lastInvoke).get
- Thread.sleep(1000)
-
- val lastFlag = Seq(
- (Seq("activation", "get", "publish", "--last"), includeID),
- (Seq("activation", "get", "--last"), includeID),
- (Seq("activation", "logs", "--last"), includeStr),
- (Seq("activation", "result", "--last"), includeStr))
+ withActivation(wsk.activation, lastInvoke) {
+ activation =>
+ val lastFlag = Seq(
+ (Seq("activation", "get", "publish", "--last"), activation.activationId),
+ (Seq("activation", "get", "--last"), activation.activationId),
+ (Seq("activation", "logs", "--last"), includeStr),
+ (Seq("activation", "result", "--last"), includeStr))
- lastFlag foreach {
- case (cmd, output) =>
- val stdout = wsk.cli(cmd ++ wskprops.overrides ++ auth, expectedExitCode = SUCCESS_EXIT).stdout
- stdout should include(output)
+ lastFlag foreach {
+ case (cmd, output) =>
+ val stdout = wsk.cli(cmd ++ wskprops.overrides ++ auth, expectedExitCode = SUCCESS_EXIT).stdout
+ stdout should include(output)
+ }
}
}
@@ -884,13 +884,9 @@ class WskBasicTests
(wp, assetHelper) =>
val auth: Seq[String] = Seq("--auth", wskprops.authKey)
- assetHelper.withCleaner(wsk.action, "lastName") {
- (action, _) => wsk.action.create("lastName", defaultAction)
- }
- val lastId = wsk.activation.extractActivationId(wsk.action.invoke("lastName")).get
+ val lastId = "dummyActivationId"
val tooManyArgsMsg = s"${lastId}. An activation ID is required."
val invalidField = s"Invalid field filter '${lastId}'."
- Thread.sleep(1000)
val invalidCmd = Seq(
(Seq("activation", "get", s"$lastId", "publish", "--last"), tooManyArgsMsg),
diff --git a/tools/travis/test_openwhisk.sh b/tools/travis/test_openwhisk.sh
index 5268500..29ac6bc 100755
--- a/tools/travis/test_openwhisk.sh
+++ b/tools/travis/test_openwhisk.sh
@@ -38,11 +38,13 @@ cp $TRAVIS_BUILD_DIR/wsk $WHISKDIR/bin
# Run the test cases under openwhisk to ensure the quality of the binary.
cd $TRAVIS_BUILD_DIR
-./gradlew :tests:test -Dtest.single=Wsk*Tests*
-./gradlew :tests:test -Dtest.single=*ApiGwRoutemgmtActionTests*
-sleep 30
+
./gradlew :tests:test -Dtest.single=*ApiGwTests*
sleep 30
+./gradlew :tests:test -Dtest.single=*ApiGwRoutemgmtActionTests*
+sleep 30
./gradlew :tests:test -Dtest.single=*ApiGwEndToEndTests*
sleep 30
+./gradlew :tests:test -Dtest.single=Wsk*Tests*
+
make integration_test
--
To stop receiving notification emails like this one, please contact
"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>.