Skip to content
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

Update cloud-sql/mysql sample #1552

Merged
merged 1 commit into from
Nov 27, 2019
Merged
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
2 changes: 1 addition & 1 deletion cloud-sql/mysql/mysql/app.standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

runtime: nodejs8
runtime: nodejs10

# The following env variables may contain sensitive information that grants
# anyone access to your database. Do not add this file to your source control.
Expand Down
31 changes: 2 additions & 29 deletions cloud-sql/mysql/mysql/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "cloudsql-mysql-mysql",
"description": "Node.js Cloud SQL MySQL Connectivity Sample",
"version": "0.0.1",
"private": true,
"license": "Apache-2.0",
"author": "Google Inc.",
Expand All @@ -10,51 +9,25 @@
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.0.0"
},
"scripts": {
"system-test": "mocha test/*.test.js --timeout=60000 --exit",
"test": "npm run system-test"
},
"dependencies": {
"@google-cloud/logging-winston": "^3.0.0",
"body-parser": "1.19.0",
"body-parser": "^1.19.0",
"express": "^4.17.1",
"promise-mysql": "^4.0.0",
"prompt": "^1.0.0",
"pug": "^2.0.3",
"winston": "^3.1.0"
},
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "^3.3.0",
"mocha": "^6.0.0",
"proxyquire": "^2.1.0",
"supertest": "^4.0.0",
"sinon": "^7.1.1"
},
"cloud-repo-tools": {
"requiresKeyFile": true,
"requiresProjectId": true,
"test": {
"app": {
"requiredEnvVars": [
"DB_USER",
"DB_PASS",
"DB_NAME",
"CLOUD_SQL_INSTANCE_NAME"
],
"args": [
"server.js"
]
},
"build": {
"requiredEnvVars": [
"DB_USER",
"DB_PASS",
"DB_NAME",
"CLOUD_SQL_INSTANCE_NAME"
]
}
}
}
}
4 changes: 0 additions & 4 deletions cloud-sql/mysql/mysql/test/server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
const request = require('supertest');
const sinon = require('sinon');
const assert = require('assert');
const tools = require('@google-cloud/nodejs-repo-tools');

// Stub out MySQL calls
const stubMysql = sinon.stub(require('promise-mysql'));
Expand All @@ -30,9 +29,6 @@ stubMysql.createPool.returns(poolStub);

const server = require('../server.js');

beforeEach(tools.stubConsole);
afterEach(tools.restoreConsole);

it('check index page', async () => {
const response = await request(server)
.get('/')
Expand Down