-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add validations for the UpdateResultsAPI objects #1057
Add validations for the UpdateResultsAPI objects #1057
Conversation
Signed-off-by: Saad Khan <[email protected]>
Signed-off-by: Saad Khan <[email protected]>
Signed-off-by: Saad Khan <[email protected]>
Signed-off-by: Saad Khan <[email protected]>
@@ -180,9 +180,11 @@ def test_update_results_with_missing_metrics_section(test_name, result_json_file | |||
for err in error_data: | |||
actual_error_message = err["message"] | |||
if test_name == "Missing_metrics_bulk_res_few_containers" and d["interval_end_time"] == "2023-04-13T23:29:20.982Z": | |||
error_message = "kubernetes_objects : Metric data is not present for container : tfb-server-1 for experiment: quarkus-resteasy-kruize-min-http-response-time-db. Metric data is not present for container : tfb-server-0 for experiment: quarkus-resteasy-kruize-min-http-response-time-db" | |||
error_message = "Performance profile: [Metric data is not present for container : tfb-server-1 for experiment: quarkus-resteasy-kruize-min-http-response-time-db. ] , " \ | |||
"Performance profile: [Metric data is not present for container : tfb-server-1 for experiment: quarkus-resteasy-kruize-min-http-response-time-db. , " \ |
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.
Why is tfb-server-0 changed to tfb-server-1 here?
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.
Reverted now. It wasn't required.
@@ -189,8 +189,6 @@ def generate_test_data(csvfile, test_data): | |||
|
|||
test_name = t + "_" + key | |||
status_code = 400 |
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 need to include the below code back and pass createExperiment or updateResults as a parameter to generate_test_data and include the below code for createExp
if test_name == "invalid_experiment_name" or test_name == "invalid_cluster_name":
status_code = 201
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.
Also include validation for the expected failure messages
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 need to include the below code back and pass createExperiment or updateResults as a parameter to generate_test_data and include the below code for createExp
if test_name == "invalid_experiment_name" or test_name == "invalid_cluster_name": status_code = 201
This is done. Validation for the failure messages will be taken up in a different PR.
Signed-off-by: Saad Khan <[email protected]>
@khansaad Please mention list of validations and errors on MD file |
@khansaad - Have you updated the API doc with the error messages? |
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
@msvinaykumar can you please fix the conflicts here |
ok |
3c09804
to
83a00ec
Compare
ContainerData kruizeContainer = kruizeContainers.get(i); | ||
ContainerData resultContainer = resultContainers.get(i); | ||
if (!kruizeContainer.getContainer_name().equals(resultContainer.getContainer_name()) | ||
|| !kruizeContainer.getContainer_image_name().equals(resultContainer.getContainer_image_name())) { |
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'd suggest that we skip the image name check for now. If the container image name has changed owing to a application upgrade, our code needs to keep track of that. We cannot penalize the updateResults API for that.
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.
Done!
Signed-off-by: Saad Khan <[email protected]>
b06fdb8
to
258b0bf
Compare
Signed-off-by: Saad Khan <[email protected]>
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
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
This PR fixes the validation cases which were left as part of #561