Skip to content

Test resources not found because in wrong class folder #120

@pitschr

Description

@pitschr

Expected vs Actual Behaviour

Hello.

I am facing the similiar issue in #4 but it is a single project (not a multi-project) and I am in a different path. The test resouces are subject to be called using WithMockedApplication.class.getResource(".... file name ...");

When running through SBT terminal it is failing to find the resources because it is in the path:
target/scala-2.12/jacoco/instrumented-classes

while it is expected to be in the usual test-classes path which contains class files and the test resources as well:
target/scala-2.12/test-classes

Actual workaround is to detect if test is running in SBT and then using a hardcoded path to obtain the resources from the test-classes folder. I would like to get rid off this hardcoded logic.

Any idea how to resolve it and how to tell SBT to use the correct path instead of the JaCoCo path?

Thank you, Christoph

Steps to Reproduce

> sbt clean test

Environment

  • Play Framework: 2.7
  • SBT version: 1.2.7
  • Plugin version: 3.1.0
  • Scala version(s): 2.11.12", "2.12.7
  • Java version: 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions