diffplug / diffplug/selfie

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

Open
#527 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Kotlin
Stars
101
Forks
18
PR merge metrics
No merged PRs in 30d

Description

`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=, 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)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.