Skip to content

Conversation

@saraford
Copy link
Contributor

In this PR:

  1. Updated existing test to use a name "Cecil" instead of "World". If the name parameter fails, the default is Hello World, so the test will always pass.
  2. I've added a unit test example to show the FF testing layer, hence changed the test folder to "tests" and renamed the existing test to integration tests.

❓ I noticed that I can run mocha tests/integration-tests.js or mocha tests/unit-tests.js successfully individually. But if I try to follow the style in other samples by running npm run test where test is mocha tests/*-tests.js --timeout=60000, the second test that's run will fail.

@saraford saraford requested review from a team and ace-n as code owners May 11, 2022 02:56
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label May 11, 2022
Copy link
Contributor

@ace-n ace-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once lint errors and comments addressed.


RE testing - I wonder if the FF is running a server under the hood? Trying to run two servers on the same port might cause failures.

(We can chat more about this later this afternoon, too.)

},
"scripts": {
"test": "mocha test/index.test.js"
"test": "mocha tests/*-tests.js --timeout=60000"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I believe this repo's convention is to use a test directory (no s)

@ace-n ace-n changed the title WIP: updated helloPubSub to use new FF testing layer WIP: feat(functions/helloPubSub): use new FF testing layer May 11, 2022
@product-auto-label product-auto-label bot added the api: cloudfunctions Issues related to the Cloud Run functions API. label May 12, 2022
Co-authored-by: Averi Kitsch <akitsch@google.com>
@ace-n ace-n changed the title WIP: feat(functions/helloPubSub): use new FF testing layer feat(functions/helloPubSub): use new FF testing layer May 13, 2022
@averikitsch averikitsch enabled auto-merge (squash) May 18, 2022 19:06
@averikitsch averikitsch added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 18, 2022
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 18, 2022
@ace-n ace-n disabled auto-merge May 18, 2022 19:44
@ace-n ace-n enabled auto-merge (squash) May 18, 2022 19:45
@ace-n ace-n merged commit 4d0e7a9 into main May 18, 2022
@ace-n ace-n deleted the nodejs-pubsub-v2-update branch May 18, 2022 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: cloudfunctions Issues related to the Cloud Run functions API. samples Issues that are directly related to samples.

6 participants