Skip to content

Conversation

@davidcavazos
Copy link

@davidcavazos davidcavazos commented Sep 20, 2024

Description

This is an effort to speed up checks for pull requests, while at the same time simplifying the existing testing infrastructure in Node.js by using a dynamic strategy matrix.

Note: We're currently not using the run-all command, that's infrastructure that will eventually be used to optimize the nightly jobs.

These new tests are marked as experimental, so they shouldn't block any pull requests from merging. Once we have all the tests working on the new infrastructure and we feel comfortable with it, we can go ahead and disable the old tests.

Checklist

  • I have followed guidelines from CONTRIBUTING.MD and Samples Style Guide
  • Tests pass: npm test (see Testing)
  • Lint pass: npm run lint (see Style)
  • These samples need a new API enabled in testing projects to pass (let us know which ones)
  • These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
  • This pull request is from a branch created directly off of GoogleCloudPlatform/nodejs-docs-samples. Not a fork.
  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new sample directory, and I created GitHub Actions workflow for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • Please merge this PR for me once it is approved

@product-auto-label product-auto-label bot added samples Issues that are directly related to samples. api: language Issues related to the Cloud Natural Language API API. api: workflows Issues related to the Workflows API. labels Sep 20, 2024
@davidcavazos davidcavazos added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Sep 20, 2024
@davidcavazos davidcavazos changed the title Testing isolation feat: testing isolation Sep 20, 2024
@davidcavazos davidcavazos marked this pull request as ready for review October 9, 2024 21:44
@davidcavazos davidcavazos requested review from a team as code owners October 9, 2024 21:44

func Affected(config Config, diffs []string) ([]string, error) {
changed := Changed(config, diffs)
if slices.Contains(changed, ".") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wow is this new fancy slices packages nice. Back in my day ... ;D.

[No action required]

Copy link
Contributor

@telpirion telpirion left a comment

Choose a reason for hiding this comment

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

Looking really good! I will probably take another look at the parallelized code in RunAll() (but it looks solid prima facie).

Global: make sure that exported types, functions, and methods all have Godoc comments.

Copy link
Contributor

@telpirion telpirion left a comment

Choose a reason for hiding this comment

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

Very nicely done. One minor nit, but otherwise--let's ship it!

Copy link
Contributor

Choose a reason for hiding this comment

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

nit (very minor): Go style is to keep tests and the code under test together.

)

func TestLoadConfig(t *testing.T) {
tests := []struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Great use of table testing!

@davidcavazos
Copy link
Author

Moved tests into the source directory, updated README as well.

@iennae
Copy link
Contributor

iennae commented Nov 16, 2024

@gemini review

1 similar comment
@iennae
Copy link
Contributor

iennae commented Nov 18, 2024

@gemini review

@davidcavazos davidcavazos removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 18, 2024
@davidcavazos davidcavazos merged commit 583f84e into main Nov 18, 2024
137 checks passed
@davidcavazos davidcavazos deleted the testing-isolation branch November 18, 2024 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: language Issues related to the Cloud Natural Language API API. api: workflows Issues related to the Workflows API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants