Skip to content

(Chore): Reorganize report tests#1099

Open
TylerJang27 wants to merge 2 commits into
mainfrom
tyler/reorganize-report-tests
Open

(Chore): Reorganize report tests#1099
TylerJang27 wants to merge 2 commits into
mainfrom
tyler/reorganize-report-tests

Conversation

@TylerJang27
Copy link
Copy Markdown
Collaborator

@TylerJang27 TylerJang27 commented May 28, 2026

Base for #1100

Some reorganization of domains for the report testing (used by RSpec plugin)

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented May 28, 2026

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@trunk-staging-io
Copy link
Copy Markdown

trunk-staging-io Bot commented May 28, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.15%. Comparing base (cdaa132) to head (8a07de4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1099      +/-   ##
==========================================
+ Coverage   81.90%   82.15%   +0.25%     
==========================================
  Files          69       69              
  Lines       15039    15039              
==========================================
+ Hits        12317    12356      +39     
+ Misses       2722     2683      -39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

}
}

#[allow(dead_code)]
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I realize this is an antipattern in rust-world, but it matches the pattern of the rest of this repo, and I didn't want to undertake crate explosion right now. Having these common utils are necessary for the other "integration" tests in this crate.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what about this is an anti-pattern? new to rust

Copy link
Copy Markdown
Member

@dfrankland dfrankland May 29, 2026

Choose a reason for hiding this comment

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

Ideally you don't define re-usable functions for tests within the tests directory. It forces one to mark the functions as dead_code because code (the test functions themselves) within tests files only materializes via compiler options.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The compiler only executes this function inside of tests, which are excluded from the normal compilation cycle, so it thinks this is dead code. The better pattern afaik is to setup separate, flat crates for test_report, test_report_tests, test_report_test_utils, that way the functions are used either directly where they're defined or exposed as public in the crate (and therefore not unused). That's what I tried to do for the rust integration tests in trunk2. But doing so right now in analytics-cli would require a substantial refactor, so I'm just using the macro here to bypass the warning

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Undertook this split mainly to keep the follow-up PR sane. But also just to make it clear whether we're testing the upload flow or the quarantine flow for rspec

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

These tests are ported directly with no meaningful changes, just renames and commonizing a couple small pieces

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants