Closed viveksyngh closed 5 years ago
Can you both confirm that you built and tested the code with the CLI and with the certifier?
https://github.com/openfaas/certifier
Thanks,
Alex
ID NAME MODE REPLICAS IMAGE PORTS
p6misxu7ccoi func_alertmanager replicated 1/1 prom/alertmanager:v0.15.0
hgxwb82oe6m0 func_faas-swarm replicated 1/1 viveksyngh/faas-swarm:latest-dev
r0cz69k05mg7 func_gateway replicated 1/1 openfaas/gateway:0.9.2 *:8080->8080/tcp
zqeluv52r4lo func_nats replicated 1/1 nats-streaming:0.6.0
tvalw7og8lmb func_prometheus replicated 1/1 prom/prometheus:v2.3.1 *:9090->9090/tcp
vqq5i6vt5o6k func_queue-worker replicated 1/1 openfaas/queue-worker:0.4.8
make test-swarm
docker service rm stronghash env-test env-test-labels env-test-annotations env-test-verbs test-secret ; docker secret rm secret-api-test-key
Error: No such service: stronghash
Error: No such service: env-test
Error: No such service: env-test-labels
Error: No such service: env-test-annotations
Error: No such service: env-test-verbs
Error: No such service: test-secret
secret-api-test-key
./create-swarm-secret.sh
y7ja308dvlwy3u8mci60a0pui
Swarm secret created
gateway_url=http://127.0.0.1:8080/ time go test -count=1 ./tests -v
=== RUN Test_Access_Secret
=== RUN Test_Access_Secret/Empty_QueryString
--- PASS: Test_Access_Secret (16.08s)
--- PASS: Test_Access_Secret/Empty_QueryString (16.07s)
verify.go:52: [1/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/test-secret
verify.go:52: [2/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/test-secret
verify.go:52: [3/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/test-secret
verify.go:52: [4/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/test-secret
verify.go:52: [5/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/test-secret
verify.go:52: [6/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/test-secret
verify.go:52: [7/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/test-secret
verify.go:52: [8/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/test-secret
verify.go:71: [9/30] Got correct response: 200 - http://127.0.0.1:8080/function/test-secret
=== RUN Test_Deploy_Stronghash
--- PASS: Test_Deploy_Stronghash (0.01s)
=== RUN Test_Deploy_PassingCustomEnvVars_AndQueryString
=== RUN Test_Deploy_PassingCustomEnvVars_AndQueryString/Empty_QueryString
=== RUN Test_Deploy_PassingCustomEnvVars_AndQueryString/Populated_QueryString
--- PASS: Test_Deploy_PassingCustomEnvVars_AndQueryString (12.07s)
--- PASS: Test_Deploy_PassingCustomEnvVars_AndQueryString/Empty_QueryString (12.05s)
verify.go:52: [1/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test
verify.go:52: [2/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test
verify.go:52: [3/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test
verify.go:52: [4/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test
verify.go:52: [5/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test
verify.go:52: [6/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test
verify.go:71: [7/30] Got correct response: 200 - http://127.0.0.1:8080/function/env-test
--- PASS: Test_Deploy_PassingCustomEnvVars_AndQueryString/Populated_QueryString (0.00s)
verify.go:71: [1/30] Got correct response: 200 - http://127.0.0.1:8080/function/env-test?testing=1
=== RUN Test_Deploy_WithLabels
--- PASS: Test_Deploy_WithLabels (12.07s)
verify.go:52: [1/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test-labels
verify.go:52: [2/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test-labels
verify.go:52: [3/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test-labels
verify.go:52: [4/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test-labels
verify.go:52: [5/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test-labels
verify.go:52: [6/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test-labels
verify.go:71: [7/30] Got correct response: 200 - http://127.0.0.1:8080/function/env-test-labels
=== RUN Test_Deploy_WithAnnotations
--- PASS: Test_Deploy_WithAnnotations (12.07s)
verify.go:52: [1/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test-annotations
verify.go:52: [2/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test-annotations
verify.go:52: [3/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test-annotations
verify.go:52: [4/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test-annotations
verify.go:52: [5/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test-annotations
verify.go:52: [6/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test-annotations
verify.go:71: [7/30] Got correct response: 200 - http://127.0.0.1:8080/function/env-test-annotations
=== RUN Test_InvokeNotFound
--- PASS: Test_InvokeNotFound (0.00s)
verify.go:71: [1/30] Got correct response: 502 - http://127.0.0.1:8080/function/notfound
=== RUN Test_Invoke_With_Supported_Verbs
=== RUN Test_Invoke_With_Supported_Verbs/GET
=== RUN Test_Invoke_With_Supported_Verbs/POST
=== RUN Test_Invoke_With_Supported_Verbs/PUT
=== RUN Test_Invoke_With_Supported_Verbs/PATCH
=== RUN Test_Invoke_With_Supported_Verbs/DELETE
--- PASS: Test_Invoke_With_Supported_Verbs (12.08s)
--- PASS: Test_Invoke_With_Supported_Verbs/GET (12.06s)
verify.go:52: [1/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test-verbs
verify.go:52: [2/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test-verbs
verify.go:52: [3/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test-verbs
verify.go:52: [4/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test-verbs
verify.go:52: [5/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test-verbs
verify.go:52: [6/30] Bad response want: [200], got: 502 - http://127.0.0.1:8080/function/env-test-verbs
verify.go:71: [7/30] Got correct response: 200 - http://127.0.0.1:8080/function/env-test-verbs
--- PASS: Test_Invoke_With_Supported_Verbs/POST (0.00s)
verify.go:71: [1/30] Got correct response: 200 - http://127.0.0.1:8080/function/env-test-verbs
--- PASS: Test_Invoke_With_Supported_Verbs/PUT (0.00s)
verify.go:71: [1/30] Got correct response: 200 - http://127.0.0.1:8080/function/env-test-verbs
--- PASS: Test_Invoke_With_Supported_Verbs/PATCH (0.00s)
verify.go:71: [1/30] Got correct response: 200 - http://127.0.0.1:8080/function/env-test-verbs
--- PASS: Test_Invoke_With_Supported_Verbs/DELETE (0.00s)
verify.go:71: [1/30] Got correct response: 200 - http://127.0.0.1:8080/function/env-test-verbs
PASS
ok github.com/openfaas/certifier/tests 64.422s
65.59 real 0.60 user 0.67 sys
This commit updates the status code from 200 to 202 for create, update or delete APIs.
Fixes: #25
Signed-off-by: Vivek Singh vivekkmr45@yahoo.in
Description
Motivation and Context
Fixes: #25
How Has This Been Tested?
Tested on local swarm cluster.
Types of changes
Checklist:
git commit -s