Getting Help
Tough Day 2 offers a wide range of help options that can be accessed from the command line. For example:
java -jar toughday2.jar --help_full
In the table below, you can find the relevant help parameters.
Global Parameters
Tough Day 2 offers global parameters that set or change the environment for the tests. These include the host that is targeted, the port number, the protocol used, user and password for the instance and many more. For example:
java -jar toughday2.jar --host=host --protocol=https --port=4502 --duration=30m --dryrun=true
You can find the relevant parameters in the list bellow:
Parameter | Description | Default Value | Possible Values |
---|---|---|---|
--installsamplecontent=<Val> | Either installs or skips the default Tough Day 2 content package. | true | true or false |
--protocol=<Val> | The protocol used for the host. | http | http or https |
--host=<Val> | The host name or IP that will be targeted. | ||
--port=<Val> | The port of the host. | 4502 | |
--user=<Val> | The user name for the instance. | admin | |
--password=<Val> | Password for the given user. | admin | |
--duration=<Val> | The duration of the tests. Can be expressed in s econds, m inutes, h ours, and d ays. | 1d | |
--timeout=<Val> | How long a test will run before it will be interrupted and marked as failed. Expressed in seconds. | 180 | |
--suite=<Val> | The value can be one or a list (separated by commas) of predefined test suites. | toughday | |
--configfile=<Val> | The targeted yaml configuration file. | ||
--contextpath=<Val> | Instance’s context path. | ||
--loglevel=<Val> | The log level for the Tough Day 2 engine. | INFO | ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF |
--dryrun=<Val> | If true, prints the resulting configuration and does not run any tests. | false | true or false |
Customizing
Customization can be achieved in two ways: command-line parameters or yaml configuration files. Configuration files are used for large custom suites and they override the Tough Day 2 default parameters. Command-line parameters override both configuration files and the default parameters.
The only way to save a test configuration is to copy it in yaml format.
Adding a New Test
If you do not want to use the default toughday
suite you can add a test of your choosing by using the add
parameter. The examples below show how to add the CreateAssetTreeTest
test either by using command-line parameters or a yaml configuration file.
By using command-line parameters:
java -jar toughday2.jar --host=localhost --add CreateAssetTreeTest
By using a yaml configuration file:
globals:
host : localhost
tests:
- add : CreateAssetTreeTest
Adding Multiple Instances of the Same Test
You can also add and run multiple instances of the same test, but each instance must have a unique name. The examples below show how to add two instances of the same test either by using command-line parameters or a yaml configuration file.
By using command-line parameters:
java -jar toughday2.jar --host=localhost --add CreateAssetTreeTest name=FirstAssetTree --add CreateAssetTreeTest name=SecondAssetTree
By using a yaml configuration file:
globals:
host : localhost
tests:
- add : CreateAssetTreeTest
properties:
name : FirstAssetTree
- add : CreateAssetTreeTest
properties:
name : SecondAssetTree
Changing the Test Properties
In case you need to change one or more of the test properties, you can add that property to the command line or the yaml configuration file. To see all the available test properties add the --help <TestClass/PublisherClass>
parameter to the command line, for example:
java -jar toughday2.jar --help CreatePageTreeTest
Keep in mind that yaml configuration files will overwrite the Tough Day 2 default parameters and command-line parameters will override both the configuration files and the defaults.
The examples below show how to change the template
property for the CreatePageTreeTest
test either by using either command-line parameters or a yaml configuration file.
By using command-line parameters:
java -jar toughday2.jar --host=localhost --add CreatePageTreeTest template=/conf/toughday-templates/settings/wcm/templates/toughday-template
By using a yaml configuration file:
globals:
host : localhost
tests:
- add : CreatePageTreeTest
properties:
template : /conf/toughday-templates/settings/wcm/templates/toughday-template
Working with Predefined Test Suites
The examples below show how to add a test to a predefined suite and how to reconfigure and exclude an existing test from a predefined suite.
You can add a new test to a predefined suite using the add
parameter and specifying the targeted predefined suite.
By using command-line parameters:
java -jar toughday2.jar --host=localhost --suite=toughday --add CreatePageTreeTest
By using a yaml configuration file:
globals:
host : localhost
suite : toughday
tests:
- add : CreatePageTreeTest
Existing tests in a given suite can also be reconfigured using the config
* *parameter. Also specify the suite name and the actual name of the test (not the Test Class name). You can find the test name in the name
property of the Test Class. For further details on how to find test properties, read the Changing Test Properties section.
In the example below the default asset title for the CreatePageTreeTest
(named UploadAsset
) is changed to “NewAsset”.
By using command-line parameters:
java -jar toughday2.jar --host=localhost --suite=toughday --config UploadAsset title=NewAsset
By using a yaml configuration file:
globals:
host : localhost
suite : toughday
tests:
- config : UploadAsset
properties :
title : NewAsset
Also, you can also remove tests from predefined suites or publishers from the default configuration with the use of the exclude
parameter. Also specify the suite name and the actual name of the test (not the Test C lass
name). You can find the test name in the name
property of the test class. In the example below, the CreatePageTreeTest
(named UploadAsset
) test is removed from the toughday suite.
By using command-line parameters:
java -jar toughday2.jar --host=localhost --suite=toughday --exclude UploadAsset
By using a yaml configuration file:
globals:
host : localhost
suite : toughday
tests:
- exclude : UploadAsset
Run Modes
Tough Day 2 can run in one of the following modes: normal and constant load.
The normal run mode has two parameters:
-
concurrency
- concurrency represents the number of threads that Tough Day 2 will create for test execution. On these threads, tests will be executed until either the duration has run out or there are no more tests to execute. -
waittime
- the wait time between two consecutive test executions on the same thread. The value must be expressed in milliseconds.
The example below shows how to add the parameters by using either the command line:
java -jar toughday2.jar --host=localhost --add CreateAssetTreeTest --runmode=normal concurrency=20
or by using a yaml configuration file:
runmode:
type : normal
waittime : 300
concurrency : 200
The constant load run mode differs from the normal run mode by generating a constant number of started test executions, rather than a constant number of threads. You can set the load by using the run mode parameter with the same name.
Test Selection
The test selection process is the same for both run modes and it goes as follows: all tests have a weight
property, which determines the likelihood of execution in a thread. For example, if you have two tests, one with a weight of 5 and the other with a weight of 10, the latter is two times more likely to be executed than the former.
Furthermore, tests can have a count
property, which limits the number of executions to a given number. After this number is passed, no further executions of the test will occur. All test instances that are already running will finish the run as configured. The following example shows how to add these parameters either at the command line or by using a yaml configuration file.
java -jar toughday2.jar --host=localhost --add CreateAssetTreeTest weight=5 --add CreatePageTreeTest weight=10 count=100 --runmode=normal concurrency=20
or
- add : CreateAssetTreeTest
properties :
name : UploadAsset
weight : 5
base : 3
foldertitle : IAmAFolder
assettitle : IAmAnAsset
count : 100
count
parameter. Expect a deviation proportional to the number of running threads (controlled by the concurrency parameter
).Dry Run
A dry run parses all the given input (command-line parameters or config files), merging it with the defaults and then outputs the results. It does not execute any of the tests.
java -jar toughday2.jar --host=localhost --suite=toughday --add CreatePageTreeTest --dryrun=true
Output
Tough Day 2 outputs both test metrics and logs. For further details, read the following sections.
Test Metrics
Tough Day 2 currently reports nine test metrics that you can evaluate. Metrics with the * symbol are reported only after successful runs:
Name | Description |
---|---|
Timestamp | Timestamp of the last finished test run. |
Passed | Number of successful runs. |
Failed | Number of failed runs. |
Min* | Lowest duration of test execution. |
Max* | Highest duration of test execution. |
Median* | Computed median duration of all test executions. |
Average* | Computed average duration of all test executions. |
StdDev* | The standard deviation. |
90p* | 90 percentile. |
99p* | 99 percentile. |
99.9p* | 99.9 percentile. |
Real Throughput* | Number of runs divided by the elapsed execution time. |
These metrics are written with the help of publishers that can be added with the add
parameter (similarly to adding tests). Currently, there are two options:
- CSVPublisher - the output is a CSV file.
- ConsolePublisher - the output is displayed in the console.
By default, both publishers are enabled.
Also, there are two modes in which the metrics are reported:
- The simple publish mode - reports the results from the beginning of the execution up to the point of publishing.
- The intervals publish mode - reports the results in a given time frame. You can set the time frame with the interval publish mode parameter.
The following example shows how to configure the intervals
parameter either at the command line or by using a yaml configuration file.
By using command-line parameters:
java -jar toughday2.jar --host=localhost --add CreatePageTreeTest --publishmode type=intervals interval=10s
By using a yaml configuration file:
publishmode:
type : intervals
interval : 10s
tests:
-add : CreatePageTreeTest
Logging
Tough Day 2 creates a logs folder in the same directory where you ran Tough Day 2. This folder contains two types of logs:
- toughday.log: contains messages related to the application state, debugging information and global messages.
- toughday_<testname>.log: messages related to the specified test.
The logs are not overwritten, subsequent runs append messages to the existing logs. The logs have several levels, for more information see the loglevel parameter..
Experience Manager
The True Cost of a Failed Implementation
A failed implementation isn’t just an inconvenience — it costs real revenue. Poor execution and misaligned tools disrupt pipelines,...
Wed, Mar 19, 2:00 PM PDT (9:00 PM UTC)
How EY Enhanced Regulatory Knowledge Management with Adobe Solutions
Delve into how EY leverages Adobe solutions to enhance regulatory knowledge management. EY leverages search analytics and personalization...
Wed, Mar 19, 4:00 PM PDT (11:00 PM UTC)
Connect with Experience League at Summit!
Get front-row access to top sessions, hands-on activities, and networking—wherever you are!
Learn more