Skip to content

test: Improve analysis of multiple definition files #10176

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 4 commits into from
Apr 16, 2025

Conversation

fviernau
Copy link
Member

@fviernau fviernau commented Apr 15, 2025

See individual commits.

@fviernau fviernau requested a review from a team as a code owner April 15, 2025 07:41
@fviernau fviernau enabled auto-merge (rebase) April 15, 2025 07:41
@fviernau fviernau force-pushed the pnpm-test-improvement branch 3 times, most recently from c09119c to 4bf5c63 Compare April 15, 2025 07:48
@fviernau fviernau requested a review from sschuberth April 15, 2025 07:57
@fviernau fviernau force-pushed the pnpm-test-improvement branch 3 times, most recently from a6a3659 to ba0c59b Compare April 15, 2025 08:16
Copy link

codecov bot commented Apr 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.62%. Comparing base (865b49b) to head (e72ae9c).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #10176   +/-   ##
=========================================
  Coverage     69.62%   69.62%           
- Complexity     1460     1461    +1     
=========================================
  Files           271      271           
  Lines          9747     9747           
  Branches       1031     1031           
=========================================
  Hits           6786     6786           
  Misses         2506     2506           
  Partials        455      455           
Flag Coverage Δ
funTest-docker 68.74% <ø> (+0.32%) ⬆️
funTest-non-docker 33.26% <ø> (ø)
test-ubuntu-24.04 39.40% <ø> (ø)
test-windows-2022 39.38% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@@ -54,7 +54,7 @@ class YarnFunTest : StringSpec({
val definitionFile = getAssetFile("projects/synthetic/yarn/workspaces/package.json")
val expectedResultFile = getAssetFile("projects/synthetic/yarn/workspaces-expected-output.yml")

val result = YarnFactory.create().collateMultipleProjects(definitionFile).withResolvedScopes()
val result = analyze(definitionFile.parentFile, packageManagers = setOf(YarnFactory())).getAnalyzerResult()
Copy link
Member

@sschuberth sschuberth Apr 15, 2025

Choose a reason for hiding this comment

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

There are more places in the code base that call the combination of create() / collateMultipleProjects() / withResolvedScopes() (e.g. Yarn2FunTest, TychoFunTest). Can we make use of the function there as well?

The test cares only about the analyzer result. So, use only that as
expected result instead of the entire `OrtResult`.

Signed-off-by: Frank Viernau <[email protected]>
@fviernau fviernau force-pushed the pnpm-test-improvement branch from ba0c59b to 953c6e6 Compare April 15, 2025 14:03
@fviernau fviernau changed the title test(node): Simplify an expected result test: Improve analysis of multiple definition files Apr 15, 2025
@fviernau fviernau requested a review from sschuberth April 15, 2025 14:04
@fviernau fviernau force-pushed the pnpm-test-improvement branch from 953c6e6 to 96555a1 Compare April 15, 2025 14:25
sschuberth
sschuberth previously approved these changes Apr 15, 2025
sschuberth
sschuberth previously approved these changes Apr 16, 2025
@sschuberth
Copy link
Member

The recent change for skip_excluded: true also needs to be reflected in the expected results to get rid of test failures.

Prepare for an upcoming change.

Signed-off-by: Frank Viernau <[email protected]>
Remove the assumption how the mapping of the definitions files is
made to make the test more resilient to code changes and to also make
it cover the mapping of the definition files.

Signed-off-by: Frank Viernau <[email protected]>
@fviernau fviernau force-pushed the pnpm-test-improvement branch from c76aec0 to e72ae9c Compare April 16, 2025 09:50
@fviernau
Copy link
Member Author

The recent change for skip_excluded: true also needs to be reflected in the expected results to get rid of test failures.

I ended up making it an additional parameter.

@fviernau fviernau merged commit 28aef17 into main Apr 16, 2025
26 checks passed
@fviernau fviernau deleted the pnpm-test-improvement branch April 16, 2025 10:07
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.

2 participants