e2e-tests: Add JAVA_OPTS support to the framework Unhardcode hostname and port values to start with, which typically vary across test execution environments or deployments. This allows for less json scenario data file duplication and proliferation. Base this JAVA_OPTS solution on [1] below. If no JAVA_OPTS property|ies gets defined in the scenario execution shell environment, use the well-known default value(s) coded in. Document how to use JAVA_OPTS. Adapt the showcase core CloneUsingBothProtocols and aggregated project scenarios accordingly. Make them reuse core's amended GerritSimulation. [1] https://gatling.io/docs/current/cookbook/passing_parameters Change-Id: I45cf4b7ccf5cc51c8bd31fedbac99ae4bed053bb
diff --git a/Documentation/dev-e2e-tests.txt b/Documentation/dev-e2e-tests.txt index 17334e3..56668c7 100644 --- a/Documentation/dev-e2e-tests.txt +++ b/Documentation/dev-e2e-tests.txt
@@ -105,16 +105,16 @@ file contains the commands and repository used during the e2e test. That file currently looks like below. This scenario serves as a simple example with no actual load in it. It can be used to test or validate the local setup. More complex scenarios can be further developed, under the -`com.google.gerrit.scenarios` package. +`com.google.gerrit.scenarios` package. The uppercase keywords are discussed further below. ---- [ { - "url": "ssh://admin@localhost:29418/loadtest-repo", + "url": "ssh://admin@HOSTNAME:SSH_PORT/loadtest-repo", "cmd": "clone" }, { - "url": "http://localhost:8080/loadtest-repo", + "url": "http://HOSTNAME:HTTP_PORT/loadtest-repo", "cmd": "clone" } ] @@ -141,6 +141,21 @@ Executing the `CloneUsingBothProtocols` scenario, as is, does require setting the http credentials. That is because of the aforementioned create/delete project (http) scenarios composed within it. +=== Environment properties + +The `JAVA_OPTS` environment variable +link:https://gatling.io/docs/current/cookbook/passing_parameters[can optionally be used] to define +non-default values for keys found in scenario `json` data files. That variable can currently be set +with either one or many of these supported properties, from the core framework: + +* `-Dcom.google.gerrit.scenarios.hostname=localhost` +* `-Dcom.google.gerrit.scenarios.ssh_port=29418` +* `-Dcom.google.gerrit.scenarios.http_port=8080` + +Above, the properties can be set with values matching specific deployment topologies under test. +The example values shown above are the currently coded default ones. The framework could support +differing or more properties over time. Plugin (non-core) scenarios may do so just as well. + == How to run tests Run all tests: