Skip to content

feat: remove unit tests from the generator#8130

Open
feywind wants to merge 17 commits intomainfrom
feywind-gh8018-remove-gen
Open

feat: remove unit tests from the generator#8130
feywind wants to merge 17 commits intomainfrom
feywind-gh8018-remove-gen

Conversation

@feywind
Copy link
Copy Markdown
Contributor

@feywind feywind commented Apr 28, 2026

This removes the unit tests from the generator.

I thought this would also cover removing sample tests, but it appears that's already happened.

Fixes #8019 🦕

@feywind feywind requested a review from a team as a code owner April 28, 2026 21:38
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request removes the Nunjucks templates used for generating unit tests in both CommonJS and ESM formats for TypeScript GAPIC clients. The reviewer pointed out that the generator's orchestration logic must be updated to remove references to these deleted templates to prevent runtime crashes. Additionally, it is recommended to clean up other templates, such as package.json.njk and README.md.njk, to remove now-obsolete test dependencies and documentation for the sake of consistency.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are we downgrading our gax version?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's actually not - there was a kerfuffle on npm versions. The newest release is 5.0.6, but we were making libraries with 5.1.1-rc1, which is way older. The older version was pulling in dependencies with vulns.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can remove sinon now right?

Do we need mocha or pack-n-play either?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sinon and pack-n-play are both used by the remaining system-test, but I think @danieljbruce is going to be removing those.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'll be removing pack and play, but gemini-cli didn't elect to remove sinon. I think sinon is used more in the unit tests. That is what I have noticed for nodejs-bigtable anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, pack-n-play is basically just used in the "make a package" test, and is probably not necessary anymore. Sinon is also used there, as well as mocha, so there's a bit of a chicken and egg problem. Whoever merges first should probably leave sinon/mocha and whoever merges second should remove both. I see some conflicts below, so maybe you already merged yours? I'll have to look.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I haven't merged yet. I may even vote to make removing sinon a separate buganizer item just so the change for the main issue in question can get through code review.

@danieljbruce
Copy link
Copy Markdown
Contributor

To review this PR and make sure my system tests are aligned I looked at the build: yarn changes commit directly before the baseline changes because the diff is actually really small at that point (main...a8017c6). A note for the reviewers is that to generate the baseline changes you just need to run npm run baseline.

Overall it LGTM, but the only thing I wonder about at this point is if the test scripts in text-fixtures also need to be changed to just echo. For example, should the test script in package.json files for text-fixtures just echo for the file location shown in the screenshot?

image

@pearigee
Copy link
Copy Markdown
Contributor

pearigee commented May 5, 2026

The test fixtures removed in this PR -- are they used in the generator tests? If so it may be worth preserving them. We want to thoroughly test the generator, just not to generate tests in the output packages.

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.

Remove unit tests from generator

3 participants