Skip to content

Commit

Permalink
us #983010 : Update "Collection Tool" readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Radislav Berkovich committed Apr 26, 2020
1 parent fb0bac0 commit 1c8b9f8
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 33 deletions.
72 changes: 42 additions & 30 deletions test-result-collection-tool/src/main/assemblies/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ Usage
retrieval
-d,--shared-space <ID> server shared space to push to
-e,--skip-errors skip errors on the server side
-f,--field <TYPE:VALUE> assign field tag to test result
-f,--field <TYPE:VALUE> assign field tag to test result. relevant
for the following fields : Testing_Tool_Type,
Framework, Test_Level, Testing_Tool_Type
-h,--help show this help
-i,--internal supplied XML files are in the API
internal XML format
-m,--milestone <ID> assign milestone to test result
-o,--output-file <FILE> write output to file instead of pushing
it to the server
-o,--output-file <FILE> write output in the API internal XML format to file
instead of pushing it to the server
-p,--password <PASSWORD> server password
--password-file <FILE> location of file with server password
--proxy-host <HOSTNAME> proxy host
Expand All @@ -42,7 +44,8 @@ Usage
-r,--release <ID> assign release to test result
-s,--server <URL:PORT> server URL with protocol and port
--started <TIMESTAMP> start time in milliseconds
--suite <ID> assign suite to test result (relevant for ALM Octane 15.1.3+)
--suite <ID> assign suite to test result
(relevant for ALM Octane 15.1.4+)
--suite-external-run-id <arg> assign name to suite run aggregating test results
-t,--tag <TYPE:VALUE> assign tag to test result
-u,--user <USERNAME> server username
Expand All @@ -59,19 +62,21 @@ This data can be passed as command-line arguments or in a configuration file.
Example configuration file:

# Server URL with protocol and port
server=http://myserver.hpe.com:8080
server=http://myserver.mf.com:8080
# Server sharedspace ID
sharedspace=1001
# Server workspace ID
workspace=1002
# Server username
[email protected]
# Proxy host address
proxyhost=proxy.hpe.com
proxyhost=proxy.mf.com
# Proxy port number
proxyport=8080
# Proxy username
proxyuser=test
# Password
password=W3lcome1

If the configuration file is named 'config.properties' and is in same
directory as this tool, it is automatically detected. Otherwise, pass the
Expand Down Expand Up @@ -107,24 +112,30 @@ Supported test result formats
This tool accepts JUnit test reports. This format is shown in the following example:

<!-- element encapsulating testcases -->
<testsuite>
<!-- testcase contains mandatory attribute 'name' -->
<!-- and optionally 'classname', 'time' -->
<testcase classname="com.examples.example.SampleClass"
name="passedTest" time="0.001"/>
<!-- 'skipped' element is present for skipped tests -->
<testcase name="skippedTest" time="0.002">
<skipped/>
</testcase>
<!-- 'failure' element is present for failed tests -->
<testcase name="failedTest">
<failure/>
</testcase>
<!-- 'error' element is present for tests with error -->
<testcase name="testWithError" time="0.004">
<error/>
</testcase>
</testsuite>
<testsuite>
<!-- testcase contains mandatory attribute 'name' -->
<!-- and optionally 'classname', 'time' -->
<testcase classname="com.examples.example.SampleClass" name="passedTest" time="0.001"/>

<!-- 'skipped' element is present for skipped tests -->
<testcase name="skippedTest" time="0.002">
<skipped/>
</testcase>

<!-- 'failure' element is present for failed tests -->
<testcase name="failedTest">
<failure message="my assertion" type="junit.framework.AssertionFailedError">
my full assertion description
</failure>
</testcase>

<!-- 'error' element is present for tests with error -->
<testcase name="testWithError" time="0.004">
<error message="my error message" type="java.lang.RuntimeException">
my full error description
</error>
</testcase>
</testsuite>

Additional information like release, taxonomy tags, or field tags can
be set as command line arguments for JUnit test reports.
Expand All @@ -145,14 +156,15 @@ User is prompted to enter the password.
-d 1001 -w 1002 JUnit.xml

2. Configuration of the server is specified in a separate configuration
file. Password is entered directly on the command line and tags are assigned to
the test results generated from both JUnit files.
file. Password is entered directly on the command line, test fields and tags are assigned to
the test results generated from two JUnit files.

java -jar test-result-collection-tool.jar -c someConfig.properties -p
"password" -t "OS:Linux" -t "DB:Oracle" JUnitOne.xml JUnitTwo.xml
java -jar test-result-collection-tool.jar -c someConfig.properties -p "password"
-t "OS:Linux" -t "DB:Oracle" -f "Testing_Tool_Type:Testing_Tool_Type"
-f "Test_Level:Integration Test" -f "Test_Type:End to End" -f "Framework:TestNG"
JUnitOne.xml JUnitTwo.xml

3. Server configuration is automatically loaded from the 'config.properties'
file, which is placed in the same directory as this tool. See the format
example above in the "Configuration" section.
file, which is placed in the same directory as this tool. Result file appear in internal XML format (-i option).

java -jar test-result-collection-tool.jar -i publicApi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class CliParser {
private static final String CMD_LINE_SYNTAX = "java -jar test-result-collection-tool.jar [OPTIONS]... FILE [FILE]...\n";
private static final String HEADER = "Micro Focus ALM Octane Test Result Collection Tool";
private static final String FOOTER = "";
private static final String VERSION = "1.0.11.2";//ALM Octane v15.1.3
private static final String VERSION = "1.0.11.3";//ALM Octane v15.1.3

private Options options = new Options();
private LinkedList<String> argsWithSingleOccurrence = new LinkedList<String>();
Expand All @@ -43,7 +43,7 @@ public CliParser() {

options.addOption("i", "internal", false, "supplied XML files are in the API internal XML format");
options.addOption("e", "skip-errors", false, "skip errors on the server side");
options.addOption(Option.builder("o").longOpt("output-file").desc("write output to file instead of pushing it to the server").hasArg().argName("FILE").build());
options.addOption(Option.builder("o").longOpt("output-file").desc("write output in the API internal XML format to file instead of pushing it to the server").hasArg().argName("FILE").build());
options.addOption(Option.builder("c").longOpt("config-file").desc("configuration file location").hasArg().argName("FILE").build());

options.addOption(Option.builder("s").longOpt("server").desc("server URL with protocol and port").hasArg().argName("URL:PORT").build());
Expand All @@ -69,7 +69,7 @@ public CliParser() {
options.addOption(Option.builder().longOpt("check-result-timeout").desc("timeout for test result push status retrieval").hasArg().argName("SEC").type(Number.class).build());

options.addOption(Option.builder("t").longOpt("tag").desc("assign tag to test result").hasArg().argName("TYPE:VALUE").build());
options.addOption(Option.builder("f").longOpt("field").desc("assign field tag to test result").hasArg().argName("TYPE:VALUE").build());
options.addOption(Option.builder("f").longOpt("field").desc("assign field tag to test result, relevant for the following fields : Testing_Tool_Type, Framework, Test_Level, Testing_Tool_Type").hasArg().argName("TYPE:VALUE").build());

options.addOption(Option.builder("r").longOpt("release").desc("assign release to test result").hasArg().argName("ID").type(Number.class).build());
options.addOption(Option.builder("m").longOpt("milestone").desc("assign milestone to test result").hasArg().argName("ID").type(Number.class).build());
Expand Down

0 comments on commit 1c8b9f8

Please sign in to comment.