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

feat: test-isolation env var interpolation #3977

Merged
merged 33 commits into from
Feb 19, 2025
Merged

Conversation

davidcavazos
Copy link
Contributor

@davidcavazos davidcavazos commented Feb 13, 2025

Description

  • Adds support for environment variable interpolation
  • Separates the env var export logic into its own script
  • Adds tests for the new script
  • Adds a small CLI script for local testing of the env vars
  • Adds RUN_ID automatic variable
  • Removes the authentication settings from the config

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

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: dlp Issues related to the Sensitive Data Protection API. api: workflows Issues related to the Workflows API. labels Feb 13, 2025
@davidcavazos davidcavazos changed the title Env var interpolation feat: test-isolation env var interpolation Feb 13, 2025
@davidcavazos davidcavazos marked this pull request as ready for review February 15, 2025 00:05
Copy link
Member

@briandorsey briandorsey left a comment

Choose a reason for hiding this comment

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

Overall LGTM.

If possible, is there a way we could force a run of testing all the existing packages? It'd be good to make sure the things that have been working still are. (even though we know a few dozen packages need local config)

@davidcavazos
Copy link
Contributor Author

The scripts directory was matched as a valid package, so I added it to the ignore list. I removed the workflows directory from the ignore list, the rationale being that changes to the GH actions workflows should trigger all jobs.

Eventually the scripts directory should live in our tools repo and should be tested over there. Ideally we should also add the "run tests via a comment" functionality at some point, but for now this served as a workaround.

@davidcavazos
Copy link
Contributor Author

Ignoring the "experimental" failures, we got generative-ai/snippets, healthcare/dicom, and media/transcoder as failures. I know generative-ai is flaky on concurrent runs, the other errors seem like that too. I'm taking notes on those packages and marking them as "flaky", re-running tests.

@davidcavazos
Copy link
Contributor Author

davidcavazos commented Feb 19, 2025

healtcare/dicom is failing due to some npm install, trying on Node 16.

Update: Node 16 fixed it

@davidcavazos davidcavazos requested a review from a team as a code owner February 19, 2025 03:13
@davidcavazos
Copy link
Contributor Author

media/transcoder is getting a timeout, it's taking more than 10 minutes. Updating its setup file.

I also made changes to the config files to trigger all tests.

@davidcavazos davidcavazos requested a review from a team as a code owner February 19, 2025 03:29
@davidcavazos
Copy link
Contributor Author

The generative-ai/snippets was flaky since it was expecting a very specific number of output tokens from a generative AI model, which is nondeterministic. Fixing that test should make all tests pass now.

@davidcavazos
Copy link
Contributor Author

All non-experimental tests are passing.

@davidcavazos davidcavazos merged commit 3fcecd0 into main Feb 19, 2025
148 of 186 checks passed
@davidcavazos davidcavazos deleted the env-var-interpolation branch February 19, 2025 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: dlp Issues related to the Sensitive Data Protection 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.

3 participants