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

github-workflows: Run functional tests in Docker via Batect #5031

Merged
merged 6 commits into from
Feb 16, 2022
8 changes: 6 additions & 2 deletions analyzer/src/funTest/kotlin/GitRepoFunTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private const val REPO_MANIFEST = "manifest.xml"
class GitRepoFunTest : StringSpec({
lateinit var outputDir: File

beforeSpec {
fun beforeSpec() {
// Do not use createSpecTempDir() here, as otherwise the path will get too long for Windows to handle.
outputDir = createTempDirectory(ORT_NAME).toFile()

Expand All @@ -56,12 +56,14 @@ class GitRepoFunTest : StringSpec({
GitRepo().download(pkg, outputDir)
}

afterSpec {
fun afterSpec() {
outputDir.safeDeleteRecursively(force = true)
}

// Disabled on Azure Windows because it fails for unknown reasons.
"Analyzer correctly reports VcsInfo for git-repo projects".config(enabled = !Ci.isAzureWindows) {
beforeSpec()
mnonnenmacher marked this conversation as resolved.
Show resolved Hide resolved

val ortResult = Analyzer(DEFAULT_ANALYZER_CONFIGURATION).run {
analyze(findManagedFiles(outputDir))
}
Expand All @@ -88,5 +90,7 @@ class GitRepoFunTest : StringSpec({

val workingTree = GitRepo().getWorkingTree(outputDir)
workingTree.getNested() shouldBe expectedSubmodules

afterSpec()
}
})