Skip to content
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

Test results cut off part of test name #468

Closed
disordered opened this issue Apr 3, 2024 · 5 comments
Closed

Test results cut off part of test name #468

disordered opened this issue Apr 3, 2024 · 5 comments

Comments

@disordered
Copy link

disordered commented Apr 3, 2024

This is in zio-test v2, did not test with v1.

Below code will cut of part of test name in the viewer:

suiteAll("Service") {
  suiteAll("update") {
    test("updates to everyone's satisfaction") {
      ZIO.succeed(assertTrue(true))
    }
  }
}

will render as:

Service
  update
    s to everyone's satisfaction

sbt test will render as:

+ Service
  + update
    + updates to everyone's satisfaction
@hmemcpy
Copy link
Collaborator

hmemcpy commented Apr 3, 2024

Ugh. Thanks, I'll take a look!

@hmemcpy
Copy link
Collaborator

hmemcpy commented Apr 3, 2024

I was just able to reproduce this. It seems that the text is reported correctly from the runner, I suspect it's an IntelliJ bug, trying to build a nested test tree, so it cuts the word update from updates for some reason. I'll see if I can fix it in the plugin, otherwise I'll report it as an IntelliJ issue.

Thanks for reporting!

@hmemcpy
Copy link
Collaborator

hmemcpy commented Apr 3, 2024

Update: it seems to be the default behavior of IntelliJ's test tree builder. It has some logic where it tries to group nested suite tests and looks up a parent, then does an equivalent of

if (test.name.startsWith(parent.name)) test.name.substring(parent.name.length())

And so far it doesn't seem to be a way to (easily) interfere with this behavior. I'm not giving up :)

@disordered
Copy link
Author

It's not a big deal if you can't fix it, I just ended up rewording the test to avoid it. Obviously, would be nice if this could be fixed.

Thanks for looking into it, either way.

@hmemcpy
Copy link
Collaborator

hmemcpy commented Apr 3, 2024

Hah, yeah it's one of those crazy things IntelliJ does... I'm sure they had their reasons :)
Anyway, thanks for reporting! I don't really see an easy way to fix this right now (everything down there is pretty much hardcoded/final, so I can't hook into the "presentable name" logic). I'm closing this for now.

@hmemcpy hmemcpy closed this as completed Apr 3, 2024
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

No branches or pull requests

2 participants