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

Minor package curation test simplifications #9673

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fviernau
Copy link
Member

No description provided.

@fviernau fviernau requested a review from a team as a code owner December 27, 2024 13:06
@fviernau fviernau force-pushed the package-curation-test-simplifications branch from 8363074 to 2cf6306 Compare December 27, 2024 13:07
@fviernau fviernau enabled auto-merge (rebase) December 27, 2024 13:07
Copy link

codecov bot commented Dec 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.10%. Comparing base (60edfdf) to head (1c67348).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #9673   +/-   ##
=========================================
  Coverage     68.10%   68.10%           
  Complexity     1294     1294           
=========================================
  Files           249      249           
  Lines          8841     8841           
  Branches        922      922           
=========================================
  Hits           6021     6021           
  Misses         2432     2432           
  Partials        388      388           
Flag Coverage Δ
funTest-docker 65.14% <ø> (ø)
funTest-non-docker 33.28% <ø> (ø)
test-ubuntu-24.04 35.91% <ø> (ø)
test-windows-2022 35.88% <ø> (ø)

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.

@fviernau fviernau force-pushed the package-curation-test-simplifications branch from 2cf6306 to 3ec38e7 Compare December 27, 2024 13:43
model/src/test/kotlin/PackageCurationTest.kt Show resolved Hide resolved
@@ -228,7 +190,7 @@ class PackageCurationTest : WordSpec({
)

val curation = PackageCuration(
id = Identifier.EMPTY,
id = pkg.id.copy(type = "${pkg.id.type}Suffix}"),
Copy link
Member

Choose a reason for hiding this comment

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

Why does this need to be non-empty now, which is a bit of the opposite of the other changes?

Copy link
Member Author

Choose a reason for hiding this comment

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

The test name should explain this: fail if identifiers do not match.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, but what confused me is that the curation id is derived from the package id by adding a suffix, which seemed like some similarity is needed. As the package id is anyway empty now, can we instead set the curation id to something like Identifier.EMPTY.copy(type = "Unmatched") to make the intention explicit?

model/src/test/kotlin/PackageCurationTest.kt Outdated Show resolved Hide resolved
@fviernau fviernau force-pushed the package-curation-test-simplifications branch from 3ec38e7 to 211a0d9 Compare December 27, 2024 21:59
@fviernau fviernau requested a review from sschuberth December 27, 2024 21:59
@fviernau fviernau force-pushed the package-curation-test-simplifications branch from 211a0d9 to 07ae2da Compare December 27, 2024 22:31
@@ -228,7 +190,7 @@ class PackageCurationTest : WordSpec({
)

val curation = PackageCuration(
id = Identifier.EMPTY,
id = pkg.id.copy(type = "${pkg.id.type}Suffix}"),
Copy link
Member

Choose a reason for hiding this comment

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

Ok, but what confused me is that the curation id is derived from the package id by adding a suffix, which seemed like some similarity is needed. As the package id is anyway empty now, can we instead set the curation id to something like Identifier.EMPTY.copy(type = "Unmatched") to make the intention explicit?

binaryArtifact = RemoteArtifact.EMPTY,
sourceArtifact = RemoteArtifact.EMPTY,
vcs = VcsInfo.EMPTY,
val pkg = Package.EMPTY.copy(
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Use a one-liner as in line 210?

While at it, simplify code by using empty values where non-empty values
are not required for the test.

Signed-off-by: Frank Viernau <x9fviern@zeiss.com>
@fviernau fviernau force-pushed the package-curation-test-simplifications branch from 07ae2da to 1c67348 Compare December 28, 2024 10:06
@fviernau fviernau requested a review from sschuberth December 28, 2024 10:06
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