diff --git a/e2e-tests/load-tests/Dockerfile b/e2e-tests/load-tests/Dockerfile new file mode 100644 index 0000000000..ceae67212e --- /dev/null +++ b/e2e-tests/load-tests/Dockerfile @@ -0,0 +1,32 @@ +FROM denvazh/gatling:3.2.1 + +ARG gatling_git_version=1.0.9 +RUN apk add --no-cache maven +RUN mvn dependency:get \ + -DgroupId=com.gerritforge \ + -DartifactId=gatling-git_2.12 \ + -Dversion=$gatling_git_version \ + -Dtype=pom +RUN mvn dependency:copy-dependencies \ + -f /root/.m2/repository/com/gerritforge/gatling-git_2.12/$gatling_git_version/gatling-git_2.12-$gatling_git_version.pom \ + -DoutputDirectory=/opt/gatling/lib/ +RUN mvn dependency:get \ + -Dartifact=com.gerritforge:gatling-git_2.12:$gatling_git_version:jar \ + -Ddest=/opt/gatling/lib/gatling-git.jar + +ARG gatling_home=/home/gatling +RUN addgroup -g 1000 -S appgroup && \ + adduser -u 1000 -S gatling -G appgroup -h $gatling_home +RUN cp -R /opt/gatling/* $gatling_home && \ + chown -R gatling:appgroup $gatling_home + +WORKDIR $gatling_home +USER gatling + +COPY ./src/test/scala/com/google/gerrit/scenarios $gatling_home/user-files/simulations +COPY ./src/test/resources/application.conf $gatling_home/conf +COPY ./src/test/resources/data $gatling_home/user-files/resources/data + +ENV GATLING_HOME=$gatling_home + +ENTRYPOINT ["/home/gatling/bin/gatling.sh"] diff --git a/e2e-tests/load-tests/README.md b/e2e-tests/load-tests/README.md new file mode 100644 index 0000000000..534fde5347 --- /dev/null +++ b/e2e-tests/load-tests/README.md @@ -0,0 +1,11 @@ +# How to build the Docker image + +```$shell +docker build . -t e2e-tests +``` + +# How to run a test + +```$shell +docker run -it e2e-tests -s com.google.gerrit.scenarios.ReplayRecordsFromFeederScenario +```