-
Notifications
You must be signed in to change notification settings - Fork 3
TSERV-782 Print Report to Console #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8a3e17c
TSERV-782:Added parameter to print job report to the console
bsubba 0478f13
TSERV-782:Improved readme text
bsubba ca252f7
TSERV-782: Removed unused code
bsubba e7b8862
TSERV-782:Print report for synchronous job
bsubba e9df332
TSERV-782:Print the report directly from response
bsubba 3710ecc
TSERV-782: Improved message;print report for async with the flag
bsubba 52b32ae
TSERV-782:Bumped version
bsubba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ const JSZip = require("jszip"); | |
| const sprintf = require('sprintf-js').sprintf; | ||
| const jobs = require('./jobs_functions'); | ||
| const WebSocket = require('ws'); | ||
| const utility = require('util'); | ||
|
|
||
| module.exports.dispatcher = function (args) { | ||
| if (args.length === 0) { | ||
|
|
@@ -21,13 +22,14 @@ module.exports.dispatcher = function (args) { | |
| let argsWithoutFilename = args.splice(1, args.length - 2); | ||
| let options = util.optionsFromArgs(argsWithoutFilename, [ | ||
| 'testcase', | ||
| '=async', | ||
| 'async', | ||
| '=skipdeps', | ||
| 'priorityJob', | ||
| 'testsuite', | ||
| 'securitytest', | ||
| 'tags', | ||
| 'environment', | ||
| '=printReport', | ||
| 'output', | ||
| 'reportFileName', | ||
| 'format', | ||
|
|
@@ -57,7 +59,7 @@ module.exports.dispatcher = function (args) { | |
| function printModuleHelp() { | ||
| util.error("Usage: testengine run <command>"); | ||
| util.error("Commands: "); | ||
| util.error(" project [testsuite=<name>] [async] [skipdeps] [priorityJob] [testcase=<name>] [securitytest=<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] [priorityJob] [testcase=<name>] [securitytest=<name>] [timeout=<seconds>] [tags=(tag1,tag2)] [output=<directory>] [printReport] [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"); | ||
|
|
@@ -194,6 +196,9 @@ function getQueryStringFromOptions(options) { | |
| case 'priorityJob': | ||
| queryStringPart = key + '=' + encodeURI(options[key]); | ||
| break; | ||
| case 'async': | ||
| queryStringPart = key + '=' + encodeURI(options[key]); | ||
| break; | ||
| default: | ||
| break; | ||
| } | ||
|
|
@@ -370,8 +375,18 @@ function executeProject(filename, project, options) { | |
| if (err === null) { | ||
| status = result.body.status; | ||
| jobId = result.body['testjobId']; | ||
| if (config.verbose || options.async) | ||
| if (config.verbose || options.async) { | ||
| util.output("TestJoB ID: " + jobId); | ||
| } | ||
|
|
||
| if (('printReport' in options) && options.async) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! |
||
| util.output("Report is printed only for synchronous job"); | ||
| } | ||
|
|
||
| if (!options.async && ('printReport' in options)) { | ||
| util.output(utility.inspect(result.body, { showHidden: false, depth: null})); | ||
| } | ||
|
|
||
| } else { | ||
| status = 'ERROR'; | ||
| if ('status' in err) { | ||
|
|
@@ -454,13 +469,14 @@ function executeProject(filename, project, options) { | |
| process.exit(); | ||
| } | ||
| } else { | ||
| if (!('async' in options)) { | ||
| if (!options.async || !('async' in options)) { | ||
| // If status isn't CANCELED, PENDING or DISCONNECTED and we have an output directory, store reports there | ||
| // | ||
| if (!missingFiles) { | ||
| if (config.showProgress) | ||
| util.output(''); | ||
| util.output("Result: " + status); | ||
|
|
||
| if ((jobId !== null) | ||
| && ((status !== 'CANCELED') | ||
| && (status !== 'PENDING') | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.