Skip to content

Commit efd5936

Browse files
committed
chore(cloud-sql): migrate mysql, postgres samples to new CI
1 parent fd6ec65 commit efd5936

File tree

6 files changed

+33
-4
lines changed

6 files changed

+33
-4
lines changed

.github/config/nodejs-dev.jsonc

+2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@
101101
"batch",
102102
"cloud-language",
103103
"cloud-sql/mysql/mysql",
104+
"cloud-sql/mysql/mysql2",
105+
"cloud-sql/postgres/knex",
104106
"cloud-tasks/snippets",
105107
"cloud-tasks/tutorial-gcf/app",
106108
"cloud-tasks/tutorial-gcf/function",

.github/config/nodejs-prod.jsonc

-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@
7777
// TODO: fix these
7878
"ai-platform/snippets", // PERMISSION_DENIED: Permission denied: Consumer 'projects/undefined' has been suspended.
7979
"automl", // (untested) FAILED_PRECONDITION: Google Cloud AutoML Natural Language was retired on March 15, 2024. Please migrate to Vertex AI instead
80-
"cloud-sql/mysql/mysql2", // (untested) Error: Cannot find module './connect-connector-with-iam-authn.js'
81-
"cloud-sql/postgres/knex", // (untested) CloudSQLConnectorError: Malformed instance connection name provided: expected format of "PROJECT:REGION:INSTANCE", got undefined
8280
"cloud-sql/sqlserver/mssql", // (untested) TypeError: The "config.server" property is required and must be of type string.
8381
"cloud-sql/sqlserver/tedious", // (untested) TypeError: The "config.server" property is required and must be of type string.
8482
"compute", // GoogleError: The resource 'projects/long-door-651/zones/us-central1-a/disks/disk-from-pool-name' was not found

cloud-sql/mysql/mysql2/ci-setup.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"env": {
3+
"INSTANCE_HOST": "127.0.0.1",
4+
"INSTANCE_CONNECTION_NAME": "nodejs-docs-samples-tests:us-central1:mysql-ci",
5+
"UNIX_SOCKET_DIR": "tmp/cloudsql",
6+
"CLOUD_SQL_CONNECTION_NAME": "$INSTANCE_CONNECTION_NAME",
7+
"INSTANCE_UNIX_SOCKET": "$UNIX_SOCKET_DIR/$INSTANCE_CONNECTION_NAME",
8+
"DB_NAME": "kokoro_ci",
9+
"DB_USER": "kokoro_ci"
10+
},
11+
"secrets": {
12+
"DB_PASS": "nodejs-docs-samples-tests/nodejs-docs-samples-sql-password"
13+
}
14+
}

cloud-sql/mysql/mysql2/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'use strict';
1616

1717
const express = require('express');
18-
const createConnectorIAMAuthnPool = require('./connect-connector-with-iam-authn.js');
18+
const createConnectorIAMAuthnPool = require('./connect-connector-auto-iam-authn.js');
1919
const createConnectorPool = require('./connect-connector.js');
2020
const createTcpPool = require('./connect-tcp.js');
2121
const createUnixSocketPool = require('./connect-unix.js');

cloud-sql/postgres/knex/ci-setup.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"env": {
3+
"INSTANCE_HOST": "127.0.0.1",
4+
"INSTANCE_CONNECTION_NAME": "nodejs-docs-samples-tests:us-central1:postgres-ci",
5+
"UNIX_SOCKET_DIR": "tmp/cloudsql",
6+
"CLOUD_SQL_CONNECTION_NAME": "$INSTANCE_CONNECTION_NAME",
7+
"INSTANCE_UNIX_SOCKET": "$UNIX_SOCKET_DIR/$INSTANCE_CONNECTION_NAME",
8+
"DB_NAME": "kokoro_ci",
9+
"DB_USER": "kokoro_ci"
10+
},
11+
"secrets": {
12+
"DB_PASS": "nodejs-docs-samples-tests/nodejs-docs-samples-sql-password"
13+
}
14+
}

cloud-sql/postgres/knex/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
},
1515
"scripts": {
1616
"start": "node server/server.js",
17+
"proxy": "$GITHUB_WORKSPACE/.github/workflows/utils/sql-proxy.sh",
1718
"start-proxy": "! pgrep cloud_sql_proxy > /dev/null && cloud_sql_proxy -dir=/cloudsql -instances=$INSTANCE_CONNECTION_NAME &",
18-
"test": "c8 mocha -p -j 2 test/*.test.js --timeout=60000 --exit"
19+
"test": "npm run proxy -- c8 mocha -p -j 2 test/*.test.js --timeout=60000 --exit"
1920
},
2021
"dependencies": {
2122
"@google-cloud/cloud-sql-connector": "^1.0.0",

0 commit comments

Comments
 (0)