Skip to content

Commit 67d3a6b

Browse files
committed
Preparing for more than a single test
1 parent adac281 commit 67d3a6b

3 files changed

Lines changed: 21 additions & 2 deletions

File tree

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
run: go build -v cmd/simple-tee-proxy.go
2121

2222
- name: Test
23-
run: bash test/simple-reply.sh ./simple-tee-proxy
23+
run: bash run-tests.sh ./simple-tee-proxy

run-tests.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
RESULT=0
3+
4+
PROXY_PROGRAM="$1"
5+
6+
function runTest() {
7+
printf "🧪 \tRunning: $1 \n"
8+
"$2" "$PROXY_PROGRAM"
9+
if [ $? -eq 0 ]; then
10+
printf "🎉 \tSuccess \n"
11+
else
12+
printf "🔥 \tFailed \n"
13+
RESULT=1
14+
fi
15+
}
16+
17+
runTest "simple reply" "test/simple-reply.sh"
18+
19+
exit $RESULT

test/simple-reply.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
dd if=/dev/urandom of=/tmp/reply bs=1M count=1 2>/dev/null
44
cat /tmp/reply | nc -w 5 -l -p 8811 &

0 commit comments

Comments
 (0)