-
Notifications
You must be signed in to change notification settings - Fork 680
Add test report dir to native #4983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Introduce the `ReportWriter` class for handling XML file writing and integrate it into the engine. Refactor `JUnitXmlWriter` to `JUnitXmlReportGenerator`
val specName = ref.kclass.bestName() | ||
val testFile = "TEST-${specName}.xml" | ||
val xml = generator.xml(ref.kclass, results) | ||
writeFile(testReportsDir, testFile, xml) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be guarded by a mutex or use streams or some other coroutine-safe mechanism? what can't specs finish in parallel depending on the config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also: can a spec contain path separators or other special chars that can cause problems for file systems? I am not 100% sure the rudimentary kotlinx.io Path and FS implementations handle it correctly.
What I did find out though, is that there is of course no file system in the browser, so when we try this on js browser targets, it will fail hard.
I have no idea how kotlin.test produces XMLs for browser tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be guarded by a mutex or use streams or some other coroutine-safe mechanism? what can't specs finish in parallel depending on the config?
the test engine itself ensures it's all thread safe and only one spec is reported at once (I call it spec pinning)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also: can a spec contain path separators or other special chars that can cause problems for file systems? I am not 100% sure the rudimentary kotlinx.io Path and FS implementations handle it correctly. What I did find out though, is that there is of course no file system in the browser, so when we try this on js browser targets, it will fail hard. I have no idea how kotlin.test produces XMLs for browser tests.
yeah once this is working for native I will start looking into wasm and js
No description provided.