Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Run system tests on Kokoro #78

Merged
merged 4 commits into from
Sep 28, 2018
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 .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Thanks for stopping by to let us know something could be better!
Please run down the following list and make sure you've tried the usual "quick
fixes":

- Search the issues already opened: https://github.com/https://github.com/google/google-p12-pem/issues
- Search the issues already opened: https://github.com/google/google-p12-pem/issues
- Search the issues on our "catch-all" repository: https://github.com/GoogleCloudPlatform/google-cloud-node
- Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js

Expand Down
4 changes: 2 additions & 2 deletions .kokoro/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ action {
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "/.kokoro/trampoline.sh"
build_file: "google-p12-pem/.kokoro/trampoline.sh"

# Configure the docker image for kokoro-trampoline.
env_vars: {
Expand All @@ -20,5 +20,5 @@ env_vars: {
}
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/test.sh"
value: "github/google-p12-pem/.kokoro/test.sh"
}
4 changes: 2 additions & 2 deletions .kokoro/continuous/node10/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ action {
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "/.kokoro/trampoline.sh"
build_file: "google-p12-pem/.kokoro/trampoline.sh"

# Configure the docker image for kokoro-trampoline.
env_vars: {
Expand All @@ -20,5 +20,5 @@ env_vars: {
}
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/test.sh"
value: "github/google-p12-pem/.kokoro/test.sh"
}
4 changes: 2 additions & 2 deletions .kokoro/continuous/node6/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ action {
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "/.kokoro/trampoline.sh"
build_file: "google-p12-pem/.kokoro/trampoline.sh"

# Configure the docker image for kokoro-trampoline.
env_vars: {
Expand All @@ -20,5 +20,5 @@ env_vars: {
}
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/test.sh"
value: "github/google-p12-pem/.kokoro/test.sh"
}
4 changes: 2 additions & 2 deletions .kokoro/continuous/node8/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ action {
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "/.kokoro/trampoline.sh"
build_file: "google-p12-pem/.kokoro/trampoline.sh"

# Configure the docker image for kokoro-trampoline.
env_vars: {
Expand All @@ -20,5 +20,5 @@ env_vars: {
}
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/test.sh"
value: "github/google-p12-pem/.kokoro/test.sh"
}
2 changes: 1 addition & 1 deletion .kokoro/continuous/node8/docs.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/docs.sh"
value: "github/google-p12-pem/.kokoro/docs.sh"
}
2 changes: 1 addition & 1 deletion .kokoro/continuous/node8/lint.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/lint.sh"
value: "github/google-p12-pem/.kokoro/lint.sh"
}
2 changes: 1 addition & 1 deletion .kokoro/continuous/node8/samples-test.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs"

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/samples-test.sh"
value: "github/google-p12-pem/.kokoro/samples-test.sh"
}
2 changes: 1 addition & 1 deletion .kokoro/continuous/node8/system-test.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs"

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/system-test.sh"
value: "github/google-p12-pem/.kokoro/system-test.sh"
}
4 changes: 2 additions & 2 deletions .kokoro/presubmit/node10/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ action {
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "/.kokoro/trampoline.sh"
build_file: "google-p12-pem/.kokoro/trampoline.sh"

# Configure the docker image for kokoro-trampoline.
env_vars: {
Expand All @@ -20,5 +20,5 @@ env_vars: {
}
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/test.sh"
value: "github/google-p12-pem/.kokoro/test.sh"
}
4 changes: 2 additions & 2 deletions .kokoro/presubmit/node6/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ action {
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "/.kokoro/trampoline.sh"
build_file: "google-p12-pem/.kokoro/trampoline.sh"

# Configure the docker image for kokoro-trampoline.
env_vars: {
Expand All @@ -20,5 +20,5 @@ env_vars: {
}
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/test.sh"
value: "github/google-p12-pem/.kokoro/test.sh"
}
4 changes: 2 additions & 2 deletions .kokoro/presubmit/node8/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ action {
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "/.kokoro/trampoline.sh"
build_file: "google-p12-pem/.kokoro/trampoline.sh"

# Configure the docker image for kokoro-trampoline.
env_vars: {
Expand All @@ -20,5 +20,5 @@ env_vars: {
}
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/test.sh"
value: "github/google-p12-pem/.kokoro/test.sh"
}
2 changes: 1 addition & 1 deletion .kokoro/presubmit/node8/docs.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/docs.sh"
value: "github/google-p12-pem/.kokoro/docs.sh"
}
2 changes: 1 addition & 1 deletion .kokoro/presubmit/node8/lint.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/lint.sh"
value: "github/google-p12-pem/.kokoro/lint.sh"
}
2 changes: 1 addition & 1 deletion .kokoro/presubmit/node8/samples-test.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs"

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/samples-test.sh"
value: "github/google-p12-pem/.kokoro/samples-test.sh"
}
2 changes: 1 addition & 1 deletion .kokoro/presubmit/node8/system-test.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-nodejs"

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/system-test.sh"
value: "github/google-p12-pem/.kokoro/system-test.sh"
}
2 changes: 1 addition & 1 deletion .kokoro/presubmit/windows/test.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Use the test file directly
build_file: "/.kokoro/test.bat"
build_file: "google-p12-pem/.kokoro/test.bat"
5 changes: 5 additions & 0 deletions .kokoro/samples-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ export GCLOUD_PROJECT=long-door-651

cd $(dirname $0)/..

# Run a pre-test hook, if a pre-samples-test.sh is in the project
if [ -f .kokoro/pre-samples-test.sh ]; then
. .kokoro/pre-samples-test.sh
fi

npm install

# Install and link samples
Expand Down
7 changes: 6 additions & 1 deletion test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ import * as assert from 'assert';
import * as fs from 'fs';
import {getPem} from '../src/index';

const _stripCarriageReturns = (str: string): string => {
return str.replace(/\r/g, '');
};

describe('GoogleP12Pem', () => {
const GOODP12FILE = './test/assets/key.p12';
const BADP12FILE = './test/assets/badkey.p12';
const PEMFILENAME = './test/assets/key.pem';
const expectedPem = fs.readFileSync(PEMFILENAME, {encoding: 'utf8'});
const expectedPem =
_stripCarriageReturns(fs.readFileSync(PEMFILENAME, {encoding: 'utf8'}));

it('should exist', () => {
assert.strictEqual(typeof getPem, 'function');
Expand Down