-
Notifications
You must be signed in to change notification settings - Fork 333
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
Cannot run TestNG tests. #6826
Comments
Thanks for reporting! Do you maybe have a sample project that I could use to reproduce it? |
@tgodzik I will work on putting one together! |
@tgodzik Here is an example repo that replicates the issue. https://github.com/charlesbthomas/testng-example Screenshots: |
I am not familiar with the metals codebase (just a happy user), but my hunch is that we need to implement something like: Line 13 in 2c8d344
but for TestNG. |
Sure, but without it it should still be possible to run the whole test suite. |
If you pull that example down, you can see that it is unable to run all the tests in that file. |
That's what I mean, we need to fix that part fist. |
@tgodzik any ideas on where someone might start with this? I am pretty motivated to fix it and willing to work on the fix as a contribution, but not sure where I would even start. |
Looking at the frameworks available I don't think we support TestNG in Bloop. It should be possible as there are interfaces for sbt https://github.com/sbt/sbt-testng <- those same should be possible to use in Bloop, but they seem outdated. We would probably need to add sbt-testng on the classpath for Bloop (maven classpath should be translated to the Bloop one, so we can add it there) and add new framework entry like the ones here: https://github.com/scalacenter/bloop-config/blob/main/config/src/bloop/config/Config.scala#L13 pointing to https://github.com/sbt/sbt-testng/blob/master/src/main/scala/de/johoop/testnginterface/TestNGFramework.scala You can experiment by publishing bloop-config locally, change it in https://github.com/scalacenter/bloop-maven-plugin , publish that locally also and try to export a project with the added sbt-testng on the classpath manually. That should make metals discover the test suites. You can also modify the bloop config file manually in Maybe that would be enough for the test suites to be discoverable. A bonus point would be to only add the framework if the appropriate classes are available, but it doesn't seem we do it for any other test frame work, so we should be fine without. |
Let me know if you manage to test it out! |
Looks like there is a newer artifact we can use from mill |
@tgodzik I tried adding sbt-testng to my test project above's classpath and manually editing the bloop config to also include:
Still no luck. |
Describe the bug
When using my editor to try and run tests I have no code lenses for any tests using the TestNG test framework.
Furthermore, when I try to run all tests in a file, there are no tests detected.
Expected behavior
Operating system
macOS
Editor/Extension
Nvim (nvim-metals)
Version of Metals
1.3.5
Extra context or search terms
No response
The text was updated successfully, but these errors were encountered: