Skip to content
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 Unit Tests on s390x. #10882

Merged
merged 1 commit into from
Nov 26, 2024
Merged

Fix Unit Tests on s390x. #10882

merged 1 commit into from
Nov 26, 2024

Conversation

dandotimujahid
Copy link
Contributor

@dandotimujahid dandotimujahid commented Nov 26, 2024

Type of change

Select the type of your PR

  • Bugfix

Description

The primary change ensures that tests pass regardless of platform-specific variations in error messages by using the anyof() function.
For instance, in the testKafkaWithInvalidRole test:
On Intel, exception.getMessage() returns:
invalid: spec.maintenanceTimeWindows[0]: Invalid value: "null": spec.maintenanceTimeWindows[0] in body must be of type string:
On s390x, it returns:
invalid: spec.maintenanceTimeWindows: Invalid value: "null": spec.maintenanceTimeWindows in body must be of type string:
Similar discrepancies exist in other tests. Instead of using conditional logic like
if-else, the anyof() approach is aligned with the previously used community standards to handle such known K8s errors across different platforms.

Checklist

Please go through this checklist and make sure all applicable tasks have been done

  • Write tests
  • Make sure all tests pass
  • Update documentation
  • Check RBAC rights for Kubernetes / OpenShift roles
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally
  • Reference relevant issue(s) and close them after merging
  • Update CHANGELOG.md
  • Supply screenshots for visual changes, such as Grafana dashboards

Signed-off-by: Mujahid-Dandoti <[email protected]>
@scholzj scholzj added this to the 0.45.0 milestone Nov 26, 2024
Copy link
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can improve the description and explain a bit more in detaild why are the tests failing on some platforms?

@scholzj scholzj requested a review from ppatierno November 26, 2024 19:44
@scholzj scholzj merged commit 5a2dbf8 into strimzi:main Nov 26, 2024
10 checks passed
@dandotimujahid
Copy link
Contributor Author

@scholzj Thanks for approving the PR. I will update the description.

OwenCorrigan76 pushed a commit to OwenCorrigan76/strimzi-kafka-operator that referenced this pull request Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants