Exec
Exec Task
Exec tasks are used to run system commands, scripts, etc. The console output from a command can be used to determine if an error occurred. Log files and other files based reports can be saved to the project report for later review and assessment.
Field | Required | Property | Description |
---|---|---|---|
Name | Yes | The name of the task | |
Command | Yes | The system command to run | |
Directory | No | The working directory to run the command from. The default value is ${project.path}, which is defined in the project. | |
Enabled | Yes | Enable/Disable the task | |
On Error | Yes | What to do if an error is detected. | |
Timeout | Yes | Set the task timeout in seconds. A value of zero disables the timeout. |
Error Evaluation
Exec tasks will always report errors when the command returns a non zero return code. But, you can have situations where you will need to report an error based on the output from the command. For those scenarios, use the Error Evaluation section. This allows you to define a list of values that will cause the task to report errors and warnings. The Tokens field will accept a list of comma separated values.
Field | Required | Property | Description |
---|---|---|---|
Stream | Yes | The output stream to evaluate. It's best to use STDANY, which will check both STDOUT and STDERR. The current task execution implementation combines stdout and stderr, so using STDANY will cover all cases. | |
Tokens | Yes | A comma separated list of values to search for. You can also use regular expressions by prefixing the value with regex: | |
Type | Yes | Select whether a match should trigger an Error or Warning. |
Here are a few examples of token lists. String tokens are case sensitive.
One,Two,Three,FOUR regex:One|Two One,Two,regex:F.*R
More information can be found in the regular expression javadoc reference for Java.
File Attachments
Once a task has completed, you have the option to collect files or directories that can be linked to the project report. The section called File Attachments is used for this purpose. When the task completes, any defined attachments are copied to another directory and linked to the final project report. The project report will contain URL links that refer to these attachments. The default installation of JABS will store the these copies under the ROOT webapp. If you go to the Administration page, you'll see the path definitions for attachments. When reports are purged from the system, so are the attachments which are linked to the report. So, the storage overhead to keep these artifacts around is managed.
Field | Required | Property | Description |
---|---|---|---|
Description | Yes | A name describing the attachment | |
File | Yes | A file or directory to save with the report |
In the figure above, the attachment feature is used to pickup JUnit and Clover reports. This allows the recipients of the Email report to view the results.