Skip to content

chore(ci): migrate sqlserver/mssql sample to new ci #4066

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -103,6 +103,7 @@
"cloud-sql/mysql/mysql",
"cloud-sql/mysql/mysql2",
"cloud-sql/postgres/knex",
"cloud-sql/sqlserver/mssql",
"cloud-tasks/snippets",
"cloud-tasks/tutorial-gcf/app",
"cloud-tasks/tutorial-gcf/function",
Expand Down
1 change: 0 additions & 1 deletion .github/config/nodejs.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/sqlserver/mssql", // (untested) TypeError: The "config.server" property is required and must be of type string.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line is being removed, which makes sense since the sample is being migrated to the nodejs-dev.jsonc config. However, it's important to ensure that the reason for the previous failure (TypeError: The "config.server" property is required and must be of type string.) has been addressed in the new CI setup. Otherwise, the sample might still fail in the new CI environment.

"cloud-sql/sqlserver/tedious", // (untested) TypeError: The "config.server" property is required and must be of type string.
"compute", // GoogleError: The resource 'projects/long-door-651/zones/us-central1-a/disks/disk-from-pool-name' was not found
"dataproc", // GoogleError: Error submitting create cluster request: Multiple validation errors
Expand Down
12 changes: 12 additions & 0 deletions cloud-sql/sqlserver/mssql/ci-setup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"env": {
"INSTANCE_HOST": "127.0.0.1",
"INSTANCE_CONNECTION_NAME": "nodejs-docs-samples-tests:us-central1:sql-server-ci",
"CLOUD_SQL_CONNECTION_NAME": "$INSTANCE_CONNECTION_NAME",
"DB_NAME": "kokoro_ci",
"DB_USER": "kokoro_ci"
},
"secrets": {
"DB_PASS": "nodejs-docs-samples-tests/nodejs-docs-samples-sql-password"
}
}
3 changes: 2 additions & 1 deletion cloud-sql/sqlserver/mssql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
},
"scripts": {
"start": "node server/server.js",
"system-test": "c8 mocha -p -j 2 test/*.test.js --timeout=60000 --exit",
"proxy": "$GITHUB_WORKSPACE/.github/workflows/utils/sql-proxy.sh",
"system-test": "npm run proxy -- c8 mocha -p -j 2 test/*.test.js --timeout=60000 --exit",
Comment on lines +16 to +17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The proxy script is introduced here. It's good to see that the SQL proxy is being used for system tests. However, it would be helpful to add a comment explaining what this script does and why it's needed. This will improve the maintainability of the code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The system-test script now uses the proxy script. It's important to ensure that the sql-proxy.sh script is executable. Also, consider adding a check to ensure that the proxy is running before running the tests. This will prevent the tests from failing if the proxy is not running.

"test": "npm run system-test"
},
"dependencies": {
Expand Down
Loading