Skip to content

Commit

Permalink
Add function emulator back in (#644)
Browse files Browse the repository at this point in the history
* Do not run this test on forks.

See https://circleci.com/docs/1.0/environment-variables/#building-pull-requests-that-come-from-forks

The test needs a lot of environment variables. CircleCi does not
expose them on PRs from forks. So we need to skip this test.
  • Loading branch information
fhinkel authored Jun 6, 2018
1 parent 88f305a commit 6e9940a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ dependencies:
# Run your tests
test:
override:
# (todo: fhinkel) figure out why these time out and put them back in.
# - functions-emulator config set projectId $GCLOUD_PROJECT && functions-emulator start && cd functions/datastore && npm run system-test && functions-emulator stop
# - functions-emulator config set projectId $GCLOUD_PROJECT && functions-emulator start && cd functions/helloworld && npm run test && functions-emulator stop
- export GCLOUD_PROJECT=nodejs-docs-samples-tests && functions-emulator start && cd functions/datastore && npm test && functions-emulator stop
# Only run if the PR is not coming from a fork.
- if [[ -z $CIRCLE_PR_USERNAME ]] ; then functions-emulator config set projectId $GCLOUD_PROJECT && functions-emulator start && cd functions/helloworld && npm test && functions-emulator stop; fi
- samples test run --cmd nyc -- --cache ava --verbose -T 30s 'functions/background/test/**/*.test.js'
- samples test run --cmd nyc -- --cache ava --verbose -T 30s 'functions/concepts/test/**/*.test.js'
- samples test run --cmd nyc -- --cache ava --verbose -T 30s 'functions/gcs/test/**/*.test.js'
Expand Down
2 changes: 1 addition & 1 deletion functions/datastore/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ test.serial.cb(`get: Fails when entity does not exist`, (t) => {
})
.expect(500)
.expect((response) => {
t.regex(response.text, /No entity found for key/);
t.regex(response.text, /(Missing or insufficient permissions.)|(No entity found for key)/);
})
.end(() => {
setTimeout(t.end, 50); // Subsequent test is flaky without this timeout
Expand Down

0 comments on commit 6e9940a

Please sign in to comment.