Skip to content

Commit

Permalink
refactor(scancode): Parameterize a test for easier version upgrades
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Nov 21, 2024
1 parent f5bcf78 commit 8d81c6e
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class ScanCodeResultParserTest : FreeSpec({
}
}

"for output format 4.0.0 should" - {
"for output format ${MAX_SUPPORTED_OUTPUT_FORMAT_MAJOR_VERSION + 1}.0.0 should" - {
"create an issue about an unsupported version" {
val headers = """
{
Expand All @@ -218,7 +218,7 @@ class ScanCodeResultParserTest : FreeSpec({
},
"start_timestamp": "2022-12-12T065635.691832",
"end_timestamp": "2022-12-12T065637.770792",
"output_format_version": "4.0.0"
"output_format_version": "${MAX_SUPPORTED_OUTPUT_FORMAT_MAJOR_VERSION + 1}.0.0"
}
],
"files": [
Expand All @@ -231,8 +231,9 @@ class ScanCodeResultParserTest : FreeSpec({
summary.issues.map { it.copy(timestamp = Instant.EPOCH) } shouldHaveSingleElement Issue(
timestamp = Instant.EPOCH,
source = ScanCode.SCANNER_NAME,
message = "The output format version 4.0.0 exceeds the supported major version " +
"$MAX_SUPPORTED_OUTPUT_FORMAT_MAJOR_VERSION. Results may be incomplete or incorrect.",
message = "The output format version ${MAX_SUPPORTED_OUTPUT_FORMAT_MAJOR_VERSION + 1}.0.0 " +
"exceeds the supported major version $MAX_SUPPORTED_OUTPUT_FORMAT_MAJOR_VERSION. Results may " +
"be incomplete or incorrect.",
severity = Severity.WARNING
)
}
Expand Down

0 comments on commit 8d81c6e

Please sign in to comment.