File tree Expand file tree Collapse file tree 3 files changed +49
-4
lines changed
tests/src/test/scala/runtime/actionContainers Expand file tree Collapse file tree 3 files changed +49
-4
lines changed Original file line number Diff line number Diff line change @@ -26,12 +26,12 @@ RUN git clone --branch ${GO_PROXY_GITHUB_BRANCH} \
26
26
27
27
# or build it from a release
28
28
FROM 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
30
30
RUN curl -sL \
31
31
https://github.com/apache/openwhisk-runtime-go/archive/{$GO_PROXY_RELEASE_VERSION}.tar.gz\
32
32
| tar xzf -\
33
33
&& cd openwhisk-runtime-go-*/main\
34
- && GO111MODULE=on go build -o /bin/proxy
34
+ && GO111MODULE=on GO111MODULE=on go build -o /bin/proxy
35
35
36
36
FROM php:7.4-cli-buster
37
37
Original file line number Diff line number Diff line change @@ -26,12 +26,12 @@ RUN git clone --branch ${GO_PROXY_GITHUB_BRANCH} \
26
26
27
27
# or build it from a release
28
28
FROM 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
30
30
RUN curl -sL \
31
31
https://github.com/apache/openwhisk-runtime-go/archive/{$GO_PROXY_RELEASE_VERSION}.tar.gz\
32
32
| tar xzf -\
33
33
&& cd openwhisk-runtime-go-*/main\
34
- && GO111MODULE=on go build -o /bin/proxy
34
+ && GO111MODULE=on CGO_ENABLED=0 go build -o /bin/proxy
35
35
36
36
FROM php:8.0-cli-buster
37
37
Original file line number Diff line number Diff line change @@ -486,4 +486,49 @@ abstract class Php7ActionContainerTests extends BasicActionRunnerTests with WskA
486
486
runRes.get.fields.get(" result" ) shouldBe Some (JsString (" it works" ))
487
487
}
488
488
}
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
+ }
489
534
}
You can’t perform that action at this time.
0 commit comments