diff --git a/build.sbt b/build.sbt index 456096ce54..acba5a4619 100644 --- a/build.sbt +++ b/build.sbt @@ -199,9 +199,9 @@ lazy val webapi: Project = Project(id = "webapi", base = file("webapi")) IntegrationTest / testForkedParallel := false, // not run forked tests in parallel IntegrationTest / parallelExecution := false, // not run non-forked tests in parallel // Global / concurrentRestrictions += Tags.limit(Tags.Test, 1), // restrict the number of concurrently executing tests in all projects - IntegrationTest / javaOptions += "-Dconfig.resource=fuseki.conf", - // Test / javaOptions ++= Seq("-Dakka.log-config-on-start=on"), // prints out akka config - // Test / javaOptions ++= Seq("-Dconfig.trace=loads"), // prints out config locations + // IntegrationTest / javaOptions ++= Seq("-Dakka.log-config-on-start=on"), // prints out akka config + // IntegrationTest / javaOptions ++= Seq("-Dconfig.trace=loads"), // prints out config locations + // IntegrationTest / javaOptions += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005", // starts sbt with debug port IntegrationTest / testOptions += Tests.Argument("-oDF"), // show full stack traces and test case durations // add test framework for running zio-tests IntegrationTest / testFrameworks ++= Seq(new TestFramework("zio.test.sbt.ZTestFramework")) diff --git a/docs/05-internals/development/testing.md b/docs/05-internals/development/testing.md index 97df7d6e67..f294a97eaa 100644 --- a/docs/05-internals/development/testing.md +++ b/docs/05-internals/development/testing.md @@ -37,7 +37,7 @@ You might need to create an integration test because: In this case create it in the `src/it` source set of our projects. .NOTE -_Currently only the `webapi` project supports integration tests_ +_Currently only the `webapi` project supports integration tests._ Run all integration tests from the terminal. @@ -46,5 +46,14 @@ make integration-test ``` .NOTE -_The integration tests currently depend on a locally published Sipi container. That is why we need to start -the `make` command and not `sbt it`._ +_The integration tests currently depend on a locally published Sipi container, the make target helps you with that._ + +## Debugging + +You can debug unit tests directly in your IDE. + +For debugging the integration tests locally with `sbt` or your IDE you need to have a fresh SIPI container build: + +```shell +make docker-build-sipi-image +``` diff --git a/webapi/src/it/resources/fuseki.conf b/webapi/src/it/resources/application.conf similarity index 100% rename from webapi/src/it/resources/fuseki.conf rename to webapi/src/it/resources/application.conf diff --git a/webapi/src/it/resources/test.conf b/webapi/src/it/resources/test.conf index 67af9a8283..046f685419 100644 --- a/webapi/src/it/resources/test.conf +++ b/webapi/src/it/resources/test.conf @@ -1,5 +1,3 @@ -include "application" - akka { log-config-on-start = false loggers = ["akka.event.slf4j.Slf4jLogger"] diff --git a/webapi/src/main/scala/org/knora/webapi/store/triplestore/impl/TriplestoreServiceHttpConnectorImpl.scala b/webapi/src/main/scala/org/knora/webapi/store/triplestore/impl/TriplestoreServiceHttpConnectorImpl.scala index 86079fe8ee..ad1206e138 100644 --- a/webapi/src/main/scala/org/knora/webapi/store/triplestore/impl/TriplestoreServiceHttpConnectorImpl.scala +++ b/webapi/src/main/scala/org/knora/webapi/store/triplestore/impl/TriplestoreServiceHttpConnectorImpl.scala @@ -454,7 +454,7 @@ case class TriplestoreServiceHttpConnectorImpl( // to the parent folder where the files can be found val inputFile = Paths.get("..", elem.path) if (!Files.exists(inputFile)) { - throw BadRequestException(s"File ${inputFile} does not exist") + throw BadRequestException(s"File ${inputFile.toAbsolutePath} does not exist") } val fileEntity = new FileEntity(inputFile.toFile, ContentType.create(mimeTypeTextTurtle, "UTF-8"))