Various ports of checkers used in Praktomat to Java for easy integration into the Artemis CI-Workflow on Jenkins.
Runs any combination of checkers to produce files readable by the Jenkins plugin which then in turn can send this information to Artemis. The DejagnuLogChecker and SimpleMessageWrapper can be specified multiple times with different testNames each time to allow e.g. to parse public, advanced, and secret tests in a single pass.
The output format is specified in the Jenkins Plugin’s README.
It is represented in this program by CheckerResult.java
.
- DejagnuLogChecker
-
Parses a Dejagnu log file. Always puts the trimmed log file into the message to the student, even for successful tests.
- FileExistsChecker
-
Checks for a list of files that they exist and are not empty. Lists violations in the message to the student.
- LineLengthChecker
-
Checks for all files with a certain extension in a directory that their line length is shorter than the specified maximum. Lists the number of violations per file in the message to the student.
- MainMethodChecker
-
Checks all
*.class
files in the given directory formain
-methods. The test succeeds if a unique main method has been found. The message to the student contains-
if a unique method has been found: the class name.
-
if no
main
-method has been found: an informational message explaining this. -
if multiple
main
-methods have been found: the list of classes withmain
-methods.
-
- SimpleMessageChecker
-
Tries to transform the given parameters directly into a valid
CheckerResult
-file in the format readable by the Jenkins plugin.
java -jar pipeline-helper.jar --help
Usage: -h, --help Show this help message and exit. -o, --output-directory=<outputDirectory> The directory where the results will be placed. Default: customFeedbacks -V, --version Print version information and exit. Commands: dejagnu Parses a Dejagnu log file and converts it into a result. file-exists Checks that the files exist and are not empty. line-length Checks that a set of files only contain lines shorter that a threshold. main-method Searches for Java main methods. message Produces a custom test result message in the required format for Artemis.
Each subcommand accepts the --help
command line option as well to show options specific to that command.
java -jar pipeline-helper.jar dejagnu --help
Usage: pipeline-helper dejagnu [-hV] -l=<logFile> -n=<testName> Parses a Dejagnu log file and converts it into a result. -h, --help Show this help message and exit. -l, --log=<logFile> The log file of the Dejagnu run. -n, --name=<testName> The unique name for the produced result. -V, --version Print version information and exit.
-
mvn package
to produce a runnable jar (pipeline-helper-VERSION-shaded.jar
) with all dependencies included in thetarget/
directory. -
mvn versions:display-dependency-updates versions:display-plugin-updates
to check for updated dependencies.
Licensed under the EUPL, Version 1.2 or – as soon as they will be approved by the European Commission - subsequent versions of the EUPL (the "Licence") You may not use this work except in compliance with the Licence. You may obtain a copy of the Licence at: https://joinup.ec.europa.eu/software/page/eupl