Skip to content

[jvm] better error message when a test exists in a transparent package #527

Open
@nedtwigg

Description

@nedtwigg

selfie.* is transparent, so if a test is there, it fails like this:

org.opentest4j.AssertionFailedError: Couldn't find source file for CallLocation(clazz=org.junit.runners.model.FrameworkMethod$1, method=<unknown>, fileName=FrameworkMethod.java, line=-1), looked in TypedPath(absolutePath=/home/runner/work/diffplugdotcom/diffplugdotcom/server/src/test/java/) and [/home/runner/work/diffplugdotcom/diffplugdotcom/server/src/test/resources], maybe there are other source roots?
	at app//com.diffplug.selfie.junit5.FSJava.assertFailed(SnapshotSystemJUnit5.kt:57)
	at app//com.diffplug.selfie.junit5.FSJava.assertFailed(SnapshotSystemJUnit5.kt:43)
	at app//com.diffplug.selfie.guts.FS.assertFailed$default(SnapshotSystem.kt:96)
	at app//com.diffplug.selfie.junit5.SnapshotFileLayoutJUnit5.sourcePathForCall(SnapshotFileLayoutJUnit5.kt:44)
	at app//com.diffplug.selfie.guts.CommentTracker.hasWritableComment(CommentTracker.kt:36)
	at app//com.diffplug.selfie.junit5.SnapshotSystemJUnit5.sourceFileHasWritableComment(SnapshotSystemJUnit5.kt:90)
	at app//com.diffplug.selfie.Mode.canWrite$selfie_lib(Mode.kt:32)
	at app//com.diffplug.selfie.SelfieImplementationsKt.checkSrc(SelfieImplementations.kt:285)
	at app//com.diffplug.selfie.SelfieImplementationsKt.access$checkSrc(SelfieImplementations.kt:1)
	at app//com.diffplug.selfie.StringSelfie.toBe(SelfieImplementations.kt:206)
	at app//selfie.ParsedFormsTest.toMd(ParsedFormsTest.kt:16)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions