Skip to content

A cli rascal test runner for use from the maven plugin. #2755

Draft
jurgenvinju wants to merge 7 commits intomainfrom
feat/test-cli
Draft

A cli rascal test runner for use from the maven plugin. #2755
jurgenvinju wants to merge 7 commits intomainfrom
feat/test-cli

Conversation

@jurgenvinju
Copy link
Copy Markdown
Member

@jurgenvinju jurgenvinju commented Apr 13, 2026

  • This avoids having to write a Java class file with the JUnitTestRunner annotation, even in project that otherwise have no Java code. It also works for projects that do have Java dependencies.
  • This closes the abstraction for Rascal as a language (you don't have to understand anymore that it's an interpreted and/or compiled language or how the test runners have been organized (via JUnit or otherwise).
  • This makes sure that the generic surefire-report XML format is respected for integration with github actions and VScode reporting tools.

To use this add this to your pom.xml and make sure the <srcs> configuration for the rascal-maven-plugin matches what you want to test. You can also add a new <srcs> tag here with a different <configuration> under <execution>:

<execution>
     <id>yourproject-test</id>
     <phase>test</phase>
     <goals>
           <goal>test</goal>
     </goals>
</execution>
  • CLI command to call the test runner with the same parameters as calling the checker or the compiler or the exec runner
  • Optionally log in JUnit testsuite report format for picking up by CLI and CI tools
  • Add test runner statistics for each testsuite/module XML file
  • Documents the Surefire/JUnit test report XML format as a Rascal abstract grammar.

This does not (yet) work for compiled Rascal code, but the exact same interface could be implemented for generated test code (whether or not we use JUnit for that or not).

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 0% with 140 lines in your changes missing coverage. Please review.
✅ Project coverage is 46%. Comparing base (f6d6bbe) to head (8bf3c0a).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...pl/test/infrastructure/JUnitXMLReportListener.java 0% 83 Missing ⚠️
src/org/rascalmpl/shell/RascalTest.java 0% 53 Missing ⚠️
...g/rascalmpl/interpreter/env/GlobalEnvironment.java 0% 3 Missing ⚠️
src/org/rascalmpl/shell/CommandlineParser.java 0% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##              main   #2755    +/-   ##
========================================
- Coverage       46%     46%    -1%     
- Complexity    6725    6733     +8     
========================================
  Files          794     796     +2     
  Lines        65923   66063   +140     
  Branches      9888    9903    +15     
========================================
+ Hits         30837   30851    +14     
- Misses       32696   32826   +130     
+ Partials      2390    2386     -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jurgenvinju jurgenvinju changed the title first versions saved from old branch A cli rascal test runner for use from the maven plugin. Apr 14, 2026
@jurgenvinju jurgenvinju marked this pull request as ready for review April 14, 2026 08:24
@jurgenvinju jurgenvinju self-assigned this Apr 14, 2026
@jurgenvinju jurgenvinju marked this pull request as draft April 14, 2026 10:20
@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant