Comments (7)
Thanks for the follow-up, @Pante.
I'm using Java 17, Elementary 2.0.1, and MacOS.
I've created a simple reproducer which shows the problem at https://github.com/holly-cummins/elementary-315-reproducer/commits/main/. The first commit reproduces the error. Checking it out and doing mvn clean install
should give
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] ExtensionAnnotationProcessorTest.shouldProcessClassWithBuildStepWithoutErrors:28->assertNoErrrors:32 Errors were: [error: Resource path URI is invalid: mem:///SOURCE_OUTPUT/ignore.tmp
Root error is java.nio.file.FileSystemNotFoundException: Provider "mem" not installed] ==> expected: <0> but was: <1>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
The second commit has a simple file provider to get the tests passing.
from elementary.
Thanks @Pante, that's worked! I had to change my tests to read Results.generatedSources
rather than Results.sources
, but it's quite likely the test was doing it wrong and passing for the wrong reason when it was using Results.sources
.
from elementary.
Thanks for reporting this bug!
I tried replicating the issue, but it seems to be working fine on my machine (Java 17, Windows), https://github.com/Pante/elementary/blob/fix/issue/315/elementary/src/test/java/com/test/Issue315Test.java. I assume the code snippet you provided was part of an annotation processor under test using the JavacExtension
.
Could you provide which Java version, Elementary version & OS you were using?
from elementary.
@holly-cummins bump!
from elementary.
Thanks for taking the time & effort to provide a reproducer. I took a look it and it and I can replicate the issue across both my Windows and MacOS machines.
The problem now lies in how to fix it. I'm a little hesitant to continue down the in-memory file representation path as it seems like significant effort to get it working without subtle bugs, even libraries like https://github.com/google/jimfs and https://github.com/marschall/memoryfilesystem seem to contain a long list of caveats. I think this issue even existing is proof of that.
I've been thinking and perhaps it might make more sense to lean into temporary directories instead, maybe something similar to https://junit.org/junit5/docs/5.9.1/api/org.junit.jupiter.api/org/junit/jupiter/api/io/TempDir.html? It should be simpler to maintain and also has the upside of allowing people to debug the generated files.
from elementary.
@holly-cummins I've released Elementary 3 that generates files in temporary directories instead of in-memory. It should fix the split-brain and file system issues. Please do re-open this issue if the bug persists.
from elementary.
While moving Elementary away from in-memory files, I remember fixing an issue with Results.sources
sometimes returning sources that it shouldn't have. It was an unintended side-effect of the in-memory representation. The changes you've observed is probably a result of that.
from elementary.
Related Issues (18)
- Your .dependabot/config.yml contained invalid details HOT 1
- Missing page "Why java 11?" HOT 4
- [BUG] Repo missing in elementary/README.md HOT 9
- [FEATURE REQUEST] Rename @Case to something better HOT 36
- [BUG] Cannot use source with intentional compile errors for ToolsExtension HOT 10
- [FEATURE REQUEST] First-class module support in JUnit extensions HOT 7
- [BUG] `MemoryFileManager ` does not handle modules correctly
- [FEATURE REQUEST] Better support for parameterized tests HOT 1
- [BUG] Modules don't compile HOT 1
- Deploy artifacts to maven central HOT 12
- Dependency Dashboard
- [FEATURE REQUEST] Auto-format pull requests
- [FEATURE REQUEST] Primitives for Module support HOT 7
- [BUG] com.karuslabs:satisfactory 1.1.3 is not available HOT 2
- Requires `org.junit.jupiter:junit-jupiter-params`.
- Documentation lacks sufficient setup information to prevent missing class error. HOT 5
- Documentation examples require Utilitary. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elementary.