* 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>
28 lines
495 B
Bash
Executable File
28 lines
495 B
Bash
Executable File
#!/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
|