Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: system tests for gax #334

Merged
merged 10 commits into from
Oct 28, 2018
Merged

chore: system tests for gax #334

merged 10 commits into from
Oct 28, 2018

Conversation

alexander-fenster
Copy link
Contributor

@alexander-fenster alexander-fenster commented Oct 27, 2018

Introducing system tests for gax. The test does the following:

  • clones video intelligence, Pub/Sub, and Speech, and checks out their latest releases;
  • npm link local gax;
  • run system tests for the cloned packages;
  • display coverage.

I expect it will make updating and/or refactoring gax less scary.

Changes to CircleCI config for synthtool: googleapis/synthtool#114.

  • Tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 27, 2018
alexander-fenster added a commit to googleapis/synthtool that referenced this pull request Oct 27, 2018
I need `npm link` in system tests for gax. It does not change any behavior for other libraries.
Context: googleapis/gax-nodejs#334
@alexander-fenster
Copy link
Contributor Author

It even works in Kokoro!

FYI, here is the coverage of gax code by those system tests:

-------------------------|----------|----------|----------|----------|-------------------|
File                     |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
-------------------------|----------|----------|----------|----------|-------------------|
All files                |    39.15 |    21.91 |    43.98 |    36.98 |                   |
 GoogleError.ts          |      100 |      100 |      100 |      100 |                   |
 api_callable.ts         |    70.09 |    53.06 |    76.67 |    68.18 |... 52,359,403,411 |
 bundling.ts             |    13.46 |        0 |    12.12 |     11.5 |... 70,571,572,583 |
 gax.ts                  |     68.8 |    49.51 |    64.29 |    68.29 |... 63,665,666,669 |
 grpc.ts                 |    71.77 |    46.51 |       75 |    72.17 |... 58,360,361,363 |
 index.ts                |      100 |      100 |      100 |      100 |                   |
 longrunning.ts          |    78.47 |    61.02 |    86.21 |    77.37 |... 64,369,370,429 |
 operations_client.ts    |    65.79 |    16.67 |    64.29 |    63.89 |... 30,432,433,436 |
 paged_iteration.ts      |    24.47 |        5 |    33.33 |    21.98 |... 07,208,209,212 |
 parser_extras.ts        |    23.08 |        0 |        0 |    23.08 |... 94,113,114,115 |
 path_template.ts        |    16.22 |        0 |     9.09 |    15.07 |... 89,190,192,195 |
 path_template_parser.ts |      1.8 |        0 |     7.69 |      1.8 |... 30,632,633,636 |
 routing_header.ts       |    33.33 |      100 |        0 |       50 |                50 |
 streaming.ts            |    37.18 |     8.33 |    31.82 |    34.72 |... 96,200,204,208 |
-------------------------|----------|----------|----------|----------|-------------------|

Copy link
Contributor

@JustinBeckwith JustinBeckwith left a comment

Choose a reason for hiding this comment

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

This is freaking awesome.

package.json Outdated
@@ -67,7 +70,7 @@
"prepare": "npm run compile",
"pretest-only": "npm run compile",
"posttest": "npm run lint",
"system-test": "echo no system tests 😱",
"system-test": "nyc mocha --no-timeouts build/system-test/system.js",

This comment was marked as spam.

package.json Outdated
@@ -82,5 +85,13 @@
"homepage": "https://github.com/googleapis/gax-nodejs#readme",
"engines": {
"node": ">=6.0.0"
},
"nyc": {
"include": [

This comment was marked as spam.

This comment was marked as spam.

const maxBuffer = 10 * 1024 * 1024;
console.log(`Execute: ${command} [cwd: ${cwd}]`);
return new Promise<ExecuteResult>((resolve, reject) => {
cp.exec(command, {cwd, maxBuffer}, (err, stdout, stderr) => {

This comment was marked as spam.

This comment was marked as spam.

tsconfig.json Outdated
@@ -9,6 +9,7 @@
},
"include": [
"src/*.ts",
"test/*.ts"
"test/*.ts",
"system-test/*.ts"

This comment was marked as spam.

@JustinBeckwith JustinBeckwith merged commit 69e55c7 into master Oct 28, 2018
JustinBeckwith pushed a commit to googleapis/synthtool that referenced this pull request Oct 28, 2018
I need `npm link` in system tests for gax. It does not change any behavior for other libraries.
Context: googleapis/gax-nodejs#334
@alexander-fenster alexander-fenster deleted the system-tests branch April 24, 2019 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants