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

build: make tests run faster #4205

Merged
merged 98 commits into from
May 3, 2023
Merged

build: make tests run faster #4205

merged 98 commits into from
May 3, 2023

Conversation

sofisl
Copy link
Contributor

@sofisl sofisl commented Apr 24, 2023

Partially addresses #4140

  • Previous builds are cancelled when new builds are started on the same branch
  • MinifyProtos is moved to postpack for publishing, removed from running before test execution; sample & system tests do not compile before running, since the prepare script will do that as well
  • Switch to using github actions for unit tests and pnpm instead of npm
  • Check returns immediately if it fails

@sofisl sofisl requested a review from a team as a code owner April 24, 2023 22:36
@sofisl sofisl requested a review from a team as a code owner April 26, 2023 18:02
@snippet-bot
Copy link

snippet-bot bot commented May 1, 2023

Here is the summary of changes.

You are about to add 3 region tags.
You are about to delete 3 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@sofisl sofisl changed the title attempt1 build: decrease test speed execution May 2, 2023
@sofisl sofisl changed the title build: decrease test speed execution build: make tests run faster May 2, 2023
const fs = require('fs');
const path = require('path');
const cp = require('child_process');
const dirsToSkip = ['gapic-node-templating', 'typeless-sample-bot'];
Copy link
Contributor

Choose a reason for hiding this comment

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

what purpose does this script serve?

Copy link
Contributor Author

@sofisl sofisl May 2, 2023

Choose a reason for hiding this comment

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

I will delete it! Shouldn't be in here. I'll wait once this is approved to delete it so tests won't rerun.

@@ -57,6 +58,7 @@
"jsdoc-fresh": "^2.0.0",
"jsdoc-region-tag": "^2.0.0",
"linkinator": "^4.0.0",
"long": "^5.2.3",
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we should need to add this long dependency, as it's pulled in by google-gax. I'm curious why this was needed.

Copy link
Contributor Author

@sofisl sofisl May 2, 2023

Choose a reason for hiding this comment

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

The way pnpm installs dependencies doesn't grab this dependency. It's really only for this line. I spoke with @alexander-fenster about this, and he recommended adding it as a devDependency, over skipping type checking in the tsconfig.

I think this is actually a benefit, it shows that pnpm is not implicitly grabbing dependencies in the way npm was, since we are actually using long since it is used in protos.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

commenting these tests out per b/278007126

Copy link
Contributor

@bcoe bcoe 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 looking really good to me.

The main thing that jumps out at me, is I'd rather avoid the make-change-to-package.cjs which feels a little magical (where is this actually invoked?).

I like that you did not have to actually switch the package.json itself to using pnpm. Did you notice a significant performance improvement using pnpm rather than npm?

@sofisl sofisl requested a review from bcoe May 2, 2023 18:04
Copy link
Contributor

@bcoe bcoe left a comment

Choose a reason for hiding this comment

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

ship it!

@sofisl sofisl merged commit 628023a into main May 3, 2023
@sofisl sofisl deleted the cleanUpBuildResources branch May 3, 2023 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants