-
Notifications
You must be signed in to change notification settings - Fork 105
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
fix: skip some tests when run against the emulator #933
fix: skip some tests when run against the emulator #933
Conversation
Otherwise test is flaky with the emulator.
Codecov Report
@@ Coverage Diff @@
## master #933 +/- ##
=======================================
Coverage 98.20% 98.20%
=======================================
Files 21 21
Lines 19959 19959
Branches 1069 1069
=======================================
Hits 19601 19601
Misses 354 354
Partials 4 4 Continue to review full report at Codecov.
|
@skuruppu I have skipped all needed tests and fixed related errors. I am not sure:
|
@@ -1051,13 +1070,23 @@ describe('Spanner', () => { | |||
}); | |||
|
|||
after(async () => { | |||
await restoreDatabase.delete(); |
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.
Would doing this here work:?
if (emulatorEnabled) {
this.skip();
}
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.
This doesn't work. I tried this at the beginning.
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.
I got the following error:
Error: `this.skip` forbidden
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.
I did some research. The documentation says to just do a return
instead of a skip
. I updated the code.
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.
Good catch. Thanks for making this more elegant.
@skuruppu I think we need to clean up the leftover instances in the GCP project. It fails to add a new instance. |
I agree, it's weird though because the tests actually try to clean up the instances before it creates a new one. I'm not sure why that's not working. I suppose it's because we try to create an instance before deleting the old ones? |
I guess the instance ID is generated by date: const INSTANCE_ID = process.env.SPANNERTEST_INSTANCE || `test-instance-${date}`; The old one from yesterday is not deleted. |
I created #955, let's see if it runs. |
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.
LGTM.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #932 🦕