Skip to content

Commit 1d97f69

Browse files
committed
test(analyzer): Make test resilient to change WRT to the issue message
The following refactoring steps introduce a file path into the issue message. This is tricky to test with an expected result. So, just assert the amount of issues. Signed-off-by: Frank Viernau <[email protected]>
1 parent fc6bb00 commit 1d97f69

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

analyzer/src/funTest/assets/projects/synthetic/gomod-submodules-embed-expected-output.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

analyzer/src/funTest/kotlin/managers/GoModFunTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package org.ossreviewtoolkit.analyzer.managers
2121

2222
import io.kotest.core.spec.style.StringSpec
2323
import io.kotest.matchers.should
24+
import io.kotest.matchers.shouldBe
2425

2526
import org.ossreviewtoolkit.model.toYaml
2627
import org.ossreviewtoolkit.utils.test.getAssetFile
@@ -95,10 +96,9 @@ class GoModFunTest : StringSpec({
9596
"Local module dependencies make the analysis fail" {
9697
// TODO: Implement support for local dependencies, see https://github.com/oss-review-toolkit/ort/issues/7649.
9798
val definitionFile = testDir.resolve("gomod-submodules/app/go.mod")
98-
val expectedResultFile = testDir.resolve("gomod-submodules-embed-expected-output.yml")
9999

100100
val result = create("GoMod").resolveSingleProject(definitionFile)
101101

102-
result.withInvariantIssues().toYaml() should matchExpectedResult(expectedResultFile, definitionFile)
102+
result.issues.size shouldBe 1
103103
}
104104
})

0 commit comments

Comments
 (0)