Skip to content

Commit

Permalink
fix(OrtResultTest): Add non-empty revision to unrelated tests
Browse files Browse the repository at this point in the history
Both `fail if no vcs matches` and `use the correct vcs` don't
hinge on the given revision, still they keep the revision empty.
This was no problem for the old `Repository`, but when using
`RepositoryProvenance` instead of `VcsInfo`, we require a non-
empty revision. To assure that, we just add the default git
revision "main" to these example repos.
  • Loading branch information
pepper-jk committed Jun 20, 2024
1 parent 0688ffc commit 3133e5f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions model/src/test/kotlin/OrtResultTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ class OrtResultTest : WordSpec({

"getDefinitionFilePathRelativeToAnalyzerRoot()" should {
"use the correct vcs" {
val vcs = VcsInfo(type = VcsType.GIT, url = "https://example.com/git", revision = "")
val nestedVcs1 = VcsInfo(type = VcsType.GIT, url = "https://example.com/git1", revision = "")
val nestedVcs2 = VcsInfo(type = VcsType.GIT, url = "https://example.com/git2", revision = "")
val vcs = VcsInfo(type = VcsType.GIT, url = "https://example.com/git", revision = "main")
val nestedVcs1 = VcsInfo(type = VcsType.GIT, url = "https://example.com/git1", revision = "main")
val nestedVcs2 = VcsInfo(type = VcsType.GIT, url = "https://example.com/git2", revision = "main")
val project1 = Project.EMPTY.copy(
id = Identifier("Gradle:org.ossreviewtoolkit:project1:1.0"),
definitionFilePath = "project1/build.gradle",
Expand Down Expand Up @@ -123,9 +123,9 @@ class OrtResultTest : WordSpec({
}

"fail if no vcs matches" {
val vcs = VcsInfo(type = VcsType.GIT, url = "https://example.com/git", revision = "")
val nestedVcs1 = VcsInfo(type = VcsType.GIT, url = "https://example.com/git1", revision = "")
val nestedVcs2 = VcsInfo(type = VcsType.GIT, url = "https://example.com/git2", revision = "")
val vcs = VcsInfo(type = VcsType.GIT, url = "https://example.com/git", revision = "main")
val nestedVcs1 = VcsInfo(type = VcsType.GIT, url = "https://example.com/git1", revision = "main")
val nestedVcs2 = VcsInfo(type = VcsType.GIT, url = "https://example.com/git2", revision = "main")
val project = Project.EMPTY.copy(
id = Identifier("Gradle:org.ossreviewtoolkit:project1:1.0"),
definitionFilePath = "build.gradle",
Expand Down

0 comments on commit 3133e5f

Please sign in to comment.