Skip to content

Commit

Permalink
tests: use bore cli to receive webhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
stfsy committed Dec 7, 2024
1 parent 2b8ad9a commit 79fefd9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 3 additions & 1 deletion test-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ export NODE_ENV='e2e'
function cancel {
echo "Received kill signal"
echo "Initiating shutdown"
node run-cancel-all-subscriptions
node run-cancel-all-subscriptions || true
docker stop $(docker ps | grep bore | awk '{ print $1 }')
}

trap cancel EXIT

docker run -it --detach --init --rm --network host ekzhang/bore local 3456 --to bore.pub --port 57143
sleep 5
npm run test-e2e
2 changes: 0 additions & 2 deletions test-e2e/after-all.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import hookRunner from './hook-server-runner.js'
import hookTunnelRunner from './hook-tunnel-runner.js'
import mongoDbRunner from './mongodb-runner.js'
import testPageRunner from './test-page-runner.js'

export default async () => {
await testPageRunner.stop()
await hookTunnelRunner.stop()
await hookRunner.stop()
await mongoDbRunner.stop()
}
2 changes: 0 additions & 2 deletions test-e2e/before-all.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import hookRunner from './hook-server-runner.js'
import hookTunnelRunner from './hook-tunnel-runner.js'
import mongoDbRunner from './mongodb-runner.js'
import testPageRunner from './test-page-runner.js'

export default async () => {
await testPageRunner.start()
await hookTunnelRunner.start()
await hookRunner.start()
await mongoDbRunner.start()
}
6 changes: 3 additions & 3 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export NODE_ENV='ci'

npm run test

# check whether we are connected to the internet
# check whether we are connected to the internet
# before downloading dependencies
resetDependencies() {
# reset tracing dependencies only if we are not running on GH
Expand All @@ -17,10 +17,10 @@ resetDependencies() {
curl --head www.google.com &>"/dev/null"
if [[ "${?}" == 0 ]]; then
trap resetDependencies ERR EXIT

# test with noop tracing library now
npm i -D @discue/open-telemetry-tracing@npm:@discue/open-telemetry-tracing-noop
npm run test

resetDependencies
fi

0 comments on commit 79fefd9

Please sign in to comment.