openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csantan...@apache.org
Subject [incubator-openwhisk-cli] 05/06: Update open api gw end-to-end test with increased timeout and improved logging (#2523)
Date Tue, 01 Aug 2017 22:12:04 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 74dea20757411bd034b971d4a03efb0e6ad2e8c4
Author: Mark Deuser <mdeuser@us.ibm.com>
AuthorDate: Fri Jul 28 16:35:21 2017 -0400

    Update open api gw end-to-end test with increased timeout and improved logging (#2523)
---
 .../test/scala/apigw/healthtests/ApiGwEndToEndTests.scala | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/tests/src/test/scala/apigw/healthtests/ApiGwEndToEndTests.scala b/tests/src/test/scala/apigw/healthtests/ApiGwEndToEndTests.scala
index 49cfbf7..9e8ecd0 100644
--- a/tests/src/test/scala/apigw/healthtests/ApiGwEndToEndTests.scala
+++ b/tests/src/test/scala/apigw/healthtests/ApiGwEndToEndTests.scala
@@ -151,7 +151,7 @@ class ApiGwEndToEndTests
         val testapiname = testName + " API Name"
         val actionName = testName + "_echo"
         val urlqueryparam = "name"
-        val urlqueryvalue = "test"
+        val urlqueryvalue = testName
 
         try {
             println("cli namespace: " + clinamespace)
@@ -214,14 +214,21 @@ class ApiGwEndToEndTests
             )
             rr.stdout should include("ok: created API")
             val swaggerapiurl = rr.stdout.split("\n")(1)
-            println(s"apiurl: '${swaggerapiurl}'")
+            println(s"Returned api url: '${swaggerapiurl}'")
 
             // Call the API URL and validate the results
+            val start = java.lang.System.currentTimeMillis
+            val apiToInvoke = s"$swaggerapiurl?$urlqueryparam=$urlqueryvalue&guid=$start"
+            println(s"Invoking: '${apiToInvoke}'")
             val response = whisk.utils.retry({
-                val response = RestAssured.given().config(sslconfig).get(s"$swaggerapiurl?$urlqueryparam=$urlqueryvalue")
+                val response = RestAssured.given().config(sslconfig).get(s"$apiToInvoke")
+                println("URL invocation response status: " + response.statusCode)
                 response.statusCode should be(200)
                 response
-            }, 5, Some(1.second))
+            }, 6, Some(2.second))
+            val end = java.lang.System.currentTimeMillis
+            val elapsed = end - start
+            println("Elapsed time (milliseconds) for a successful response: " + elapsed)
             val responseString = response.body.asString
             println("URL invocation response: " + responseString)
             responseString.parseJson.asJsObject.fields(urlqueryparam).convertTo[String] should
be(urlqueryvalue)

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

Mime
View raw message