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: IATR relevant run status banner #25282

Merged
merged 12 commits into from
Dec 30, 2022

Conversation

mike-plummer
Copy link
Contributor

@mike-plummer mike-plummer commented Dec 27, 2022

Closes #24853

User facing changelog

No changelog entry, merging to feature branch

  • Adds banner for newer relevant run when viewing IATR data on an outdated run
  • Adds "pending" splash content when first IATR run is still in progress

Additional details

Splash Content
When no previous run exists and current run is "running" then provide a splash page with icon and progress (x of y complete)

Relevant Run banner
Shows new indigo banner below header when a newer run is detected in running or completed status

  • When running, provides progress (x of y completed)
  • When complete (passed or failed) provides an actionable link to view the newer run results

Items of Note

  1. Provision of "newer relevant run" is currently stubbed
    Stokes is working on the polling logic for this, so I've stubbed out the "newer" run with the current run. This causes some illogical UI states in the screenshots (same run number shows in both current and new run sections)
  2. Navigation to "newer relevant run" is currently stubbed
    Stokes is working on the store logic to handle what run to view, stubbed pending that logic being available to integrate
  3. PR is open to add new "running" icon for splash content. Until that is available I've used the "complete" version of the icon Updated

Steps to test

Data is currently stubbed, best approach to test is to review new tests & percy snapshots

How has the user experience changed?

First run pending
Screen Shot 2022-12-27 at 3 22 29 PM

Newer relevant run found
Newer run is in progress
Screen Shot 2022-12-27 at 3 22 59 PM

Newer run is complete
Screen Shot 2022-12-27 at 3 23 16 PM

PR Tasks

  • Have tests been added/updated?
  • 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?

* Add new splash content for first run pending
* Add new build status bar for newer relevant run
* Refactor common components for reuse
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 27, 2022

Thanks for taking the time to open a PR!

@mike-plummer mike-plummer marked this pull request as ready for review December 28, 2022 14:06
@cypress
Copy link

cypress bot commented Dec 28, 2022



Test summary

534 0 6 0Flakiness 7


Run details

Project cypress
Status Passed
Commit 4c67767
Started Dec 30, 2022 4:51 PM
Ended Dec 30, 2022 5:09 PM
Duration 17:50 💡
OS Linux Debian -
Browser Chrome 106

View run in Cypress Dashboard ➡️


Flakiness

cypress-in-cypress-run-mode.cy.ts Flakiness
1 Cypress In Cypress - run mode > e2e run mode spec runner header is correct
2 Cypress In Cypress - run mode > component testing run mode spec runner header is correct
3 Cypress In Cypress - run mode > hides reporter when NO_COMMAND_LOG is set in run mode
create-from-component.cy.ts Flakiness
1 ... > runs generated spec
specs_list_latest_runs.cy.ts Flakiness
1 App/Cloud Integration - Latest runs and Average duration > when no runs are recorded > shows placeholders for all visible specs
This comment includes only the first 5 flaky tests. See all 7 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

// TODO GH#24440 Re-map to use relevant run data point (currently stubbed with current run)
const newerRelevantRun = computed(() => run.value)

const isFirstPendingRun = computed(() => run.value && run.value.runNumber === 1 && run.value.status === 'RUNNING')
Copy link
Contributor Author

@mike-plummer mike-plummer Dec 28, 2022

Choose a reason for hiding this comment

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

Didn't think this through all the way (run numbers increment across all branches, so this will only work for the very first run on any branch for a given project). I think instead I'll need to grab the count of relevant runs from GQL and see if there's only one relevant run that happens to be pending - that'll build off what Stokes is building now in this branch

Copy link
Contributor

Choose a reason for hiding this comment

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

I am working to encapsulate the logic in the server side to determine a current run (what the main part of the Debug page would show) and newer run (that could be RUNNING or a completed status). Then the logic here for isFirstPendingRun would just be currentRun.status === 'RUNNING' or something like that. And the newer run would drive the newerRelevantRun variable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@warrensplayer Sounds good, thanks for the context. Will leave this stubbed for now to ensure visibility & test coverage. If your backend additions merge first I'm happy to hook up as part of this PR, otherwise will plan to handle the hookup as follow-on changes

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 - I left some minor comments

packages/app/src/debug/DebugContainer.cy.tsx Show resolved Hide resolved
packages/app/src/debug/DebugNewRelevantRunBar.vue Outdated Show resolved Hide resolved
>
<div class="flex flex-col w-full items-center">
<IconTechnologyDashboardRunning class="mb-16px" />
<span
Copy link
Contributor

Choose a reason for hiding this comment

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

Nothing to change here I don't think, but I'm wondering what people's thoughts are on using test IDs for things like this. I usually try to stay away from using data-cy if I can, since users don't see test IDs on screen.

Is there a reason why we can't just grab the title here with cy.contains or something like that, since that's what the user would actually see on the page? I understand this makes things a little more brittle (for instance if we decide to update the text then the test will fail). Just asking because I'm trying to refine my own testing strategy.

packages/app/src/debug/DebugNewRelevantRunBar.vue Outdated Show resolved Hide resolved
* Convert "View run" link to use button
* Add more top spacing
* Fix bg color
@astone123 astone123 self-requested a review December 29, 2022 17:47
@marktnoonan
Copy link
Contributor

Haven't looked at the code yet. Some of the Percy snapshots look a little unexpected to me, but it's unclear if those are related to this PR or the feature branch, since Percy is diffing against develop. I'll look into getting a proper baseline from the actual target branch so that Percy can figure out how to show the impact of this PR on the feature branch, not just develop.

@astone123
Copy link
Contributor

@marktnoonan @warrensplayer and I we're looking into this for a little bit... I wasn't able to figure out why Percy still compares to the last build on develop even if the PR is targeting a different branch that also has a Percy build. So every Percy run on these IATR PR branches has included every single change from the feature branch as well as the ones from the PR branch

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 refactor to use smaller components is great! The only major thing to address is the source of the data for the counts. The fields you reference in the GQL queries represent "test" counts. For the DebugPendingRunCounts, it should be counts of "specs" instead. The GQL fields from the Cloud do not currently provide the summary counts, so you have to group the values yourself. Comments in the code give a bit more detail.

packages/app/src/debug/DebugNewRelevantRunBar.vue Outdated Show resolved Hide resolved
packages/app/src/debug/DebugPendingRunCounts.vue Outdated Show resolved Hide resolved
// TODO GH#24440 Re-map to use relevant run data point (currently stubbed with current run)
const newerRelevantRun = computed(() => run.value)

const isFirstPendingRun = computed(() => run.value && run.value.runNumber === 1 && run.value.status === 'RUNNING')
Copy link
Contributor

Choose a reason for hiding this comment

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

I am working to encapsulate the logic in the server side to determine a current run (what the main part of the Debug page would show) and newer run (that could be RUNNING or a completed status). Then the logic here for isFirstPendingRun would just be currentRun.status === 'RUNNING' or something like that. And the newer run would drive the newerRelevantRun variable

* Fix spec vs test total usages
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.

Looks good. We can just keep the mocked out parts for now. I will file a new ticket to resolve those after my merge. Just going to see if we can get Percy straightened out first before merging

@mike-plummer mike-plummer merged commit 031dd8b into feature/IATR-M0 Dec 30, 2022
@mike-plummer mike-plummer deleted the mikep/24853-iatr-relevant-run-banner branch December 30, 2022 17:09
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.

None yet

4 participants