File tree Expand file tree Collapse file tree
tests/src/test/scala/runtime/actionContainers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,12 +26,12 @@ RUN git clone --branch ${GO_PROXY_GITHUB_BRANCH} \
2626
2727# or build it from a release
2828FROM golang:1.18 AS builder_release
29- ARG GO_PROXY_RELEASE_VERSION=1.18@1.19 .0
29+ ARG GO_PROXY_RELEASE_VERSION=1.18@1.20 .0
3030RUN curl -sL \
3131 https://github.com/apache/openwhisk-runtime-go/archive/{$GO_PROXY_RELEASE_VERSION}.tar.gz\
3232 | tar xzf -\
3333 && cd openwhisk-runtime-go-*/main\
34- && GO111MODULE=on go build -o /bin/proxy
34+ && GO111MODULE=on GO111MODULE=on go build -o /bin/proxy
3535
3636FROM php:7.4-cli-buster
3737
Original file line number Diff line number Diff line change @@ -26,12 +26,12 @@ RUN git clone --branch ${GO_PROXY_GITHUB_BRANCH} \
2626
2727# or build it from a release
2828FROM golang:1.18 AS builder_release
29- ARG GO_PROXY_RELEASE_VERSION=1.18@1.19 .0
29+ ARG GO_PROXY_RELEASE_VERSION=1.18@1.20 .0
3030RUN curl -sL \
3131 https://github.com/apache/openwhisk-runtime-go/archive/{$GO_PROXY_RELEASE_VERSION}.tar.gz\
3232 | tar xzf -\
3333 && cd openwhisk-runtime-go-*/main\
34- && GO111MODULE=on go build -o /bin/proxy
34+ && GO111MODULE=on CGO_ENABLED=0 go build -o /bin/proxy
3535
3636FROM php:8.0-cli-buster
3737
Original file line number Diff line number Diff line change @@ -486,4 +486,49 @@ abstract class Php7ActionContainerTests extends BasicActionRunnerTests with WskA
486486 runRes.get.fields.get(" result" ) shouldBe Some (JsString (" it works" ))
487487 }
488488 }
489+
490+ it should " support return array result" in {
491+ val srcs = Seq (
492+ Seq (" index.php" ) ->
493+ """
494+ | <?php
495+ | function main(array $args) : array
496+ | {
497+ | $result=array("a","b");
498+ | return $result;
499+ | }
500+ """ .stripMargin)
501+
502+ val code = ZipBuilder .mkBase64Zip(srcs)
503+
504+ withPhp7Container { c =>
505+ c.init(initPayload(code))._1 should be(200 )
506+
507+ val (runCode, runRes) = c.run(runPayload(JsObject ()))
508+ runCode should be(200 )
509+ runRes shouldBe Some (JsObject (" 0" -> JsString (" a" ), " 1" -> JsString (" b" )))
510+ }
511+ }
512+
513+ it should " support array as input param" in {
514+ val srcs = Seq (
515+ Seq (" index.php" ) ->
516+ """
517+ | <?php
518+ | function main(array $args) : array
519+ | {
520+ | return $args;
521+ | }
522+ """ .stripMargin)
523+
524+ val code = ZipBuilder .mkBase64Zip(srcs)
525+
526+ withPhp7Container { c =>
527+ c.init(initPayload(code))._1 should be(200 )
528+
529+ val (runCode, runRes) = c.run(runPayload(JsArray (JsString (" a" ), JsString (" b" ))))
530+ runCode should be(200 )
531+ runRes shouldBe Some (JsObject (" 0" -> JsString (" a" ), " 1" -> JsString (" b" )))
532+ }
533+ }
489534}
You can’t perform that action at this time.
0 commit comments