-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(frontend): Support showing Omitted node phase with new Argo version #5339
Conversation
Awesome! Thank you for the quick fix! |
Besides that, I feel the icon might be ambiguous. The steps are omitted, but not failed, the icon makes it look like they failed. What do you think about https://material.io/resources/icons/?icon=do_not_disturb_on&style=baseline? I don't have a good idea of which icon might be a better fit. You can find other icons too. |
That makes sense, thank you for the suggestion! I changed the icon based on research on material io page. Here is what I land on, and the reason is that this icon gives the impression that this step hasn't been executed. For reference: Argo workflow didn't differentiate this new state from init state on their icon list: https://github.com/argoproj/argo-workflows/blob/9319c074e742c5d9cb97d6c5bbbf076afe886f76/ui/src/app/shared/utils.ts#L6-L26. If they do, I am leaning towards using something similar. Since they don't have an icon, we can pick one we think makes most sense. |
Thank you! The only blocking issue is that the generated snapshot is too large and unreadable. I think you should mock all the icon components. Do you know how to do that with jest? There are some examples in the repo. EDIT: here's the best example:
|
Thank you so much Yuan! That is a very useful reference. I have done some research on the usage and our test cases, I found that the most verbose part of this element is in Furthermore, I want to validate the hover text for each status is accurate as well. However, there is a blocking issue on jest which I cannot add test for, until we upgrade jest to Since it will fail a lot of tests after upgrading react-scripts, I put this on hold for now. Putting the test I want to add here.
I have validated this is working after locally using react-scripts |
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
/approve
|
||
it('handles PENDING phase', () => { | ||
const tree = shallow(statusToIcon(NodePhase.PENDING)); | ||
expect(tree.find('span')).toMatchInlineSnapshot(` |
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 an unstable finder, if any other span
element shows up, it'll break.
I'd suggest this blogpost https://kentcdodds.com/blog/making-your-ui-tests-resilient-to-change.
There are some general advice for choosing a selector, it should be
- reflect how users find elements
- if not feasible, add a unique data-testid
This is not a blocker for this PR, your improvements have been pretty good!
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.
Thank you for the suggestion! I agree with the testing approach which is based on user visible element. The current implementation is temporary, and we should use the react testing library (commented test) after version upgrade, so we can abandon this test.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Bobgy 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 |
Description of your changes:
Issue #5322
With PR #5266 we have upgraded to use the new Argo version. However, there is a new NodePhase with OMITTED in a finished pipeline. We shouldn't show a tail for Omitted node, and should provide an Icon to show the Omitted state. See screenshot:
Checklist:
Do you want this pull request (PR) cherry-picked into the current release branch?
Learn more about cherry-picking updates into the release branch.