Commit 0d23aa46 authored by Evgeny Kusmenko's avatar Evgeny Kusmenko

Merge branch 'e/e-infrastructure' into 'master'

E/e infrastructure

See merge request !30
parents 97e291d9 40bcc6ae
Pipeline #191560 failed with stages
in 9 minutes and 41 seconds
......@@ -74,6 +74,7 @@ branchJobLinux:
- cd docker
- ./build.sh
- ./run_test.sh
- ./run_integration_test.sh
except:
- master
......@@ -95,6 +96,7 @@ masterJobLinux:
- cd docker
- ./build.sh
- ./run_test.sh
- ./run_integration_test.sh
- docker tag rpc-server:latest $CI_REGISTRY_IMAGE:rpc
- docker tag restful-server:latest $CI_REGISTRY_IMAGE:restful
- docker push $CI_REGISTRY_IMAGE:rpc
......
#!/usr/bin/env bash
#
# (c) https://github.com/MontiCore/monticore
#
# The license generally applicable for this project
# can be found under https://github.com/MontiCore/monticore.
#
# this script serves the purpose of running integration test in gitlab-runner.
# It starts all dependent services needed before starting the tests.
# Including:
# - a remote simulator at rpc-server:6000
# - an autopilot at autopilot:10101
# - a zookeeper server at zookeeper:2181
dockerCleanUp(){
docker kill zookeeper
docker rm zookeeper
docker kill autopilot
docker rm autopilot
docker kill rpc-server
docker rm rpc-server
docker network rm $(docker network ls | grep "simulation-network" |awk '/ / { print $1 }')
}
dockerCleanUp
CURR_DIR=$(pwd)
SIMULATOR_DIR="${CURR_DIR}/../rpc"
# create network
docker network create simulation-network
# start zookeeper
docker run \
--network="simulation-network" \
-d \
--name=zookeeper \
-e "ZOO_MAX_CLIENT_CNXNS=1024" \
zookeeper:3.4
# start autopilot server(RMIServer)
docker run \
--network="simulation-network" \
--name=autopilot \
-d \
-e "ZOO_SERVERS=zookeeper" \
registry.git.rwth-aachen.de/monticore/embeddedmontiarc/simulators/rmimodelserver:latest \
bash -c "source ~/.bashrc &&
java -Djava.rmi.server.useLocalHostname -jar rmi-model-server.jar \
port=10101 autopilots_folder=autopilots default_config no_time os=windows"
docker run \
--network="simulation-network" \
-d \
-e "ZOO_SERVERS=zookeeper" \
--name=rpc-server \
rpc-server:latest
cd ${CURR_DIR}
#docker build -t server-test-runner -f ./docker/TestDockerfile .
docker run \
--rm --network="simulation-network" \
-e "ZOO_SERVERS=zookeeper" \
montisim-server-builder sh -c "cd restful && mvn test -Dtest=IntegrationTest -s ../settings.xml" \
2>&1 | tee result.txt
dockerCleanUp
tail -10 result.txt | grep "BUILD SUCCESS"
# code=0 if "BUILD SUCCESS" is found in the end of result.txt
code=$?
echo $code
exit $code
......@@ -10,8 +10,6 @@
# this script serves the purpose of running unitetests in gitlab-runner.
# It starts all dependent services needed before starting the tests.
# Including:
# - a remote simulator at localhost:6000
# - an autopilot at localhost:10101
# - a zookeeper server at localhost:2181
dockerCleanUp(){
......@@ -28,12 +26,6 @@ dockerCleanUp(){
dockerCleanUp
CURR_DIR=$(pwd)
SIMULATOR_DIR="${CURR_DIR}/../rpc"
# prepare docker image for rpc-server
#cd $SIMULATOR_DIR
# mvn clean install -s ../settings.xml -DskipTests
#../restful/build.sh
# create network
docker network create simulation-network
......@@ -46,37 +38,18 @@ docker run \
-e "ZOO_MAX_CLIENT_CNXNS=1024" \
zookeeper:3.4
# start autopilot server(RMIServer)
docker run \
--network="simulation-network" \
--name=autopilot \
-d \
-e "ZOO_SERVERS=zookeeper" \
registry.git.rwth-aachen.de/monticore/embeddedmontiarc/simulators/rmimodelserver:latest \
bash -c "source ~/.bashrc &&
java -Djava.rmi.server.useLocalHostname -jar rmi-model-server.jar \
port=10101 autopilots_folder=autopilots default_config no_time os=windows"
docker run \
--network="simulation-network" \
-d \
-e "ZOO_SERVERS=zookeeper" \
--name=rpc-server \
rpc-server:latest
cd ${CURR_DIR}
#docker build -t server-test-runner -f ./docker/TestDockerfile .
docker run \
--rm --network="simulation-network" \
-e "ZOO_SERVERS=zookeeper" \
montisim-server-builder sh -c "cd restful && mvn test -s ../settings.xml" \
2>&1 | tee result.txt
montisim-server-builder sh -c "cd restful && mvn test -Dtest=\!IntegrationTest* -s ../settings.xml" \
2>&1 | tee unittest.txt
dockerCleanUp
tail -10 result.txt | grep "BUILD SUCCESS"
tail -10 unittest.txt | grep "BUILD SUCCESS"
# code=0 if "BUILD SUCCESS" is found in the end of result.txt
code=$?
echo $code
......
......@@ -17,7 +17,7 @@
<properties>
<revision>2.2.1</revision>
<revision>2.2.3</revision>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
......
......@@ -25,7 +25,7 @@
</parent>
<properties>
<revision>2.2.2</revision>
<revision>2.2.3</revision>
<montisim.commons.version>1.0.11</montisim.commons.version>
<montisim.simulation.version>2.0.4</montisim.simulation.version>
<montisim.controller.version>1.0.4</montisim.controller.version>
......@@ -287,15 +287,6 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<runOrder>reversealphabetical</runOrder>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
......
......@@ -17,7 +17,7 @@
<version>${revision}</version>
<properties>
<revision>2.2.2</revision>
<revision>2.2.3</revision>
<montisim.commons.version>1.0.11</montisim.commons.version>
<montisim.simulation.version>2.0.4</montisim.simulation.version>
<montisim.controller.version>1.0.4</montisim.controller.version>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment