Skip to content

Commit

Permalink
chore(downloader): Generalize VCS directory filtering in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Apr 25, 2024
1 parent c091056 commit 7a46ed5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion downloader/src/funTest/kotlin/DownloaderFunTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ class DownloaderFunTest : WordSpec({

val provenance = Downloader(DownloaderConfiguration()).download(pkg, outputDir)

outputDir.walk().onEnter { it.name != ".svn" }.count() shouldBe 302
outputDir.walk().onEnter { it.name !in VCS_DIRECTORIES }.count() shouldBe 302

provenance.shouldBeTypeOf<RepositoryProvenance>().apply {
vcsInfo.type shouldBe VcsType.SUBVERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import org.ossreviewtoolkit.model.Identifier
import org.ossreviewtoolkit.model.Package
import org.ossreviewtoolkit.model.VcsInfo
import org.ossreviewtoolkit.model.VcsType
import org.ossreviewtoolkit.utils.common.VCS_DIRECTORIES
import org.ossreviewtoolkit.utils.test.ExpensiveTag

private const val REPO_URL = "https://svn.code.sf.net/p/sendmessage/code"
Expand Down Expand Up @@ -79,7 +80,7 @@ class SubversionDownloadFunTest : StringSpec() {

val workingTree = svn.download(pkg, outputDir)
val actualFiles = workingTree.workingDir.walkBottomUp()
.onEnter { it.name != ".svn" }
.onEnter { it.name !in VCS_DIRECTORIES }
.filter { it.isFile }
.map { it.relativeTo(outputDir) }
.sortedBy { it.path }
Expand Down

0 comments on commit 7a46ed5

Please sign in to comment.