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:
Executable
+27
@@ -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
|
||||
Reference in New Issue
Block a user