A cli rascal test runner for use from the maven plugin. #2755
A cli rascal test runner for use from the maven plugin. #2755jurgenvinju wants to merge 8 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2755 +/- ##
========================================
- Coverage 46% 46% -1%
- Complexity 6723 6727 +4
========================================
Files 839 841 +2
Lines 66766 66906 +140
Branches 9983 9998 +15
========================================
+ Hits 30781 30796 +15
- Misses 33598 33730 +132
+ Partials 2387 2380 -7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
|
I like this feature 👍 I'll try to allocate time for a review next week. |
|
| public Map<String, ISourceLocation> moduleFiles() { | ||
| return moduleLocations.entrySet() | ||
| .stream() | ||
| .collect(Collectors.toMap(e -> e.getKey(), e -> URIUtil.assumeCorrectLocation(e.getValue().toASCIIString()))); |
There was a problem hiding this comment.
side-quest: why are we using URIs in that moduleLocations map?
| for (int i = 0; i < commandline.length; i++) { | ||
| if (List.of("-help", "--help", "/?", "?", "\\?", "-?", "--?").contains(commandline[i].trim())) { | ||
| printMainHelpMessage(kwTypes); | ||
| out.flush(); |
There was a problem hiding this comment.
I think this flush should be moved to the printMainHelpMessage?
| RascalShell.setupJavaProcessForREPL(); | ||
|
|
||
| var term = RascalShell.connectToTerminal(); | ||
| var monitor = IRascalMonitor.buildConsoleMonitor(term); | ||
| var err = (monitor instanceof Writer) ? StreamUtil.generateErrorStream(term, (Writer)monitor) : new PrintWriter(System.err, true); | ||
| var out = (monitor instanceof PrintWriter) ? (PrintWriter) monitor : new PrintWriter(System.out, false); |
There was a problem hiding this comment.
I remember surefire had issues jline capturing the output stream using native hooks. And that is why we had to avoid the progress bar feature inside the test.
If this has been tested on this PR, let's also test it on windows.
Can we add this RascalTest to the test suite we run on integration?
| PathConfig pcfg = pcfgCons != null ? new PathConfig(pcfgCons) : new PathConfig(); | ||
| var projectRoot = pcfg.getProjectRoot().getScheme().equals("unknown") ? URIUtil.rootLocation("cwd") : pcfg.getProjectRoot(); |
There was a problem hiding this comment.
I think we should reuse more code from ShellEvaluatorFactory. Some calculate the path config in a more robust way Like for example based on the cwd as a fallback etc.
| the test runs of your own DSL, such that they can be integrated | ||
| in Github CI run reports and other UX. | ||
| } | ||
| module lang::xml::\surefire-reports::TestSuites |
There was a problem hiding this comment.
this module exists, but then we also have JUnitXMLReportListener.java that is again recreating this structure, can we not reuse rascal for the reporting an constructing of the XML?



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>: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).