Skip to content

Commit

Permalink
Update cloud-sql/mysql sample
Browse files Browse the repository at this point in the history
Update Node version to 10 for GAE Standard.
Delete repo-tools.
Clean up package.json
  • Loading branch information
fhinkel committed Nov 27, 2019
1 parent 088778c commit af7c8fb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 34 deletions.
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

0 comments on commit af7c8fb

Please sign in to comment.