does the latest minutest version change how tests ...
# minutest
c
does the latest minutest version change how tests are named? I have this in my pitest config
targetTests.set(setOf("randolf.*"))
and if I bump the minutest config it does not find tests anymore
with 1.9.0 it works
d
What is pitest config @christophsturm?
c
oh. pitest is a mutation testing framework
and i thought maybe minutest 1.10 changed how test names are reported, so the test name filtering in pitests no longer works as expected
d
Ah yes. It wouldn’t shock me if I had broken that, although I don’t remember having to change any of the tests that do check naming since 1.9
c
pitest is a great tool btw.
d
I’ve heard good things, but didn’t know it could be applied to Kotlin.
Please let me know if I can help with the test naming.
c
if you want to see the problem in action you can check out randolf master, change the minutest version to 1.10 and run
./gradlew pitest
d
Ah, that kind of makes sense. Previously I was relying on the default behaviour for the test identifier - the result of which was (I think) that there was a MethodIdentifier pointing at
minutests()
in JUnit5Minutests - the
@TestFactory
.
Now I’m explicitly setting a file url to point to the source where the
test
and
context
methods are invoked. This lets IntelliJ jump to the actual source - but I bet will result in the TestIdentifier not having a MethodSource.
c
can you just set the methodsource too?
or maybe trigger the old behavior with a property? pitest only runs from gradle
i really like my test setup, but it has a lot of moving parts, minutest, pitest, pitest-gradle, pitest-junit5-plugin
d
I could, but it would be better to make pitest better? What does it do with the information?
c
hmm i can file an issue in the pitest-junit5 repo
i think it uses the method source for the test name filtering
isnt it the right thing to do to set the MethodSource?
d
There isn’t a method, just the invocation of ‘test’
c
i think this is the check that fails:
Copy code
.filter(testIdentifier -> testIdentifier.getSource().isPresent())
and i think i can fix it in the pitest junit plugin
submitted an issue in the junit plugin https://github.com/pitest/pitest-junit5-plugin/issues/39
once thats fixed i can add pitest to the minutest build if you want
I looked into it and junit5 is a really confusing api. maybe the easiest way is to set the method source again?
d
You’re not wrong about the API
I don’t think that I can have a MethodSource URI and a file one.
c
ahhh
ok
i think i have a fix for the junit plugin
d
👍
c
but i have no idea how to use my locally built jar file with gradle
do i need to add a mavenLocal() source?
d
I think you can just do ./gradlew install
and it will install it into ~/.m2
c
its a maven project but I’ll try
ok it works locally for me and i submitted a PR
hmm it seems it doesnt really fix it. maybe we need a separate pitest plugin for minutest.
minutest-junit5 is not really a lot of code
the test identifiers seem to be exactly the same with 1.10 and 1.9 so it must be something different.
d
TBH I’m a bit surprised that PiTest worked at all with Minutest - I would have expected it to be quite sensitive to the form of test specification.
Another thought - I upgraded the version of JUnit that Minutest uses between 1.9 and 1.10. (5.4.0 -> 5.5.2). That might mean that you are getting a later version with some other incompatibilty?
c
in the randolf project i have every dependency bumped to latest (also junit) and it works
d
So that’s Minutest 1.9 running against JUnit 5.5.2? Hmm, back to the drawing board
c
I’m suprised that it shows method source for minutest when you said you changed it.
do you think its easy to serialize the output of the junit api to json and back? then i could just use that for a pitest-junit unittest
d
I’m afraid I really don’t know what pitest is doing with the information, and I’m a bit snowed under. Are you going to be at KotlinConf - we could look at it together there?
c
sadly not. I think I’m just going to create a pitest minutest plugin then i can use tdd to do it instead of manually trying out things, which i don’t really like
kotlintest has a pitest plugin and its also apache license so i could use that as a starting point
probably less fun than starting from scratch, but a pragmatic solution