-
Notifications
You must be signed in to change notification settings - Fork 112
test: skip backups test in samples #2497
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
Conversation
Summary of ChangesHello @alkatrivedi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the test suite's flexibility by allowing specific backup-related tests to be skipped under predefined conditions, such as during presubmit checks or when explicitly configured via an environment variable. This change aims to optimize CI/CD pipelines by potentially reducing test execution time or avoiding known flakiness in certain environments. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this 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 introduces a mechanism to skip backup-related tests based on environment variables, which is a good practice for managing test execution in different CI environments. However, I've identified a potential runtime error in the implementation. If the KOKORO_JOB_NAME environment variable is not set, the test suite will crash with a TypeError. I've provided a suggestion to make the code more robust against this scenario.
samples/system-test/spanner.test.js
Outdated
| let instance_already_exists = false; | ||
| let key1, key2, key3; | ||
| before(async () => { | ||
| if (SKIP_BACKUPS === 'true' || KOKORO_JOB_NAME.includes('presubmit')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the KOKORO_JOB_NAME environment variable is not set, KOKORO_JOB_NAME will be undefined. Calling .includes() on an undefined value will raise a TypeError and crash the test suite. Using optional chaining (?.) will prevent this by short-circuiting to undefined if KOKORO_JOB_NAME is nullish, which is then treated as falsy in the || expression.
| if (SKIP_BACKUPS === 'true' || KOKORO_JOB_NAME.includes('presubmit')) { | |
| if (SKIP_BACKUPS === 'true' || KOKORO_JOB_NAME?.includes('presubmit')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since node modules enforces ES2018 in the gts package, we strictly cannot use the optional chaining operator (?.) in the JavaScript files without overriding the configuration. The parser for ES2018 simply does not recognize that syntax, hence leading to the Parsing error: Unexpected token .
26831df to
6817ec3
Compare
6817ec3 to
b3f6950
Compare
b3f6950 to
b449be3
Compare
fe4652e to
99e6b28
Compare
Backups test are getting timeout on presubmit, leading to presubmit failure with the
ERROR: Aborting VM command. Hence, skipping them to unblock the release 8.4.0.