-
Notifications
You must be signed in to change notification settings - Fork 43
Declarative Tests for ScalingUpAndDown and Async rollback fixes #67
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
6f92804 to
e0f8511
Compare
| apiVersion: $CRD_GROUP/$CRD_VERSION | ||
| kind: ReplicationGroup | ||
| metadata: | ||
| name: test$RANDOM_SUFFIX |
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 name matches the scenario, it helps in debugging using cli later in case of failure.
Please consider names such as: cmd-dec-rep-$RANDOM_SUFFIX for this scenario
| primaryAvailabilityZone: "us-west-2b" | ||
| replicaAvailabilityZones: | ||
| - "us-west-2c" |
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.
Consider supplying these as replacement parameters. It will help in running the scenarios for other Region, AZ with minimal changes.
| scenario_files = sorted(os.listdir(scenarios_directory)) | ||
| for scenario_file in scenario_files: | ||
| scenario_file_full_path = join(scenarios_directory, scenario_file) | ||
| if isdir(scenario_file_full_path): | ||
| for nested_scenario_file in sorted(os.listdir(scenario_file_full_path)): | ||
| scenario_files.append(join(scenario_file, nested_scenario_file)) | ||
| continue | ||
|
|
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.
Consider using glob.glob(scenarios_directory + '**/*.yaml', recursive=True).
|
/test elasticache-kind-e2e |
1cb5156 to
95c671f
Compare
Declarative tests for ScaleUpAndDown.
324ccda to
196496e
Compare
f2418f3 to
0f83142
Compare
|
/retest |
| // This means that we have already attempted to apply the CacheNodeType once and | ||
| // were not successful hence we will set a terminal condition. | ||
| if !cacheNodeTypeRequiresUpdate(desired) && delta.DifferentAt("Spec.CacheNodeType") { | ||
| return nil, awserr.New("InvalidParameterCombination", "Cannot update CacheNodeType, "+ |
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.
Is there a reason why you are using awserr.New and not errors.New ?
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 handles setting terminal codes correctly. Terminal codes are set using awsErr.Code()
| return input | ||
| } | ||
|
|
||
| // cacheNodeTypeRequiresUpdate retrieves the last requested cacheNodeType saved in annotations and compares them |
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 i understand well there will always be only on cacheNodeType saved in the AnnotationLastRequestedCNT and not multiple ones?
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 is correct
b4f4cd4 to
69c1925
Compare
|
/retest |
| // Keep the value of desired for CacheNodeType. | ||
| ko.Spec.CacheNodeType = r.ko.Spec.CacheNodeType |
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 this be moved to customSetOutput instead?
| desiredNodeGroupConfig := desired.ko.Spec.NodeGroupConfiguration | ||
| if val, ok := annotations[AnnotationLastRequestedNGC]; ok && val != "null" { | ||
| _ = json.Unmarshal([]byte(val), &desiredNodeGroupConfig) | ||
| return !reflect.DeepEqual(desiredNodeGroupConfig, val) |
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.
Could delta APIs be used here instead of reflect?
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.
We use the reflect in delta.go
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kumargauravsharma, nmvk The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Handle scaling in/out, Scaling up/down rollback fixes.
7b1a50b to
d065d72
Compare
Delta was not getting generated for the NodeGroupConfiguration this resulted in Test failure.
|
/retest |
3 similar comments
|
/retest |
|
/retest |
|
/retest |
With many tests, timeout needs to be increased to avoid random failures.
|
e2e tests have passed. merging the changes. |
Declarative tests for ScaleUpAndDown and fixes for Async rollback.
Upon Async rollback we would set the terminal condition to notify the user about the rollback. This would allow user to take the necessary action.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.