Skip to content

Conversation

sksamuel
Copy link
Member

No description provided.

@sksamuel sksamuel requested a review from a team as a code owner July 31, 2025 04:20
sksamuel added 4 commits July 30, 2025 23:31
Introduce the `ReportWriter` class for handling XML file writing and integrate it into the engine. Refactor `JUnitXmlWriter` to `JUnitXmlReportGenerator`
Comment on lines +42 to 46
val specName = ref.kclass.bestName()
val testFile = "TEST-${specName}.xml"
val xml = generator.xml(ref.kclass, results)
writeFile(testReportsDir, testFile, xml)
}
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Member Author

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)

Copy link
Member Author

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

@sksamuel sksamuel merged commit 18bf1ca into master Jul 31, 2025
7 checks passed
@sksamuel sksamuel deleted the sks/native-xml branch July 31, 2025 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants