Skip to content

Commit

Permalink
Fix MissingBuildToolSuite on Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
olafurpg committed Mar 2, 2021
1 parent 4ac79f4 commit 8c46b4f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ lazy val unit = project
Seq[BuildInfoKey](
version,
scalaVersion,
"temporaryDirectory" -> target.value / "tmpdir",
"sourceroot" -> baseDirectory.in(ThisBuild).value,
"minimizedJavaSourceDirectory" ->
sourceDirectory.in(minimized, Compile).value / "java",
Expand Down
21 changes: 11 additions & 10 deletions tests/buildTools/src/test/scala/tests/BaseBuildToolSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,29 @@ package tests

import java.nio.file.FileSystems
import java.nio.file.Path
import java.nio.file.Paths

import scala.util.Properties

import scala.meta.internal.io.FileIO
import scala.meta.io.AbsolutePath

import com.sourcegraph.lsif_java.LsifJava
import moped.testkit.DeleteVisitor
import moped.testkit.FileLayout
import moped.testkit.MopedSuite
import munit.TestOptions

abstract class BaseBuildToolSuite extends MopedSuite(LsifJava.app) {
override def environmentVariables: Map[String, String] = sys.env
override def workingDirectory: Path = {
val dir = super.workingDirectory
if (Properties.isMac && dir.toString.startsWith("/var")) {
Paths.get(s"/private/$dir")
} else {
dir

// NOTE(olafur): workaround for https://github.com/scalameta/moped/issues/18
override val temporaryDirectory: DirectoryFixture =
new DirectoryFixture {
private val path = BuildInfo.temporaryDirectory.toPath
override def apply(): Path = path
override def beforeAll(): Unit = {}
override def afterEach(context: AfterEach): Unit = {
DeleteVisitor.deleteRecursively(path)
}
}
}

private val semanticdbPattern = FileSystems
.getDefault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class MissingBuildToolSuite extends BaseBuildToolSuite {
"basic",
List(),
expectedOutput =
"""|error: No build tool detected in workspace '/private/workingDirectory'. At the moment, the only supported build tools are: Gradle, Maven.
"""|error: No build tool detected in workspace '/workingDirectory'. At the moment, the only supported build tools are: Gradle, Maven.
|""".stripMargin,
workingDirectoryLayout = ""
)
Expand Down

0 comments on commit 8c46b4f

Please sign in to comment.