Skip to content

Commit a62e1bf

Browse files
committed
more bash
1 parent 8bf31b9 commit a62e1bf

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.github/workflows/utils/sql-proxy.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@
1717
# Proof of concept: setting up proxy
1818

1919
PROXY_VERSION="v2.15.1"
20-
SETUP_STYLE=${1:-tcp}
20+
21+
while getopts c: flag
22+
do
23+
case "${flag}" in
24+
c) SETUP_STYLE=${1:-tcp};;
25+
esac
26+
done
2127

2228
if [[ ! $SETUP_STYLE == "tcp" ]]; then
2329
echo "setup for sockets"
@@ -45,8 +51,12 @@ sleep 10
4551
echo "Proxy ready for use"
4652

4753
# Run test
48-
$@
54+
$@ || STATUS=$?
55+
4956

5057
echo "Shutting down proxy process"
5158

5259
pkill -f "cloud-sql-proxy" || echo "cloud-sql-proxy process not found. Was it already stopped?"
60+
61+
# Fail if the tests failed
62+
exit $STATUS

cloud-sql/mysql/mysql/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"start": "node server/server.js",
1616
"proxy": "bash $GITHUB_WORKSPACE/.github/workflows/utils/sql-proxy.sh",
1717
"system-test": "npm run proxy -- c8 mocha -p -j 2 test/server.test.js --timeout=60000 --exit",
18-
"system-test-unix": "npm run proxy -- c8 mocha -p -j 2 test/server-unix.test.js --timeout=60000 --exit",
18+
"system-test-unix": "npm run proxy -c socket -- c8 mocha -p -j 2 test/server-unix.test.js --timeout=60000 --exit",
1919
"test": "npm run system-test && npm run system-test-unix"
2020
},
2121
"dependencies": {

0 commit comments

Comments
 (0)