Files
gerrit/e2e-tests/README
Marco Miller b4510674f9 e2e-tests: Init executable README for local setup testing
Add this README as local supplemental instructions, to quickly validate
one's local development setup. Make this an executable script that way.

As an executable, the README already runs a generally working and safe
set of default commands. It also contains usage instructions, based on
steps gradually leading to locally configuring scripted test runs. Such
commands are expected to run towards a locally running Gerrit test site,
with admin (default) test user credentials provisioned as per README.

Complements the official e2e-tests documentation [1], as well as [1]'s
companion presentations, under [2]'s "End-to-end tests" section. Both
[1] and [2] reciprocally refer to each other. They mention the use of
this directory (now containing this README) already.

[1] https://gerrit-review.googlesource.com/Documentation/dev-e2e-tests.html
[2] https://www.gerritcodereview.com/presentations.html#list-of-presentations

Change-Id: I4cb3574354ee845853c22ce3d4bdb34145020612
2021-01-21 16:50:53 -05:00

54 lines
2.5 KiB
Bash
Executable File

#!/bin/bash
#
# Example usage only-
# 1. Optional: replace test@mail.com below with your own, reachable locally.
# 2. Use the '>>' operator below instead to not overwrite your known_hosts; keep '>' otherwise.
# 3. Note that appending as proposed above may potentially repeat the same line multiple times.
# 4. Init your local Gerrit test site then start it; you may refer to [1] below.
# 5. Set GIT_HTTP_PASSWORD below to yours, from [2].
# 6. Change to this directory to execute ./README (this executable file) in its own terminal.
# 7. Install sbt if missing, based on your operating system; re-run to compile.
# 8. Optional: add the below generated (displayed) key to your local admin user [3].
# 9. Otherwise keep the lines below that use your existing user ssh keys for admin testing.
# 10. This script assumes the google-sourced version of the example json file [4].
# 11. If running that scenario locally as below reports authentication failures, [4] may be a fork.
# 12. Uncomment any one of the below sbt commands at will; you may add some locally.
# 13. See [5] for how to start using JAVA_OPTS below; you may leave it empty for these sbt commands.
# 14. You can initialize an IDE sbt (Scala) project from/in this root folder; see [6].
#
# [1] https://gerrit-review.googlesource.com/Documentation/dev-readme.html#init
# [2] http://localhost:8080/settings/#HTTPCredentials
# [3] http://localhost:8080/settings/#SSHKeys
# [4] ./src/test/resources/data/com/google/gerrit/scenarios/CloneUsingBothProtocols.json
# [5] https://gerrit-review.googlesource.com/Documentation/dev-e2e-tests.html#_environment_properties
# [6] https://gerrit-review.googlesource.com/Documentation/dev-e2e-tests.html#_ide_intellij
# DO NOT change this (assumed) directory; force-removed *recursively* below!
gatlingGitKeys=/tmp/ssh-keys
userSshDir=$HOME/.ssh
# Comment this group of lines out if willing to generate other keys as below.
rm -f $gatlingGitKeys
ln -s "$userSshDir" $gatlingGitKeys
# Comment this group of lines out if keys already generated, as either below or above.
#rm -fr $gatlingGitKeys
#mkdir $gatlingGitKeys
#ssh-keygen -m PEM -t rsa -C "test@mail.com" -f $gatlingGitKeys/id_rsa
ssh-keyscan -t rsa -p 29418 localhost > "$userSshDir"/known_hosts
cat $gatlingGitKeys/id_rsa.pub
export GIT_HTTP_USERNAME="admin"
export GIT_HTTP_PASSWORD="TODO"
export JAVA_OPTS="\
"
#-Dx=y \
#sbt clean
#sbt update
sbt compile
#sbt "gatling:testOnly com.google.gerrit.scenarios.CloneUsingBothProtocols"
#sbt "gatling:lastReport"