Dockerise Gatling tests
Dockerising the tests will help when running them from the CI. Feature: Issue 11908 Change-Id: I15432b2246a2e6eda393fe885931488662d29f3e
This commit is contained in:
parent
5fe54c5365
commit
cf4985ac38
32
e2e-tests/load-tests/Dockerfile
Normal file
32
e2e-tests/load-tests/Dockerfile
Normal file
@ -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"]
|
11
e2e-tests/load-tests/README.md
Normal file
11
e2e-tests/load-tests/README.md
Normal file
@ -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
|
||||
```
|
Loading…
Reference in New Issue
Block a user