Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ table includes the currently implemented options.
| skipdeps | N/A | Do not scan project for dependencies. This will improve performance for large projects without dependences to external files |
| testsuite | TestSuite1 | Name of a test suite to run|
| testcase | JRA-11224 | Name of a specific test case to run. Typically used together with **testsuite** because a project can have several test cases with the same name in different test suites.|
| securitytest | SecurityTest1 | Name of a security test to run. Can not be used with **testsuite** or **testcase**.
| tags | smoketest | Comma separated list of tags. For a test case to be run, it should have all the listed tags. When specifying many tags, or using tags with space in the name, it is possible to surround them with either (), [] or "" but be aware that different operating systems can have special meanings for brackets which requires quoting. Tags cannot be used together with testsuite/testcase specification.|
| tags | "smoketest,regression" | See description above|
| output | c:\\temp\\reports | Directory to store reports in.|
| reportFileName | File name for the report. If omitted, the report will get a name based on the test job ID|
| reportFileName | N/A | File name for the report. If omitted, the report will get a name based on the test job ID|
| format | excel | Specify the file type of the report. Currently supported formats are json, junit, excel and pdf. The default format is junit|
| proxyHost | 172.0.1.10 | Hostname or IP of the server to use as a proxy for outgoing requests (from TestEngine)|
| proxyPort | 8888 | Port of the proxyHost to contact for outgoing requests (from TestEngine)|
Expand Down Expand Up @@ -123,7 +124,7 @@ The "output" argument is mandatory, "format" is optional.
| Option | Sample Value | Description|
|---|---|---|
| output | c:\\temp\\reports | Directory to store reports in.|
| reportFileName | File name for the report. If omitted, the report will get a name based on the test job ID|
| reportFileName | N/A | File name for the report. If omitted, the report will get a name based on the test job ID|
| format | excel | Specify the file type of the report. Currently supported formats are json, junit, excel and pdf. The default format is junit|

### Clean up old jobs from the server database
Expand Down
14 changes: 9 additions & 5 deletions bin/jobs_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,9 @@ function dumpArrayAsJson(jsonData) {

function csvLine(data, header = false) {
if (header) {
return '"Status", "Project", "User", "Submitted", "Submitted Millis", "Time in Queue (ms)", "Run time (ms)", "Test Suite", "Test Case", "Tags", "Job Id"';
return '"Status", "Project", "User", "Submitted", "Submitted Millis", "Time in Queue (ms)", "Run time (ms)", "Test Suite", "Test Case", "Security Test", "Tags", "Job Id"';
} else {
return sprintf('"%s", "%s", "%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s"',
return sprintf('"%s", "%s", "%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s"',
util.csvQuoteQuotes(data.status),
util.csvQuoteQuotes(data.projectName),
util.csvQuoteQuotes(data.userName),
Expand All @@ -342,6 +342,8 @@ function csvLine(data, header = false) {
util.csvQuoteQuotes(data.executionParameters['testSuiteName']) : '',
'testCaseName' in data.executionParameters ?
util.csvQuoteQuotes(data.executionParameters['testCaseName']) : '',
'securityTestName' in data.executionParameters ?
util.csvQuoteQuotes(data.executionParameters['securityTestName']) : '',
'tags' in data.executionParameters ?
util.csvQuoteQuotes(data.executionParameters['tags'].join(', ')) : '',
util.csvQuoteQuotes(data.testjobId),
Expand All @@ -351,11 +353,11 @@ function csvLine(data, header = false) {

function textLine(data, header = false) {
if (header) {
return sprintf('%-10s %-20s %-10s %-25s %-13s %-11s %-13s %-30s %-20s %-20s %-20s' +
return sprintf('%-10s %-20s %-10s %-25s %-13s %-11s %-13s %-30s %-20s %-20s %-20s %-20s' +
'\n==========================================================================================================================================================================================================================',
"Status", "Project", "User", "Submitted", "Submitted ms", "Queued (ms)", "Run time (ms)", "Test Suite", "Test Case", "Tags", "Job Id");
"Status", "Project", "User", "Submitted", "Submitted ms", "Queued (ms)", "Run time (ms)", "Test Suite", "Test Case", "Security Test", "Tags", "Job Id");
} else {
return sprintf('%-10s %-20s %-10s %-25s %13d %11d %13d %-30s %-20s %-20s %-20s',
return sprintf('%-10s %-20s %-10s %-25s %13d %11d %13d %-30s %-20s %-20s %-20s %-20s',
util.csvQuoteQuotes(data.status),
util.csvQuoteQuotes(data.projectName),
util.csvQuoteQuotes(data.userName),
Expand All @@ -367,6 +369,8 @@ function textLine(data, header = false) {
util.csvQuoteQuotes(data.executionParameters['testSuiteName']) : '',
'testCaseName' in data.executionParameters ?
util.csvQuoteQuotes(data.executionParameters['testCaseName']) : '',
'securityTestName' in data.executionParameters ?
util.csvQuoteQuotes(data.executionParameters['securityTestName']) : '',
'tags' in data.executionParameters ?
util.csvQuoteQuotes(data.executionParameters['tags'].join(', ')) : '',
util.csvQuoteQuotes(data.testjobId),
Expand Down
14 changes: 11 additions & 3 deletions bin/run_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports.dispatcher = function (args) {
'=async',
'=skipdeps',
'testsuite',
'securitytest',
'tags',
'environment',
'output',
Expand All @@ -47,24 +48,28 @@ module.exports.dispatcher = function (args) {
printModuleHelp();
break;
default:
util.error("Unknown operatation");
util.error("Unknown operation");
break;
}
};

function printModuleHelp() {
util.error("Usage: testengine run <command>");
util.error("Commands: ");
util.error(" project [testsuite=<name>] [async] [skipdeps] [testcase=<name>] [timeout=<seconds>] [tags=(tag1,tag2)] [output=<directory>] [reportFileName=<filename>] [format=junit/excel/json/pdf] [environment=<environment name>]");
util.error(" project [testsuite=<name>] [async] [skipdeps] [testcase=<name>] [securitytest=<name>] [timeout=<seconds>] [tags=(tag1,tag2)] [output=<directory>] [reportFileName=<filename>] [format=junit/excel/json/pdf] [environment=<environment name>]");
util.error(" [projectPassword=<password>] [proxyHost=<hostname>] [proxyPort=<port>] [proxyUser=<username>]");
util.error(" [proxyPassword=<password>] <filename>");
util.error(" help");
}

function conflictingOptionsCheck(options) {
if (('securitytest' in options) && (('testcase' in options) || ('testsuite' in options))) {
util.error('Error: Parameters testsuite and testcase are not allowed when securitytest is used');
return false;
}
if ('tags' in options) {
if (('testsuite' in options) || ('testcase' in options)) {
util.error('Error: tags are cannot be used together with testcase/testsuite ');
util.error('Error: tags cannot be used together with testcase/testsuite ');
return false;
}
}
Expand Down Expand Up @@ -164,6 +169,9 @@ function getQueryStringFromOptions(options) {
case 'testcase':
queryStringPart = 'testCaseName=' + encodeURI(options[key]);
break;
case 'securitytest':
queryStringPart = 'securityTestName=' + encodeURI(options[key]);
break;
case 'tags': {
let tags = options[key];
let mr = /[("[]?([^)"\]]+)[)"\]]?/.exec(tags);
Expand Down