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

feat: run failures enhancements #25234

Merged
merged 8 commits into from
Dec 22, 2022
Merged

Conversation

ZachJW34
Copy link
Contributor

User facing changelog

na

Additional details

Working with Ankit revealed we needed to change up DebugMappings.ts. We paired on this and the results of the refactor are relevant for his upcoming work (groups).

Steps to test

Driven mostly from CT tests, if you want to run it e2e:

  1. Check out the feature/CYCLOUD-665-IATR and run yarn
  2. Run yarn docker-compose && yarn dev
  3. Visit localhost:3000 and create a project
  4. In the Cypress monorepo, checkout this branch and run CYPRESS_INTERNAL_ENV=development yarn cypress:open
  5. Select a project and add your newly created projectId
  6. Tweak tests to cause a failure and run npx cypress run --record --key <RECORD_KEY>
  7. If you've recorded different runs, you can change the run by changing runByNumber(runNumber: 6) { to whatever run you want to target (not dynamic yet)

How has the user experience changed?

Screen.Recording.2022-12-20.at.11.31.21.AM.mov

PR Tasks

  • Have tests been added/updated?
  • [na] Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [na] Has a PR for user-facing changes been opened in cypress-documentation?
  • [na] Have API changes been updated in the type definitions?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 20, 2022

Thanks for taking the time to open a PR!

const variantClasses = computed(() => (VariantClassesTable[props.variant || 'primary']))
const variantClasses = computed(() => {
return (VariantClassesTable[props.variant || 'primary']).split(' ').filter((css) => {
return css !== 'hocus-default' || !props.disabled
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A button should not have hover states if it is disabled.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see how this solves the issue for the button type being used in this issue, but it is not really clear here what it is doing or why. Your comment here in the PR was helpful.

Can you at least separate out the additional functionality and not chain it off the original part so that you can add a good comment to explain why this is being performed?

@@ -71,6 +71,17 @@ const actualPopperClass = computed(() => {
result.push('no-arrow')
}

// color takes priority, else fallback to tooltip -> dark, menu -> light
Copy link
Contributor Author

@ZachJW34 ZachJW34 Dec 20, 2022

Choose a reason for hiding this comment

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

Refactored so as to allow menu functionality styled with the dark tooltip theme (tooltips don't stay open when the mouse leaves the designated hover element, but the tooltip added in this PR has a call to action).

@cypress
Copy link

cypress bot commented Dec 20, 2022



Test summary

26243 1 1378 0Flakiness 24


Run details

Project cypress
Status Failed
Commit 3e21acc
Started Dec 22, 2022 3:10 PM
Ended Dec 22, 2022 3:28 PM
Duration 17:58 💡
OS Linux Debian -
Browser Multiple

View run in Cypress Dashboard ➡️


Failures

cypress/e2e/e2e/origin/commands/waiting.cy.ts Failed
1 cy.origin waiting > alias > waits for the route alias to have a response

Flakiness

create-from-component.cy.ts Flakiness
1 ... > runs generated spec
commands/net_stubbing.cy.ts Flakiness
1 ... > with `resourceType` > can match a proxied image request by resourceType
2 network stubbing > intercepting response > can delay a proxy response using res.setDelay
3 network stubbing > intercepting response > can throttle a proxy response using res.setThrottle
4 ... > stops waiting when an xhr request is canceled
This comment includes only the first 5 flaky tests. See all 24 flaky tests in the Cypress Dashboard.

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

Copy link
Contributor

@warrensplayer warrensplayer left a comment

Choose a reason for hiding this comment

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

Overall is great! I love the addition of the types in the DebugMapping.ts file. Makes things much easier to understand. Mostly nit-pick stuff in my comments.

const variantClasses = computed(() => (VariantClassesTable[props.variant || 'primary']))
const variantClasses = computed(() => {
return (VariantClassesTable[props.variant || 'primary']).split(' ').filter((css) => {
return css !== 'hocus-default' || !props.disabled
Copy link
Contributor

Choose a reason for hiding this comment

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

I see how this solves the issue for the button type being used in this issue, but it is not really clear here what it is doing or why. Your comment here in the PR was helpful.

Can you at least separate out the additional functionality and not chain it off the original part so that you can add a good comment to explain why this is being performed?

packages/app/src/debug/DebugContainer.vue Outdated Show resolved Hide resolved
packages/app/src/debug/utils/DebugMapping.ts Outdated Show resolved Hide resolved
packages/frontend-shared/src/components/Button.vue Outdated Show resolved Hide resolved
@@ -46,7 +46,7 @@ const props = withDefaults(defineProps<{
instantMove?: boolean
showGroup?: string
}>(), {
color: 'dark',
color: undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

What did the component do with the color prop originally. It does not look like it was used. I am guessing it just got passed on to the Menu or Tooltip components from floating-vue. I looked at the documentation for that library but could not find any documentation for it. Did you look?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Couldn't find any docs for it and it wasn't being referenced so I hijacked it!

@astone123
Copy link
Contributor

Is the tooltip supposed to look like this? Looks like the body needs to get moved up a couple of pixels
Screen Shot 2022-12-21 at 4 18 48 PM

const foundSpec = specs.find((spec) => spec.id === curr.specId)

spec = { spec: foundSpec }
// console.log('looking for spec', spec)
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed this in a previous commit, maybe the PR was stale when you were reviewing?

cy.mount(() => {
return (
<div class="flex m-100px p-4 w-150px gap-160px">
{/* @ts-ignore */}
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this ts-ignore for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No idea it was a copy and paste. Let me see if I can remove it without check-ts being pissed.

Copy link
Contributor

@astone123 astone123 left a comment

Choose a reason for hiding this comment

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

Looks good for the most part - just had a couple of comments. I also left a comment on one of the Percy snapshots that changed. It looks like that might actually be related to a change that was made here. We should check that out just to make sure 👍🏻

Copy link
Contributor

@warrensplayer warrensplayer left a comment

Choose a reason for hiding this comment

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

The code looks good. The only thing I saw that was strange in the UI was the little arrow on the tooltip. It is a little bit too high above the body of the tooltip. If you zoom in, you can see the bottom arrows of the triangle.
image

@ZachJW34
Copy link
Contributor Author

@astone123 I reverted the changes I made to the Button component but the test/snapshot didn't change. Not sure why, I'll check this out on the feature branch.


const debugMappingArray = specsList(spec, tests)
const debugMappingArray = specsList({ specs, tests, groups, localSpecs: [], currentTestingType: 'e2e' })
Copy link
Contributor

@lmiller1990 lmiller1990 Dec 22, 2022

Choose a reason for hiding this comment

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

Now we are on Vite 4 you should have an easier time adding vitest to the code base. Not needed for this PR to merge, but I'd like to start using Vitest more for non UI tests - as much as I like dogfooding Cypress, it really doesn't feel like the right tool for this class of test.

I know we are on the same page about this, just noting it here since we couldn't add Vitest before, but now we should be able to. Feel free to add next time you see a chance! It's fast ⚡

@ZachJW34
Copy link
Contributor Author

@astone123 looks like that button was relying on css class ordering which is not the proper way to apply overrides (there isn't an ideal way to apply overrides but bg-gray-500 bg-indigo-500 shouldn't be what we rely on). I've reverted the color change by applying a custom class, though I feel like the disabled primary looked better 😅

@ZachJW34 ZachJW34 merged commit 216d4c5 into feature/IATR-M0 Dec 22, 2022
@ZachJW34 ZachJW34 deleted the zachw/run-failures-enh branch December 22, 2022 15:56
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.

4 participants