Add websocket test (#2053)

* Add websocket test

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Use trap for exit code

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Remove readme

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Format, go version fix

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Update image name

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Use spec dir

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Change directory before running file

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Use

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>
This commit is contained in:
Harsh Thakur
2021-06-10 12:27:20 +05:30
committed by GitHub
parent 827b64d633
commit f01de5c802
10 changed files with 211 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
#
# Create a function and trigger it using NATS
#
set -euo pipefail
source $(dirname $0)/../../utils.sh
cleanup() {
log "Deleting websocket setup"
fission spec destroy
}
DIR=$(dirname $0)
if [ -z "${TEST_NOCLEANUP:-}" ]; then
trap cleanup EXIT
else
log "TEST_NOCLEANUP is set; not cleaning up test artifacts afterwards."
fi
log "Creating websocket setup.."
fission spec apply --specdir=$DIR/specs
log "Testing websocket connection"
cd $DIR && go run main.go