Skip to content

Commit d43ccb1

Browse files
committed
WIP: shared proxy setup
1 parent 0e60a3d commit d43ccb1

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

cloud-sql/mysql/mysql/test/proxy-setup.sh renamed to .github/workflows/utils/sql-proxy.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,10 @@ fi
4343
sleep 10
4444

4545
echo "Proxy ready for use"
46+
47+
# Run test
48+
$@
49+
50+
echo "Shutting down proxy process"
51+
52+
pkill -f "cloud-sql-proxy" || echo "cloud-sql-proxy process not found. Was it already stopped?"

cloud-sql/mysql/mysql/package.json

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

cloud-sql/mysql/mysql/test/proxy-shutdown.sh renamed to cloud-sql/mysql/mysql/test/run-proxy.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash -e
1+
#!/bin/bash -ex
22

33
# Copyright 2025 Google LLC
44
#
@@ -14,9 +14,5 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# Proof of concept: shutting down proxy
18-
19-
echo "Shutting down proxy process"
20-
21-
pkill -f "cloud-sql-proxy" || echo "cloud-sql-proxy process not found. Was it already stopped?"
22-
17+
# Run shared proxy setup
18+
source $GITHUB_WORKSPACE/.github/workflows/util/sql-proxy.sh

0 commit comments

Comments
 (0)