Skip to content

feat: add total duration section #3898

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

Merged
merged 6 commits into from
Jul 9, 2025
Merged

feat: add total duration section #3898

merged 6 commits into from
Jul 9, 2025

Conversation

joseph-sentry
Copy link
Contributor

@joseph-sentry joseph-sentry commented Jun 18, 2025

We're adding a time spent column to display the total time spent on each test for the selected time period. The goal is to give more granular information about the total impact of each test.

image

@codecov-staging
Copy link

codecov-staging bot commented Jun 18, 2025

Bundle Report

Changes will increase total bundle size by 1.71kB (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-staging-system 6.23MB 742 bytes (0.01%) ⬆️
gazebo-staging-esm 6.31MB 971 bytes (0.02%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: gazebo-staging-system

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-legacy.*.js 742 bytes 45.35kB 1.66%

Files in assets/index-legacy.*.js:

  • ./src/pages/RepoPage/FailedTestsTab/FailedTestsPage/hooks/useInfiniteTestResults/useInfiniteTestResults.tsx → Total Size: 6.61kB

  • ./src/pages/RepoPage/FailedTestsTab/FailedTestsPage/FailedTestsTable/FailedTestsTable.tsx → Total Size: 12.88kB

view changes for bundle: gazebo-staging-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index.*.js 971 bytes 49.16kB 2.02%

Files in assets/index.*.js:

  • ./src/pages/RepoPage/FailedTestsTab/FailedTestsPage/hooks/useInfiniteTestResults/useInfiniteTestResults.tsx → Total Size: 6.61kB

  • ./src/pages/RepoPage/FailedTestsTab/FailedTestsPage/FailedTestsTable/FailedTestsTable.tsx → Total Size: 12.88kB

Copy link

codecov bot commented Jun 18, 2025

Bundle Report

Changes will increase total bundle size by 1.71kB (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-system 6.23MB 742 bytes (0.01%) ⬆️
gazebo-production-esm 6.31MB 971 bytes (0.02%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: gazebo-production-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index.*.js 971 bytes 49.16kB 2.02%

Files in assets/index.*.js:

  • ./src/pages/RepoPage/FailedTestsTab/FailedTestsPage/FailedTestsTable/FailedTestsTable.tsx → Total Size: 12.88kB

  • ./src/pages/RepoPage/FailedTestsTab/FailedTestsPage/hooks/useInfiniteTestResults/useInfiniteTestResults.tsx → Total Size: 6.61kB

view changes for bundle: gazebo-production-system

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-legacy.*.js 742 bytes 45.35kB 1.66%

Files in assets/index-legacy.*.js:

  • ./src/pages/RepoPage/FailedTestsTab/FailedTestsPage/hooks/useInfiniteTestResults/useInfiniteTestResults.tsx → Total Size: 6.61kB

  • ./src/pages/RepoPage/FailedTestsTab/FailedTestsPage/FailedTestsTable/FailedTestsTable.tsx → Total Size: 12.88kB

@codecov-qa
Copy link

codecov-qa bot commented Jun 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.64%. Comparing base (83a5492) to head (122d4e9).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main    #3898   +/-   ##
=======================================
  Coverage   98.64%   98.64%           
=======================================
  Files         828      828           
  Lines       15065    15083   +18     
  Branches     4310     4311    +1     
=======================================
+ Hits        14861    14879   +18     
  Misses        196      196           
  Partials        8        8           
Files with missing lines Coverage Δ
...ledTestsPage/FailedTestsTable/FailedTestsTable.tsx 97.45% <100.00%> (+0.45%) ⬆️
.../useInfiniteTestResults/useInfiniteTestResults.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.18% <100.00%> (+<0.01%) ⬆️
Services 99.32% <ø> (ø)
Shared 99.12% <ø> (ø)
UI 99.01% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83a5492...122d4e9. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codecov-notifications
Copy link

codecov-notifications bot commented Jun 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main    #3898   +/-   ##
=======================================
  Coverage   98.64%   98.64%           
=======================================
  Files         828      828           
  Lines       15065    15083   +18     
  Branches     4302     4311    +9     
=======================================
+ Hits        14861    14879   +18     
  Misses        196      196           
  Partials        8        8           
Files with missing lines Coverage Δ
...ledTestsPage/FailedTestsTable/FailedTestsTable.tsx 97.45% <100.00%> (+0.45%) ⬆️
.../useInfiniteTestResults/useInfiniteTestResults.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.18% <100.00%> (+<0.01%) ⬆️
Services 99.32% <ø> (ø)
Shared 99.12% <ø> (ø)
UI 99.01% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83a5492...122d4e9. Read the comment docs.

Copy link

codecov bot commented Jun 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.64%. Comparing base (83a5492) to head (122d4e9).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3898   +/-   ##
=======================================
  Coverage   98.64%   98.64%           
=======================================
  Files         828      828           
  Lines       15065    15083   +18     
  Branches     4302     4319   +17     
=======================================
+ Hits        14861    14879   +18     
  Misses        196      196           
  Partials        8        8           
Files with missing lines Coverage Δ
...ledTestsPage/FailedTestsTable/FailedTestsTable.tsx 97.45% <100.00%> (+0.45%) ⬆️
.../useInfiniteTestResults/useInfiniteTestResults.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.18% <100.00%> (+<0.01%) ⬆️
Services 99.32% <ø> (ø)
Shared 99.12% <ø> (ø)
UI 99.01% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83a5492...122d4e9. Read the comment docs.

Copy link

codecov-public-qa bot commented Jun 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.64%. Comparing base (83a5492) to head (122d4e9).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main    #3898   +/-   ##
=======================================
  Coverage   98.64%   98.64%           
=======================================
  Files         828      828           
  Lines       15065    15083   +18     
  Branches     4310     4319    +9     
=======================================
+ Hits        14861    14879   +18     
  Misses        196      196           
  Partials        8        8           
Files with missing lines Coverage Δ
...ledTestsPage/FailedTestsTable/FailedTestsTable.tsx 97.45% <100.00%> (+0.45%) ⬆️
.../useInfiniteTestResults/useInfiniteTestResults.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.18% <100.00%> (+<0.01%) ⬆️
Services 99.32% <ø> (ø)
Shared 99.12% <ø> (ø)
UI 99.01% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83a5492...122d4e9. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Jun 18, 2025

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
3b18039 Wed, 18 Jun 2025 19:56:59 GMT Expired Expired
2a35eea Thu, 26 Jun 2025 20:10:01 GMT Expired Expired
d325b29 Fri, 04 Jul 2025 17:45:51 GMT Expired Expired
c4bf955 Tue, 08 Jul 2025 21:28:07 GMT Expired Expired
122d4e9 Wed, 09 Jul 2025 16:15:23 GMT Cloud Enterprise

Copy link
Contributor

✅ Sentry found no issues in your recent changes ✅

}
slowestTestsDuration={aggregates?.slowestTestsDuration}
<div
className={cn(
Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for using cn

spalmurray
spalmurray previously approved these changes Jun 20, 2025
Copy link
Contributor

@spalmurray spalmurray left a comment

Choose a reason for hiding this comment

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

lgtm. You're basically a frontend dev

@joseph-sentry joseph-sentry changed the title feat: add total duration section, remove slowest tests headers feat: add total duration section Jun 26, 2025
@joseph-sentry joseph-sentry force-pushed the joseph/total-duration branch from 3b18039 to 2a35eea Compare June 26, 2025 20:05
@ajay-sentry
Copy link
Contributor

@joseph-sentry The without flake aggregates screenshot still has the flake rate column on there ;P

Also any chance we can center those fields when theres only 3? Looks kinda odd shifted like that

ajay-sentry
ajay-sentry previously approved these changes Jun 27, 2025
Copy link
Contributor

@ajay-sentry ajay-sentry left a comment

Choose a reason for hiding this comment

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

changes proposed in the PR look good, had another comment tho

@spalmurray
Copy link
Contributor

I just noticed all the wasted space at the right of the table. Can we right-justify everything but the test name column?

@joseph-sentry
Copy link
Contributor Author

I'm going to end up leaving the slowest tests header in and not make any changes to the header section and just add the time spent column in this change

@joseph-sentry joseph-sentry dismissed stale reviews from ajay-sentry and spalmurray July 8, 2025 21:02

rewrote a bunch of the PR

@joseph-sentry joseph-sentry requested a review from ajay-sentry July 8, 2025 21:02
I noticed that any time I would refresh the page or change the ordering of the
table, which would cause useInfiniteTestResults to run, the flake rate column
would disappear for just a second until we got the response back and then the
flake rate column would come back. This fixes this by preventing the value used
in rendering from being updated until the request is done, preventing the
flickering i saw.
@joseph-sentry joseph-sentry force-pushed the joseph/total-duration branch from d325b29 to c4bf955 Compare July 8, 2025 21:23
const isDefaultBranch = testData?.defaultBranch === branch
const isTeamOrFreePlan = testData?.isTeamPlan || testData?.isFreePlan
// Only show flake rate column when on default branch for pro / enterprise plans or public repos
const [isDefaultBranch, setIsDefaultBranch] = useState(false)
Copy link
Contributor

Choose a reason for hiding this comment

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

what's up with all this stuff? Maybe we can do a use memo instead if we want to keep the state cached. Something like:

const isTeamOrFreePlan = useMemo(() => {
  if (testData?.isTeamPlan !== null && testData?.isFreePlan !== null) {
    return testData.isTeamPlan || testData.isFreePlan
  }
  return true // hide flake stuff by default maybe?
}, [testData?.isTeamPlan, testData?.isFreePlan])

etc. etc.

'flex-row-reverse': !['name', 'updatedAt'].includes(
header.id
),
'flex-row-reverse': header.id !== 'name',
Copy link
Contributor

Choose a reason for hiding this comment

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

we still want this change?

@joseph-sentry joseph-sentry enabled auto-merge July 9, 2025 15:08
@joseph-sentry joseph-sentry added this pull request to the merge queue Jul 9, 2025
Merged via the queue into main with commit b5308dd Jul 9, 2025
64 checks passed
@joseph-sentry joseph-sentry deleted the joseph/total-duration branch July 9, 2025 16:27
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