-
Notifications
You must be signed in to change notification settings - Fork 101
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
Added negative tests for restore of snapshots #173
Added negative tests for restore of snapshots #173
Conversation
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.
Some very small changes and a few naive questions :-)
Overall LGTM
} | ||
logger.Infoln("starting restore while snapshotter is running") | ||
err = rstr.Restore(RestoreOptions) | ||
Expect(err).Should(HaveOccurred()) |
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.
Should we add a check that the existing etcd data is left untouched?
return fmt.Errorf("entry not found for key %s", resKey) | ||
//handles deleted keys as every 10th key is deleted during populate etcd call | ||
if math.Mod(float64(currKey), 10) == 0 { | ||
continue //it should continue as key was put for action 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.
Should we check that it is indeed deleted/not there?
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.
@ashwani2k Thanks for the well-written and much-needed PR to improve test coverage. I have a few suggestions. Please make the necessary changes:
- Negative test separation: Ginkgo allows to run or skip specific specs or spec containers (Describe, Context, etc). You can change the text passed to the second Describe function to something like
NEGATIVE: For Dynamic Loads and Negative Scenarios
, and then pass the flag--focus="NEGATIVE\:.*"
to run only negative tests, or--skip
to skip them. This way, we can omit the--randomizeAllSpecs
flag while running the negative tests in a separate command within the unit test script. As the negative tests for restoration don't use the pre-populated snapstore, there will not be a time-overhead as well. This also makes it easy to debug when tests fail, as we'll know whether negative or non-negative tests failed.
dc5cb5d
to
9901518
Compare
9901518
to
7758833
Compare
7758833
to
caf9c6b
Compare
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.
@ashwani2k Thanks for addressing all the suggestions! LGTM 👍🏼
What this PR does / why we need it:
Added more negative tests for restore of snapshots.
Following test been added -
Which issue(s) this PR fixes:
Fixes partially #73 #104
Special notes for your reviewer:
Enhanced the populate script to capture delete of keys.
Some refactoring is done to segregate the tests into 2 categories -
Release note: