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] to distinguish between PVC in pending and PVC in bound status #1070

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

jstourac
Copy link
Member

@jstourac jstourac commented Dec 9, 2023

The storage size is shown in the UI depending of the PVC status. Before the PVC is bounded, there is shown 'Max XXGi' (or other unit). After the PVC has been bound (even after it has been de-attached from a workbench)
then there is something like: 'XXGi [## ] YYGi' - so there is shown
both the capacity that is taken and total capacity of the storage; in
the middle of them, there is a graphical element to show how much the
capacity is used.


CI: rhods-ci-pr-test/2198 - pass of this test should be enough since this method is used only in one other test and that one is tagged with AutomationBug so it's irrelevant for now anyway.

Copy link
Contributor

github-actions bot commented Dec 9, 2023

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass %
388 0 0 388 100

@jstourac jstourac force-pushed the fixPvcCheck branch 2 times, most recently from 1dc62e3 to 26b3534 Compare December 9, 2023 22:43
@jstourac jstourac marked this pull request as ready for review December 9, 2023 23:18
@jstourac jstourac self-assigned this Dec 10, 2023
@jstourac jstourac added needs testing Needs to be tested in Jenkins enhancements Bugfixes, enhancements, refactoring, ... in tests or libraries (PR will be listed in release-notes) labels Dec 10, 2023
${rc} ${pvc_status_phase}= Run And Return Rc And Output
... oc get pvc -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${name}")].status.phase}' # robocop: disable
Should Be Equal As Integers ${rc} 0 An error occurred during the check of PVC ${name} .status.phase value!
IF "${pvc_status_phase}" == "Pending"

Check notice

Code scanning / Robocop

Variable '{{ name }}' in '{{ block_name }}' condition has unnecessary string conversion Note test

Variable '${pvc_status_phase}' in 'IF' condition has unnecessary string conversion
@jstourac jstourac added verified This PR has been tested with Jenkins and removed needs testing Needs to be tested in Jenkins labels Dec 10, 2023
lugi0
lugi0 previously approved these changes Dec 11, 2023
Copy link
Contributor

@lugi0 lugi0 left a comment

Choose a reason for hiding this comment

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

In general it looks ok to me, but I'd like to understand a bit more what the last check on the PVC does after the if/else block. Perhaps add a line or two of comments to explain the flow?

@jstourac jstourac added needs testing Needs to be tested in Jenkins and removed verified This PR has been tested with Jenkins labels Dec 11, 2023
@jstourac jstourac marked this pull request as draft December 11, 2023 10:26
Wait Until Page Contains Element ${storage_size_el} timeout=20s
${displayed_size}= Get Text ${storage_size_el}
Run Keyword And Continue On Failure Should Be Equal As Strings ${displayed_size} Max ${size}Gi
ELSE IF "${pvc_status_phase}" == "Bound"

Check notice

Code scanning / Robocop

Variable '{{ name }}' in '{{ block_name }}' condition has unnecessary string conversion Note test

Variable '${pvc_status_phase}' in 'ELSE IF' condition has unnecessary string conversion
@jstourac
Copy link
Member Author

@lugi0 Updated addressing both your comments. Will re-run CI now. Please let me know whether it looks good now 🙂

@jstourac jstourac removed the needs testing Needs to be tested in Jenkins label Dec 11, 2023
@jstourac jstourac added the verified This PR has been tested with Jenkins label Dec 11, 2023
@jstourac jstourac marked this pull request as ready for review December 11, 2023 12:47
@jstourac jstourac requested a review from lugi0 December 11, 2023 12:47
lugi0
lugi0 previously approved these changes Dec 11, 2023
Copy link
Contributor

@lugi0 lugi0 left a comment

Choose a reason for hiding this comment

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

thanks @jstourac , LGTM

The storage size is shown in the UI depending of the PVC status. Before
the PVC is bounded, there is shown 'Max XXGi' (or other unit). After the
PVC has been bound (even after it has been de-attached from a workbench)
then there is something like: 'XXGi [##     ] YYGi' - so there is shown
both the capacity that is taken and total capacity of the storage; in
the middle of them, there is a graphical element to show how much the
capacity is used.
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@jstourac
Copy link
Member Author

I just noticed a robocop warning so I rebased and pushed this change only.

@jstourac jstourac requested a review from lugi0 December 12, 2023 08:04
@bdattoma
Copy link
Contributor

bdattoma commented Dec 12, 2023

@jstourac LGTM! thanks for raising this one.
Only one point/question for you.

In my mind, we should be able to test all the situations (pending, success, failure) explicitly. This fix is great but we are not assuming an expected behavior in the test, while IMO we should if we care of this particular UI aspect.
Of course, if we don't care about it, we can ignore it and let the kw to handle the 3 cases as done in this PR.
The risk is that we don't capture a regression or change in the UI behavior because the kw silently handles the situation.

Wdyt? (ofc anybody who has an option about this, feel free to join the discussion)

(i'm approving the PR because it would let our tests to run smoothly for now, and I'd agree that this particular aspect of the UI doesn't have the highest priority for us)

@jstourac
Copy link
Member Author

@bdattoma thank you for your review! Yeah, I agree that we should probably extend test to assume the PVC state there and extend to check also the Pending state at least. Let's do it in a separate PR though. Do you want me to add a Todo note to the test?

@bdattoma
Copy link
Contributor

Do you want me to add a Todo note to the test?

up to you, to me it would also be okay just to have in our Jira backlog

@jstourac
Copy link
Member Author

@jgarciao jgarciao merged commit 6f9bed7 into red-hat-data-services:master Dec 12, 2023
8 checks passed
@jstourac jstourac deleted the fixPvcCheck branch December 12, 2023 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancements Bugfixes, enhancements, refactoring, ... in tests or libraries (PR will be listed in release-notes) verified This PR has been tested with Jenkins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants