Skip to content

Commit 55707ea

Browse files
Update docker-compose for integration tests (#198)
* Refactored integration tests to use local docker-compose * Updated configuration in integration tests and travis file
1 parent 30b4c5e commit 55707ea

File tree

6 files changed

+378
-118
lines changed

6 files changed

+378
-118
lines changed

.travis.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jdk:
99
- oraclejdk8
1010

1111
env:
12-
- EI_BACKEND_PORT=8099 MONGODB_PORT=27017 RABBITMQ_AMQP_PORT=5672 RABBITMQ_WEB_PORT=15672 EIFFEL_ER_PORT=8084 JENKINS_PORT=8081 MAIL_SMTP_PORT=1025 MAIL_WEB_PORT=8025
12+
- EI_BACKEND_PORT=8099
1313

1414

1515
# Using default 'test' stage for our tests, and only running deploy stage
@@ -21,23 +21,22 @@ stages:
2121

2222

2323
before_install:
24-
- git clone --depth=50 --branch=master https://github.com/eiffel-community/eiffel-intelligence.git
25-
- cd eiffel-intelligence
26-
- docker-compose up -d
24+
- source src/main/docker/env.bash
25+
- docker-compose -f src/main/docker/docker-compose.yml up -d eiffel-er mongodb rabbitmq jenkins mail-server
2726

2827

2928
install:
29+
- git clone --depth=50 --branch=master https://github.com/eiffel-community/eiffel-intelligence.git
30+
- cd eiffel-intelligence
3031
- chmod +x pom.xml
3132
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
32-
- cd target
33-
- export EIFFEL_WAR=$(ls *.war)
34-
- java -Dspring.config.location=file:../../src/integrationtest/resources/integration-test.properties -Dserver.port=${EI_BACKEND_PORT} -jar ${EIFFEL_WAR} &
35-
- cd ../..
33+
- export EIFFEL_WAR=$(ls target/*.war)
34+
- java -Dspring.config.location=file:../src/integrationtest/resources/integration-test.properties -Dserver.port=${EI_BACKEND_PORT} -jar ${EIFFEL_WAR} &
35+
- cd ..
3636

3737

3838
after_script:
39-
- cd eiffel-intelligence
40-
- docker-compose down
39+
- docker-compose -f src/main/docker/docker-compose.yml down
4140
- fuser -k ${EI_BACKEND_PORT}/tcp
4241

4342

src/integrationtest/resources/integration-test.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build.version=
99
server.port: 8090
1010

1111
# path to files with rules for aggregating objects
12-
rules.path: /ArtifactRules_new.json
12+
rules.path: /ArtifactRules.json
1313

1414
# logging levels can be set with the flag below for the top packages
1515
# deactivated by default because Travis will fail due to log file size.

src/main/docker/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## A: Build Eiffel Intelligence frontend Docker image based on Eiffel Intelligence frontend from an Artifactory, e.g. Jitpack:
2+
cd (git root dir)
3+
docker build -t eiffel-intelligence-frontend --build-arg URL=https://jitpack.io/com/github/eiffel-community/eiffel-intelligence-frontend/1.0.1/eiffel-intelligence-frontend-1.0.1.war -f src/main/docker/Dockerfile .
4+
5+
6+
## B: Build Eiffel Intelligence frontend based on local source code changes
7+
1. Build Eiffel Intelligence frontend artifact:
8+
cd (git root dir)
9+
mvn package -DskipTests
10+
11+
2. Build Eiffel-Intelligence frontend Docker image:
12+
cd (git root dir)/
13+
export EIFFEL_WAR=$(ls target/*.war)
14+
docker build -t eiffel-intelligence-frontend --build-arg URL=./${EIFFEL_WAR} -f src/main/docker/Dockerfile .
15+
16+
17+
## Use docker-compose to set up eco system for testing Eiffel Intelligence
18+
19+
By using the docker-compose file in this directory it is possible to set up a
20+
complete environment to run integration tests and/or system test scenarios
21+
for Eiffel Intelligence. If you want to test with your latest local changes,
22+
change the docker images used for the Eiffel Intelligence services.
23+
24+
To set up the environment for running system tests (from root directory):
25+
26+
source src/main/docker/env.bash
27+
docker-compose -f src/main/docker/docker-compose.yml up -d
28+
29+
30+
Or start up specific services (only ones needed for integration tests) by listing them like so:
31+
32+
docker-compose -f src/main/docker/docker-compose.yml up -d eiffel-er mongodb rabbitmq jenkins mail-server
33+
34+
NOTE: Integration tests does not need a frontend started in a docker container,
35+
since Spring will start up EI instances for each integration test.

src/main/docker/README.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)