Skip to content

Discovery: Collecting and Displaying Failed and Flaky Tests Data in Codecov #480

Closed

Description

@codecovdesign

Problem to Solve

Developers currently lack insight into the quality and reliability of their test coverage through Codecov. While Codecov provides coverage percentages, it does not offer any information regarding test failures. This makes it challenging for developers to identify consistently failing or flaky tests, which can lead to slower development cycles and reduced code quality.

As a developer, I want to see not only my code coverage but also details about any failed tests so that I can better understand the effectiveness of my test suite and quickly identify problematic tests.

Solution Ideation

Data capture, where Codecov to collect data on failed tests.

App UI Updates: Extend the Codecov dashboard to display:

  • If coverage drops are due to certain/frequent failed tests.
  • Link to the test file or CI logs for a deeper dive.
  • Ability to filter or sort tests based on failure frequency, most recent failure, etc.
  • A trend graph showing failed tests over time.
  • additional context to help developers understand the cause of the failure (what could this be?).

In PR Comments:

  • Show if the failed tests are a common point of failure or a new occurrence.
### Tasks-Design
- [ ] https://github.com/codecov/engineering-team/issues/1018
- [ ] https://github.com/codecov/engineering-team/issues/886
- [ ] https://github.com/codecov/engineering-team/issues/1341
- [ ] https://github.com/codecov/engineering-team/issues/1116
- [ ] https://github.com/codecov/engineering-team/issues/1340
- [ ] https://github.com/codecov/engineering-team/issues/1365
- [ ] https://github.com/codecov/engineering-team/issues/1366
- [ ] https://github.com/codecov/engineering-team/issues/1640
### Tasks-Platform
- [ ] https://github.com/codecov/engineering-team/issues/1116
### Tasks-Application

Activity

  1. added
    in discovery
    on Sep 16, 2023
  2. codecovdesign commented on Sep 18, 2023

    @codecovdesign
    ContributorAuthor

    Exploration 1

    view designs Exploration

    Exploration 2, post feedback

    view designs Exploration
  3. codecovdesign commented on Sep 18, 2023

    @codecovdesign
    ContributorAuthor

    Sept 18th - Feedback notes:

    • Eli: there are scenario where you'll have an uploaded test results file. what does this UI/PR comment look like when we don't have coverage data?
      - scenario: there are two commits 0 and 1, but 1 had a failed upload. What would show in the latest commit in the repo page.
      - suggestion: show a warning that suggests to look at the test results and/or that the coverage is not accurate/reflective.
    • If you start displaying ingested test results: Codecov enters the quality space given the other data points we have. Consider, later we show lint results. Fundamental question: what do these pages look like when we don't have coverage data, but the other data.
      • It's possible that a plan could have these features, but omit coverage (just as an example for long term thinking). AJ: could be a feature incentive to upgrade to a higher/pro tier.

    Design feedback notes:

    • AJ: when it's in the context under the coverage tab; it feels like it could be confusing. Could there be different visual treatment, so we make sure that developer understands (not to get confused with coverage %)
    • Eli: test labeling (like flags); could be different with frameworks often they are decoupled. Could any labeling be automated? Well, the test systems are pretty organized and the CLI could identify some of these (def v2)
      • Another: bar chart where the x-axis is commits and y- is number of test. This way the bar is split so you can see a ratio of pass fail. Could help showing a trend. Could also resurrect the sunburst, bit harder but still shows the fail.
    • Re: test fail, can we identify a way to display flakiness.
    • Is it useful to show last passing commit? the idea is it could help last time it past
    • Re: branch selection context. Aj: on the flags page, we hear a lot of feedback that they'd like to (could add option to view all = multi select?). eli: branch selection for test, could work consistent with coverage branch selection.
    • Re: info architecture, what does it look like if we showed all information together (consider all plans are together). AJ: could be a way to allow selection between / toggle to select what to see and/or show all
    • Re: again, how to deal with the display when coverage data is absent
    • Re: where to link the failed test messaging. if developer showing test failed and latest CI run (link to block), if manager would be interested in how coverage was impacted. Aj: the current UX takes them to the app and display failed test.

    Next step

    • kyle to feedback intake and updates designs.
    • engineering feedback
    • prototype updates + user testing prep
  4. codecovdesign commented on Nov 1, 2023

    @codecovdesign
    ContributorAuthor

    x related feedback: https://twitter.com/jmduke/status/1705194525197525449

    It feels like there is a really good software company waiting to be built whose tagline is "Sentry for tests". Every single stack features a test suite that is deeply opaque in a way that significantly harms development productivity, and solving that is very valuable.

    kyle notes ### Could you describe the tweet further? - Experience from Stripe with CI/tooling focus. - Emphasis on improving test suites incrementally rather than coverage. - Goal to minimize test flakiness and delays. - Transparency and seeing incremental performance gains in tests is key.

    Follow-ups: How did this work on a day and how did the metrics drive actionability?

    • Insights from data helped ICs to understand less obvious problems.
    • Metrics provided awareness but weren't always a catalyst for immediate action.

    Are there any particular tools or solutions you've used that partially address these issues? What are they missing?

    • Codecov was tried but lacked certain features.
    • Trunk.io seemed promising but its application was not clear.

    What metrics or insights would be most critical for you in a test-focused tool?

    • Test execution time is critical for optimizing runtimes.
    • A focus on detailed metrics for test flakiness.
    • Importance on measuring end-to-end wall clock and processing times.

    How would you ideally like to be alerted or notified about issues in your test suite? Summarize your dream feature for your team to resolve this?

    • Notifications should encompass both test performance and CI build times.
    • A tool that tracks and presents a history of dependency growth over time.
    • Integration at the CI runner level would be ideal.
    • A singular tool that compiles various metrics like js bundle size and error rates is preferred.

    How important was bundle sizing to Stripe?

    • Not a major concern for Stripe's dashboard.
    • Essential for hosted checkout flows to minimize bounce rates.

    General Insight:

    • There is a preference for a single, comprehensive tool rather than using multiple tools for test management and bundling.
    eli notes ## Quick Walkthrough of Bundle Size Designs
    • nonhelpful but accurate, "this design looks great" It's really annoying to go through the process of running bundle analyzers manually and searching around for changes.
    • most actionable thing is if he's trying to binary search his way through and find out where the extra size came from, he has to compare two commits. The biggest strength of this is the ''time travel'' aspect of bundle size. What would get him the most excited: Codecov hosting the tree map for last 100 runs, he can see where something crops up over time quickly and address it.
    • He can enable gating to make sure he's not bloating bundle size too much on a PR.
    • How important was bundle size to you / stripe?
      • We all thought objectively it didn't really matter that much for stripe. The stripe dashboard, where most of the bloat lives, you don't have to worry about balance. It's not deeply business impactful, most people are viewing it on desktop with fast internet connections, etc
      • but we're all persnickety and want to make sure bundle size isn't large, especially in overseas expansion.
      • However, it matters a lot for checkout flows. Bundle size has to be small, because we're loading this on mobile, loading across the world, can't increase bounce rate from checkout due to slow load times.
        • had internal tooling for this use case, was fairly janky, an action reporting CI.

    Other Reasons to Care about Bundle Size

    • Introducing a new dependency can have a direct impact on CI run times. So if we introduce some dependency that we're installing, loading, using, etc in CI, we can be inadvertently increasing CI run times and increasing the amount of time it takes PRs to get merged. This is really insidious since, oftentimes, developers don't really think about the impact of bundle size on CI. Having some way to communicate the impact of bundle changes on CI may be really useful for ensuring we're not, in a ''death by 1,000 cuts'' fashion, increasing our CI run time and degrading developer experience.
  5. codecovdesign commented on Nov 3, 2023

    @codecovdesign
    ContributorAuthor

    feedback from Abhijeet Prasad:

    Codecov hosting the tree map for last 100 runs, he can see where something crops up over time quickly and address it.

    💯 - bisecting for changes/trends is super hard atm, I wrote a script in the sdk to do this for me (involves checking out multiple tags and dumping output somewhere). I don’t think any existing GH action tooling or bundle size tools do this well fwiw either.

    Introducing a new dependency can have a direct impact on CI run times

    there’s been some conversations about Sentry performance monitoring in CI. Maybe it’s worthwhile bringing that back up again to help with this case.

    However, it matters a lot for checkout flows

    I think this makes it clear that per entry point analysis is really important.
    When we eventually connect this to Sentry performance data, we can even tell exactly what resources are requested on each page load, so we can close the loop fully.

    For the last point, we can even do cool things like, “20% of production users loading this generated bundle are on 3g, so you should pay special attention to it”

  6. changed the title [-]Discovery: Collecting and Displaying Failed Test Data in Codecov[/-] [+]Discovery: Collecting and Displaying Failed and Flaky Tests Data in Codecov[/+] on Mar 8, 2024
  7. added
    [Epic]
    on Mar 8, 2024
  8. self-assigned this
    on Mar 8, 2024
  9. Adal3n3 commented on Aug 7, 2024

    @Adal3n3

    Closed this and the new issue: #2028

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

[Epic]in discovery

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions