Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
f46b2a1
wip: proof of concept cloud-sql mysql
glasnt Mar 25, 2025
c54abd2
chmod
glasnt Mar 25, 2025
e1d0de8
add sleep to ensure proxy starts before use
glasnt Mar 25, 2025
3507ff7
use correct envvar
glasnt Mar 25, 2025
41ad376
extra bit
glasnt Mar 25, 2025
ae36e28
debugging
glasnt Mar 25, 2025
5ecb710
instance_host is deleted by the server-unix test
glasnt Mar 25, 2025
6326bd3
proxy all tests
glasnt Mar 25, 2025
c004e1a
accepting gemini-code-assist code
glasnt Mar 25, 2025
6a98c4d
oop
glasnt Mar 25, 2025
0bbd11b
Merge branch 'main' into sql-tests-2
glasnt Mar 26, 2025
d82ed40
wip: tcp or unix
glasnt Mar 26, 2025
43a8e53
syntax
glasnt Mar 27, 2025
81781de
cause she looks like a flower
glasnt Mar 27, 2025
4ff9afc
more shell logic
glasnt Mar 27, 2025
a47abdf
sh
glasnt Mar 27, 2025
b7dcf45
continued proof of concept
glasnt Mar 27, 2025
8699edf
call shutdown
glasnt Mar 27, 2025
23b9430
format value
glasnt Mar 28, 2025
23f3a2e
order?
glasnt Mar 28, 2025
986a700
Merge branch 'main' into sql-tests-2
glasnt Mar 28, 2025
0cf5917
debug: echo
glasnt Mar 28, 2025
184e6c4
hoisted by my own petard.
glasnt Mar 28, 2025
5b00c53
tmp file
glasnt Mar 28, 2025
0e60a3d
-p
glasnt Mar 28, 2025
d43ccb1
WIP: shared proxy setup
glasnt Mar 28, 2025
a82cdbf
chmod
glasnt Mar 28, 2025
2c8a076
maybe?
glasnt Mar 28, 2025
f0fbd65
??
glasnt Mar 28, 2025
e8594a6
bash
glasnt Mar 28, 2025
f13d4eb
debug
glasnt Mar 28, 2025
629fa09
debug
glasnt Mar 28, 2025
8bf31b9
maybe
glasnt Mar 28, 2025
a62e1bf
more bash
glasnt Mar 28, 2025
24bd715
simplify usage
glasnt Mar 28, 2025
f26c218
cleanup
glasnt Mar 28, 2025
82ff1dd
actually use the new setting
glasnt Mar 28, 2025
8d5befd
remove old setting
glasnt Mar 28, 2025
b83a1af
attempt formatting
glasnt Mar 28, 2025
1e5b92d
add mocha colour
glasnt Mar 28, 2025
a8f39d5
at least use something
glasnt Mar 28, 2025
41bc54a
code review comments
glasnt Mar 30, 2025
21ebc78
syntax
glasnt Mar 30, 2025
919bd8f
syntax
glasnt Mar 30, 2025
c425a7e
fix usage
glasnt Mar 31, 2025
a811f0f
Merge branch 'main' into sql-tests-2
glasnt Mar 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/config/nodejs-dev.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"auth",
"batch",
"cloud-language",
"cloud-sql/mysql/mysql",
"cloud-tasks/snippets",
"cloud-tasks/tutorial-gcf/app",
"cloud-tasks/tutorial-gcf/function",
Expand Down
1 change: 0 additions & 1 deletion .github/config/nodejs-prod.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
// TODO: fix these
"ai-platform/snippets", // PERMISSION_DENIED: Permission denied: Consumer 'projects/undefined' has been suspended.
"automl", // (untested) FAILED_PRECONDITION: Google Cloud AutoML Natural Language was retired on March 15, 2024. Please migrate to Vertex AI instead
"cloud-sql/mysql/mysql", // (untested) Error: expected 200 "OK", got 500 "Internal Server Error"
"cloud-sql/mysql/mysql2", // (untested) Error: Cannot find module './connect-connector-with-iam-authn.js'
"cloud-sql/postgres/knex", // (untested) CloudSQLConnectorError: Malformed instance connection name provided: expected format of "PROJECT:REGION:INSTANCE", got undefined
"cloud-sql/sqlserver/mssql", // (untested) TypeError: The "config.server" property is required and must be of type string.
Expand Down
10 changes: 10 additions & 0 deletions cloud-sql/mysql/mysql/ci-setup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"env": {
"INSTANCE_HOST": "127.0.0.1",
"CLOUD_SQL_CONNECTION_NAME": "nodejs-docs-samples-tests:us-central1:mysql-ci",
"DB_NAME": "kokoro_ci",
"DB_USER": "kokoro_ci"
},
"secrets": {
"DB_PASSWORD": "nodejs-docs-samples-tests/nodejs-docs-samples-sql-password" }
}
2 changes: 1 addition & 1 deletion cloud-sql/mysql/mysql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"scripts": {
"start": "node server/server.js",
"system-test": "c8 mocha -p -j 2 test/server.test.js --timeout=60000 --exit",
"system-test": "test/proxy-setup.sh && c8 mocha -p -j 2 test/server.test.js --timeout=60000 --exit",
"system-test-unix": "c8 mocha -p -j 2 test/server-unix.test.js --timeout=60000 --exit",
"test": "npm run system-test && npm run system-test-unix"
},
Expand Down
19 changes: 19 additions & 0 deletions cloud-sql/mysql/mysql/test/proxy-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Proof of concept: setting up proxy

curl -o cloud-sql-proxy https://storage.googleapis.com/cloud-sql-connectors/cloud-sql-proxy/v2.15.1/cloud-sql-proxy.linux.amd64
chmod +x cloud-sql-proxy
./cloud-sql-proxy $CLOUD_SQL_CONNECTION_NAME &
Loading