rabbah commented on a change in pull request #3418: support cleanup of 
cloudant/kafka trigger dbs
URL: 
https://github.com/apache/incubator-openwhisk/pull/3418#discussion_r173778968
 
 

 ##########
 File path: 
tests/src/test/scala/whisk/core/database/test/CleanUpWhisksDbSkriptTests.scala
 ##########
 @@ -257,19 +266,262 @@ class CleanUpWhisksDbSkriptTests
     }
 
     // execute script
-    val (_, _, _, kept) = runScript(dbUrl, dbName, authDBName)
+    val (_, _, _, kept) = runScript(dbUrl, dbName, authDBName, "whisks")
     println(s"kept: $kept")
 
     // Check, that script kept documents in DB
     val ids = documents.keys
     println(s"ids: $ids")
-    kept should contain allElementsOf ids
+    kept should contain("3 doc(s) for namespace whisk.system")
+
+    val databaseResponse = client.getAllDocs(includeDocs = 
Some(true)).futureValue
+    databaseResponse should be('right)
+
+    val databaseDocuments = 
databaseResponse.right.get.fields("rows").convertTo[List[JsObject]]
+
+    val databaseDocumentIDs = 
databaseDocuments.map(_.fields("id").convertTo[String])
+    databaseDocumentIDs should contain allElementsOf ids
+
+    // Delete database
+    client.deleteDb().futureValue
+  }
+
+  it should "mark documents for deletion in cloudanttrigger if namespace does 
not exist" in {
+    // Create whisks db
+    val dbName = dbPrefix + "cleanup_cloudanttrigger_test_mark_for_deletion"
+    val client = createDatabase(dbName, None)
+
+    // Create document/action with random namespace
+    val documents = Map(
+      ":AHA04676_dev:vision-cloudant-trigger" -> JsObject("dbname" -> 
JsString("openwhisk-darkvision-dev")),
 
 Review comment:
   please remove and use more generic names.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to