From 3bf4de2754473a69d600e696cb2f8b562d229592 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 6 Sep 2018 11:28:31 -0700 Subject: [PATCH 1/3] Attempt to fix system tests --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 470cd85405e..0a0f59cb11a 100644 --- a/package.json +++ b/package.json @@ -69,6 +69,7 @@ "test": "nyc mocha build/test", "docs": "echo no docs 👻 # typedoc --out docs src && touch docs/.nojekyll", "system-test": "echo no system tests 👻", + "presamples-test": "npm run compile", "samples-test": "cd samples && npm link ../ && npm install && cd ../ && mocha build/test/samples", "lint": "gts check && semistandard 'samples/**/*.js'", "compile": "tsc -v && tsc -p . && copyfiles src/apis/**/README.md src/apis/**/package.json build", From db25609739dcf92edcdd42347d12da80db7ea808 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 6 Sep 2018 14:59:54 -0700 Subject: [PATCH 2/3] Fix samples tests --- package.json | 4 ++-- samples/package.json | 6 ++++++ test/samples/test.samples.drive.ts | 2 +- test/samples/test.samples.youtube.ts | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 0a0f59cb11a..b0c0c977f3c 100644 --- a/package.json +++ b/package.json @@ -66,11 +66,11 @@ "version": "33.0.0", "scripts": { "pretest": "npm run compile", + "prepare": "npm run compile", "test": "nyc mocha build/test", "docs": "echo no docs 👻 # typedoc --out docs src && touch docs/.nojekyll", "system-test": "echo no system tests 👻", - "presamples-test": "npm run compile", - "samples-test": "cd samples && npm link ../ && npm install && cd ../ && mocha build/test/samples", + "samples-test": "cd samples && npm link ../ && pwd && npm test", "lint": "gts check && semistandard 'samples/**/*.js'", "compile": "tsc -v && tsc -p . && copyfiles src/apis/**/README.md src/apis/**/package.json build", "build-tools": "tsc -p tsconfig.tools.json", diff --git a/samples/package.json b/samples/package.json index 583536bfa31..6be1aaacc17 100644 --- a/samples/package.json +++ b/samples/package.json @@ -3,9 +3,15 @@ "description": "The following samples show basic usage of various APIs.", "repository": "google/google-api-nodejs-client", "license": "Apache-2.0", + "scripts": { + "test": "mocha ../build/test/samples" + }, "dependencies": { "googleapis": "33.0.0", "opn": "^5.3.0", "server-destroy": "^1.0.1" + }, + "devDependencies": { + "mocha": "^5.2.0" } } diff --git a/test/samples/test.samples.drive.ts b/test/samples/test.samples.drive.ts index 62f96652967..ba3831275bb 100644 --- a/test/samples/test.samples.drive.ts +++ b/test/samples/test.samples.drive.ts @@ -35,7 +35,7 @@ for (const p in samples) { } } -const someFile = path.resolve('test/fixtures/public.pem'); +const someFile = path.join(__dirname, '../../../test/fixtures/public.pem'); describe('Drive samples', () => { afterEach(() => { diff --git a/test/samples/test.samples.youtube.ts b/test/samples/test.samples.youtube.ts index 6f4df926625..8973a7f6f54 100644 --- a/test/samples/test.samples.youtube.ts +++ b/test/samples/test.samples.youtube.ts @@ -30,7 +30,7 @@ for (const p in samples) { } } -const someFile = path.resolve('test/fixtures/public.pem'); +const someFile = path.join(__dirname, '../../../test/fixtures/public.pem'); describe('YouTube samples', () => { afterEach(() => { From 55c5f39c3affe4529ec03959c987023ccb75c52d Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 6 Sep 2018 15:28:23 -0700 Subject: [PATCH 3/3] extend --- test/test.kitchen.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test.kitchen.ts b/test/test.kitchen.ts index 1c1d895b9e2..7c105a5a5fb 100644 --- a/test/test.kitchen.ts +++ b/test/test.kitchen.ts @@ -61,7 +61,7 @@ describe('kitchen sink', async () => { await mvp(tarball, `${stagingPath}/googleapis.tgz`); await ncpp('test/fixtures/kitchen', `${stagingPath}/`); await spawnp('npm', ['install'], {cwd: `${stagingPath}/`}); - }).timeout(40000); + }).timeout(80000); }); /**