Skip to content

Commit d82ed40

Browse files
committed
wip: tcp or unix
1 parent 0bbd11b commit d82ed40

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

cloud-sql/mysql/mysql/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
},
1414
"scripts": {
1515
"start": "node server/server.js",
16-
"system-test": "c8 mocha -p -j 2 test/server.test.js --timeout=60000 --exit",
17-
"system-test-unix": "c8 mocha -p -j 2 test/server-unix.test.js --timeout=60000 --exit",
18-
"test": "test/proxy-setup.sh && npm run system-test && npm run system-test-unix"
16+
"system-test": "test/proxy-setup.sh tcp && c8 mocha -p -j 2 test/server.test.js --timeout=60000 --exit",
17+
"system-test-unix": "test/proxy-setup.sh socket && c8 mocha -p -j 2 test/server-unix.test.js --timeout=60000 --exit",
18+
"test": "npm run system-test && npm run system-test-unix"
1919
},
2020
"dependencies": {
2121
"@google-cloud/functions-framework": "^3.0.0",

cloud-sql/mysql/mysql/test/proxy-setup.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,18 @@
1515
# Proof of concept: setting up proxy
1616

1717
PROXY_VERSION="v2.15.1"
18+
SETUP_STYLE=${1:-tcp}
19+
20+
if [ $SETUP_STYLE -ne "tcp" ]; then
21+
mkdir cloudsql && chmod 777 cloudsql
22+
socket="--unix-socket /cloudsql"
23+
; fi
1824

1925
curl -o cloud-sql-proxy https://storage.googleapis.com/cloud-sql-connectors/cloud-sql-proxy/${PROXY_VERSION}/cloud-sql-proxy.linux.amd64
2026
if [ $? -ne 0 ]; then
2127
echo "Failed to download cloud-sql-proxy"
2228
exit 1
2329
fi
2430
chmod +x cloud-sql-proxy
25-
./cloud-sql-proxy $CLOUD_SQL_CONNECTION_NAME &
31+
./cloud-sql-proxy $CLOUD_SQL_CONNECTION_NAME $socket &
2632
sleep 10

0 commit comments

Comments
 (0)