Skip to content

Commit 9fb669a

Browse files
committed
Potential extensions fix
1 parent 7970449 commit 9fb669a

2 files changed

Lines changed: 10 additions & 15 deletions

File tree

build.sbt

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,6 @@ javaOptions ++= Seq(
1818

1919
fork := true
2020

21-
lazy val installExtensions = TaskKey[Unit]("install bundled extensions so we can test models that use them")
22-
installExtensions := {
23-
val main = "org.nlogo.workspace.ExtensionInstaller"
24-
// We even install the extensions we can't or won't test just to avoid compile errors with them.
25-
// -Jeremy B May 2021
26-
val args = Seq("arduino", "array", "bitmap", "csv", "gis", "gogo", "ls", "matrix", "nw", "palette", "profiler", "py", "r", "resource", "rnd", "sound", "table", "time", "vid", "view2.5d")
27-
val s = streams.value
28-
val cp = (Test / dependencyClasspath).value
29-
(Test / run / runner).value.run(main, cp.files, args, s.log)
30-
}
31-
32-
(Test / test) := (Test / test).dependsOn(installExtensions).value
33-
3421
libraryDependencies ++= Seq(
3522
"org.nlogo" % "netlogo" % netLogoVersion,
3623
"org.scalatest" %% "scalatest" % "3.2.19" % Test,
@@ -47,5 +34,6 @@ libraryDependencies ++= Seq(
4734
"com.typesafe" % "config" % "1.3.1" % "test",
4835
"com.vladsch.flexmark" % "flexmark" % "0.20.0" % "test",
4936
"com.vladsch.flexmark" % "flexmark-ext-autolink" % "0.20.0" % "test",
50-
"com.vladsch.flexmark" % "flexmark-util" % "0.20.0" % "test"
37+
"com.vladsch.flexmark" % "flexmark-util" % "0.20.0" % "test",
38+
"org.json4s" %% "json4s-jackson" % "4.0.7"
5139
)

src/test/scala/org/nlogo/models/TestModels.scala

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,18 @@ abstract class TestModels extends AnyFunSuite {
3030
testModels(models, testName)(testFun)
3131
}
3232

33+
// the following models use the import-a extension, which is not bundled
34+
private def excludeModel(path: String): Boolean = {
35+
path.contains("Calorimetry") ||
36+
path.contains("Resource Example")
37+
}
38+
3339
def testModels(models: Map[Model, String], testName: String)(testFun: Model => Iterable[Any]): Unit =
3440
test(testName) {
3541
val allFailures: Iterable[String] =
3642
(for {
37-
model <- models.view.filterKeys(model => nameFilter.map(models(model).toLowerCase.contains).getOrElse(true)).keys
43+
model <- models.view.filterKeys(model =>
44+
nameFilter.map(models(model).toLowerCase.contains).getOrElse(true) && !excludeModel(models(model))).keys
3845
failures <- Try(testFun(model))
3946
.recover { case e => Seq(e.toString + "\n" + e.getStackTrace.mkString("\n")) }
4047
.toOption

0 commit comments

Comments
 (0)