Skip to content

Commit f10408a

Browse files
mmerrelllukeis
authored andcommitted
Small overhaul to the command-line parameter documentation (#2383)
Improving several things here: - Consistent labeling of parameter type - Adding units (seconds, milliseconds, etc) to all options where necessary - Listing default values - Improving clarity of messages with consistency of terms, etc and various word usements Fixing indentation in one place
1 parent fc09123 commit f10408a

File tree

4 files changed

+42
-37
lines changed

4 files changed

+42
-37
lines changed

java/server/src/org/openqa/grid/internal/utils/configuration/GridConfiguration.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,32 @@ public class GridConfiguration extends StandaloneConfiguration {
2828

2929
@Parameter(
3030
names = "-cleanUpCycle",
31-
description = "<Integer> in ms. How often a proxy on the hub will check for timed out thread. Must have timeout option specified also"
31+
description = "<Integer> in ms : specifies how often the hub will poll running proxies for timed-out (i.e. hung) threads. Must also specify \"timeout\" option"
3232
)
3333
public Integer cleanUpCycle;
3434

3535
@Parameter(
3636
names = "-custom",
37-
description = "comma separated parameters for custom grid extensions. example: -custom myParamA=Value1,myParamB=Value2",
37+
description = "<String> : NOT RECOMMENDED--may be deprecated to encourage proper servlet customization. Comma separated key=value pairs for custom grid extensions. example: -custom myParamA=Value1,myParamB=Value2",
3838
converter = CustomConverter.class
3939
)
4040
public Map<String, String> custom = new HashMap<>();
4141

4242
@Parameter(
4343
names = "-host",
44-
description = "<IP | hostname> : usually not needed and determined automatically. For exotic network configuration, network with VPN, specifying the host might be necessary."
44+
description = "<String> IP or hostname : usually determined automatically. Most commonly useful in exotic network configurations (e.g. network with VPN)"
4545
)
4646
public String host;
4747

4848
@Parameter(
4949
names = "-maxSession",
50-
description = "<Integer> max number of tests that can run at the same time on the node, independently of the browser used."
50+
description = "<Integer> max number of tests that can run at the same time on the node, irrespective of the browser used"
5151
)
5252
public Integer maxSession = 1;
5353

5454
@Parameter(
5555
names = {"-servlet", "-servlets"},
56-
description = "list of extra servlets this hub will display. Allows to present custom view of the hub for monitoring and management purpose. Specify multiple on the command line: -servlet tld.company.ServletA -servlet tld.company.ServletB. The servlet will accessible under the path /grid/admin/ServletA /grid/admin/ServletB"
56+
description = "<String> : list of extra servlets this hub will display. Allows to present custom view of the hub for monitoring and management purposes. Specify multiple on the command line: -servlet tld.company.ServletA -servlet tld.company.ServletB. The servlet must exist in the path: /grid/admin/ServletA /grid/admin/ServletB"
5757
)
5858
public List<String> servlets;
5959

java/server/src/org/openqa/grid/internal/utils/configuration/GridHubConfiguration.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,39 +38,39 @@ public class GridHubConfiguration extends GridConfiguration {
3838

3939
@Parameter(
4040
names = "-hubConfig",
41-
description = "a JSON file following grid2 format that defines the hub properties."
41+
description = "<String> filename: a JSON file (following grid2 format), which defines the hub properties"
4242
)
4343
public String hubConfig;
4444

4545
@Parameter(
4646
names = "-jettyMaxThreads",
47-
description = "max number of thread for Jetty. Default is normally 255."
47+
description = "<Integer> : max number of thread for Jetty. Default is 255"
4848
)
4949
public Integer jettyMaxThreads;
5050

5151
@Parameter(
5252
names = {"-matcher", "-capabilityMatcher"},
53-
description = "a class implementing the CapabilityMatcher interface. Defaults to org.openqa.grid.internal.utils.DefaultCapabilityMatcher. Specify the logic the hub will follow to define if a request can be assigned to a node.Change this class if you want to have the matching process use regular expression instead of exact match for the version of the browser for instance. All the nodes of a grid instance will use the same capabilityMatcher, defined by the registry.",
53+
description = "<String> class name : a class implementing the CapabilityMatcher interface. Specifies the logic the hub will follow to define whether a request can be assigned to a node. For example, if you want to have the matching process use regular expressions instead of exact match when specifying browser version. ALL nodes of a grid ecosystem would then use the same capabilityMatcher, as defined here. Default is org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
5454
converter = CapabilityMatcherString.class
5555
)
5656
public CapabilityMatcher capabilityMatcher = new DefaultCapabilityMatcher();
5757

5858
@Parameter(
5959
names = "-newSessionWaitTimeout",
60-
description = "<Integer> milliseconds. Default to no timeout ( -1 ) the time in ms after which a new test waiting for a node to become available will time out.When that happens, the test will throw an exception before starting a browser."
60+
description = "<Integer> in ms : The time after which a new test waiting for a node to become available will time out. When that happens, the test will throw an exception before attempting to start a browser. Defaults to no timeout ( -1 )"
6161
)
6262
public Integer newSessionWaitTimeout = -1;
6363

6464
@Parameter(
6565
names = "-prioritizer",
66-
description = "a class implementing the Prioritizer interface. Default to null ( no priority = FIFO ).Specify a custom prioritizer if you want to sort the order new session requests are processed when there is a queue.",
66+
description = "<String> class name : a class implementing the Prioritizer interface. Specify a custom Prioritizer if you want to sort the order in which new session requests are processed when there is a queue. Default to null ( no priority = FIFO )",
6767
converter = PrioritizerString.class
6868
)
6969
public Prioritizer prioritizer = null;
7070

7171
@Parameter(
7272
names = "-throwOnCapabilityNotPresent",
73-
description = "<true | false> default to true. If true, the hub will reject test requests right away if no proxy is currently registered that can host that capability.Set it to false to have the request queued until a node supporting the capability is added to the grid."
73+
description = "<Boolean> true or false : If true, the hub will reject all test requests if no compatible proxy is currently registered. If set to false, the request will queue until a node supporting the capability is registered with the grid. Default is true"
7474
)
7575
public Boolean throwOnCapabilityNotPresent = true;
7676

@@ -103,7 +103,7 @@ public Prioritizer convert(String prioritizerClass) {
103103
try {
104104
return (Prioritizer) Class.forName(prioritizerClass).newInstance();
105105
} catch (Throwable e) {
106-
throw new GridConfigurationException("Error creating the prioritize from class " +
106+
throw new GridConfigurationException("Error creating Prioritizer from class " +
107107
prioritizerClass + " : " + e.getMessage(), e);
108108
}
109109
}
@@ -115,7 +115,7 @@ public CapabilityMatcher convert(String capabilityMatcherClass) {
115115
try {
116116
return (CapabilityMatcher) Class.forName(capabilityMatcherClass).newInstance();
117117
} catch (Throwable e) {
118-
throw new GridConfigurationException("Error creating the prioritize from class " +
118+
throw new GridConfigurationException("Error creating Prioritizer from class " +
119119
capabilityMatcherClass + " : " + e.getMessage(), e);
120120
}
121121
}

java/server/src/org/openqa/grid/internal/utils/configuration/GridNodeConfiguration.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class GridNodeConfiguration extends GridConfiguration {
3030

3131
@Parameter(
3232
names = "-id",
33-
description = "unique identifier for the node, not required and grid will set this to the remoteHost"
33+
description = "<String> : unique identifier for the node. Not required--by default, grid will use the url of the remoteHost"
3434
)
3535
public String id;
3636

@@ -39,74 +39,74 @@ public class GridNodeConfiguration extends GridConfiguration {
3939

4040
@Parameter(
4141
names = "-browser",
42-
description = "comma separated capability values. Example: -browser browserName=firefox,platform=linux -browser browserName=chrome,platform=linux",
42+
description = "<String> : comma separated Capability values. Example: -browser browserName=firefox,platform=linux -browser browserName=chrome,platform=linux",
4343
converter = DesiredCapabilityConverter.class
4444
)
4545
public List<DesiredCapabilities> browser;
4646

4747
@Parameter(
4848
names = "-downPollingLimit",
49-
description = "<Integer> node is marked as down after downPollingLimit alive checks."
49+
description = "<Integer> : node is marked as \"down\" if the node hasn't responded after the number of checks specified in [downPollingLimit]. Default is 2"
5050
)
5151
public Integer downPollingLimit;
5252

5353
@Parameter(
5454
names = "-hub",
55-
description = "<http://localhost:4444/grid/register> : the url that will be used to post the registration request. This option takes precedence over -hubHost and -hubPort options."
55+
description = "<String> (e.g. http://localhost:4444/grid/register) : the url that will be used to post the registration request. This option takes precedence over -hubHost and -hubPort options"
5656
)
5757
public String hub;
5858

5959
@Parameter(
6060
names = "-hubHost",
61-
description = "<IP | hostname> : the host address of a hub the registration request should be sent to. Default to localhost. Option -hub takes precedence over this option."
61+
description = "<String> IP or hostname : the host address of the hub we're attempting to register with. If \"role\" is set to [hub], this option will be ignored. Default is localhost"
6262
)
6363
String hubHost;
6464

6565
@Parameter(
6666
names = "-hubPort",
67-
description = "<Integer> : the port listened by a hub the registration request should be sent to. Default to 4444. Option -hub takes precedence over this option."
67+
description = "<Integer> : the port of the hub we're attempting to register with. If \"role\" is set to [hub], this option will be ignored. Default to 4444"
6868
)
6969
Integer hubPort;
7070

7171
@Parameter(
7272
names = "-nodeConfig",
73-
description = "<file> json configuration file for the node, overrides default values."
73+
description = "<String> filename : JSON configuration file for the node. Overrides default values"
7474
)
7575
public String nodeConfigFile;
7676

7777
@Parameter(
7878
names = "-nodePolling",
79-
description = "<Integer> in ms. Interval between alive checks of node how often the hub checks if the node is still alive."
79+
description = "<Integer> in ms : specifies how often the hub will poll to see if the node is still responding"
8080
)
8181
public Integer nodePolling;
8282

8383
@Parameter(
8484
names = "-nodeStatusCheckTimeout",
85-
description = "<Integer> in ms. Connection and socket timeout which is used for node alive check."
85+
description = "<Integer> in ms : connection/socket timeout, used for node \"nodePolling\" check"
8686
)
8787
public Integer nodeStatusCheckTimeout;
8888

8989
@Parameter(
9090
names = "-proxy",
91-
description = "<String> the class that will be used to represent the node. By default org.openqa.grid.selenium.proxy.DefaultRemoteProxy."
91+
description = "<String> : the class used to represent the node proxy. Default is [org.openqa.grid.selenium.proxy.DefaultRemoteProxy]"
9292
)
9393
public String proxy;
9494

9595
@Parameter(
9696
names = "-register",
97-
description = "include this command line option if you want the node to automatically re-register itself with a grid hub if the hub becomes unavailable. Default is disabled."
97+
description = "if specified, node will attempt to re-register itself automatically with its known grid hub if the hub becomes unavailable. Default is disabled"
9898
)
9999
public Boolean register;
100100

101101
@Parameter(
102102
names = "-registerCycle",
103-
description = "<Integer> how often in ms the node will try to register itself again.Allow to restart the hub without having to restart the nodes."
103+
description = "<Integer> in ms : specifies how often the node will try to register itself again. Allows administrator to restart the hub without restarting (or risk orphaning) registered nodes. Must be specified with the \"-register\" option"
104104
)
105105
public Integer registerCycle;
106106

107107
@Parameter(
108108
names = "-unregisterIfStillDownAfter",
109-
description = "<Integer> in ms. If the node remains down for more than unregisterIfStillDownAfter millisec, it will disappear from the hub.Default is 1min."
109+
description = "<Integer> in ms : if the node remains down for more than [unregisterIfStillDownAfter] ms, it will step attempting to re-register from the hub. Default is 6000 (1 minute)"
110110
)
111111
public Integer unregisterIfStillDownAfter;
112112

java/server/src/org/openqa/grid/internal/utils/configuration/StandaloneConfiguration.java

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,58 +29,63 @@ public class StandaloneConfiguration {
2929

3030
@Parameter(
3131
names = "-browserTimeout",
32-
description = "Number of seconds a browser is allowed to hang (0 means indefinite) while a command is running (example: driver.get(url)). If set, must be greater than or equal to 60. When the timeout is reached while a command is processing, the session will quit.")
32+
description = "<Integer> in seconds : number of seconds a browser session is allowed to hang (0 means indefinite) while a WebDriver command is running (example: driver.get(url)). If the timeout is reached while a WebDriver command is still processing, the session will quit. Minimum value is 60. Default is 0"
33+
)
3334
public Integer browserTimeout;
3435

3536
@Parameter(
3637
names = "-debug",
37-
description = "<Boolean> to enable LogLevel.FINE"
38+
description = "<Boolean> : enables LogLevel.FINE. Default is false (if omitted)"
3839
)
3940
public boolean debug;
4041

4142
@Parameter(
4243
names = {"--help", "-help", "-h"},
4344
help = true,
4445
hidden = true,
45-
description = "This help.")
46+
description = "Displays this help"
47+
)
4648
public boolean help;
4749

4850
@Parameter(
4951
names = "-jettyThreads",
50-
hidden = true)
52+
hidden = true
53+
)
5154
public Integer jettyThreads;
5255

5356
@Parameter(
5457
names = "-log",
55-
description = "The filename to use for logging. Default value is null and indicates logging to STDOUT."
58+
description = "<String> filename : the filename to use for logging. If omitted, will log to STDOUT"
5659
)
5760
public String log;
5861

5962
@Parameter(
6063
names = "-logLongForm",
61-
description = "if no log is specified, logLongForm can be set to enable longForm output to STDOUT. Default is false"
64+
description = "<Boolean> : if specified, all log statements (including to log file from \"log\" parameter) will include the Thread ID"
6265
)
6366
public boolean logLongForm;
6467

6568
@Parameter(
6669
names = {"-port"},
67-
description = "The port number the selenium server should use. Default's to 4444. When role is a grid node default is 5555.")
70+
description = "<Integer> : the port number the server will use. Defaults to [4444]. When \"role\" is a set to [node], default is [5555]"
71+
)
6872
public Integer port;
6973

7074
@Parameter(
7175
names = "-role",
72-
description = "server role to run as. Options are hub, node, standalone. Default is standalone"
76+
description = "<String> options are [hub], [node], or [standalone] : Default is [standalone]"
7377
)
74-
public String role;
78+
public String role = "standalone";
7579

7680
@Parameter(
7781
names = {"-timeout", "-sessionTimeout"},
78-
description = "<Integer> the timeout in seconds before the hub automatically ends a test that hasn't had any activity in the last X seconds. The browser will be released for another test to use. This typically takes care of the client crashes. For grid hub/node roles, CleanUpCycle must also be set. Default is 1800 (30 minutes)")
82+
description = "<Integer> in seconds : Specifies the timeout before the hub automatically kills a session that hasn't had any activity in the last X seconds. The test slot will then be released for another test to use. This is typically used to take care of client crashes. For grid hub/node roles, cleanUpCycle must also be set. Default is 1800 (30 minutes)"
83+
)
7984
public Integer timeout = 1800;
8085

8186
@Parameter(
8287
names = {"-avoidProxy"},
83-
description = "DO NOT USE. Hack to allow selenium 3.0 server run in saucelabs"
88+
description = "DO NOT USE. Hack to allow selenium 3.0 server run in SauceLabs"
8489
)
8590
private Boolean avoidProxy;
8691

0 commit comments

Comments
 (0)