Skip to content

Commit fa2d42b

Browse files
committed
add test for current directory
1 parent 742a6c0 commit fa2d42b

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/src/test/scala/runtime/actionContainers/ActionProxyContainerTests.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,4 +252,20 @@ class ActionProxyContainerTests extends BasicActionRunnerTests with WskActorSyst
252252
e shouldBe empty
253253
})
254254
}
255+
256+
it should "support current directory be action location" in {
257+
withActionContainer() { c =>
258+
val code = """
259+
|#!/bin/bash
260+
|echo "{\"pwd_env\":\"$PWD\",\"pwd_cmd\":\"$(pwd)\"}"
261+
""".stripMargin.trim
262+
263+
val (initCode, initRes) = c.init(initPayload(code))
264+
initCode should be(200)
265+
266+
val (_, runRes) = c.run(runPayload(JsObject()))
267+
runRes.get.fields.get("pwd_env") shouldBe Some(JsString("/action"))
268+
runRes.get.fields.get("pwd_cmd") shouldBe Some(JsString("/action"))
269+
}
270+
}
255271
}

0 commit comments

Comments
 (0)