exercism / scala

Exercism exercises in Scala.
https://exercism.org/tracks/scala
MIT License
123 stars 131 forks source link

Fix Yacht tests in online test runner #790

Closed artamonovkirill closed 1 year ago

artamonovkirill commented 1 year ago

Context: https://forum.exercism.org/t/scala-test-runner-reports-error-erroneously-for-prime-factors/6314/11

Test report is generated based on class name (=> TEST-YachtTests.xml in main), while the test runner expects TEST-YachtTest.xml. The PR aligns class name with file name.

github-actions[bot] commented 1 year ago

Hello. Thanks for opening a PR on Exercism. We are currently in a phase of our journey where we have paused community contributions to allow us to take a breather and redesign our community model. You can learn more in this blog post. As such, all issues and PRs in this repository are being automatically closed.

That doesn't mean we're not interested in your ideas, or that if you're stuck on something we don't want to help. The best place to discuss things is with our community on the Exercism Community Forum. You can use this link to copy this into a new topic there.


Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it.

ErikSchierboom commented 1 year ago

Test report is generated based on class name (=> TEST-YachtTests.xml in main), while the test runner expects TEST-YachtTest.xml.

As a follow-up, could we maybe look for a *Test.xml file to make it less error prone?

artamonovkirill commented 1 year ago

As a follow-up, could we maybe look for a *Test.xml file to make it less error prone?

That would probably help for "Prime Factors", but not for "Yacht" (where the class was named "YachtTests"). I haven't dug too deep but it looks like Scala picks up whatever class (probably ones that extend AnyFunSuite). Even

class YachtFooBar extends AnyFunSuite with Matchers {
  ...
}

is run and the result XML is TEST-YachtFooBar.xml.

I see two options:

Screenshot 2023-07-13 at 18 39 02
ErikSchierboom commented 1 year ago

add a CI check for Scala project to make sure class name and file names match (also removes IDE warnings like below)

Ah, this might be even better