Skip to content
Permalink
Browse files
HOP-2914: update integration testing to be more modular (#845)
* HOP-2914: split compose files and make tests more modular

* HOP-2914: fix containers on jenkins

* HOP-2914: add build args to custom images

* HOP-2914: add args

* HOP-2914: fix variables

* HOP-2914: update docs and enable full build again
  • Loading branch information
hansva committed Jun 2, 2021
1 parent 9f52f1d commit 2c8cfbe9ea94b2e2fc0f7fac32682cbecefa7fc0
Showing 11 changed files with 230 additions and 223 deletions.
@@ -97,15 +97,11 @@ pipeline {
}
stage('Create Docker image & Run Tests'){
steps {
sh "docker-compose -f 'docker/integration-tests/docker-compose-ci.yaml' build --build-arg JENKINS_USER=${jenkins_user} --build-arg JENKINS_UID=${jenkins_uid} --build-arg JENKINS_GROUP=${jenkins_group} --build-arg JENKINS_GID=${jenkins_gid}"
sh "docker-compose -f 'docker/integration-tests/docker-compose-ci.yaml' up -d"
sh "docker wait integration-tests_integration_test_1"
sh "docker logs integration-tests_integration_test_1"
sh "integration-tests/scripts/run-tests-docker.sh JENKINS_USER=${jenkins_user} JENKINS_UID=${jenkins_uid} JENKINS_GROUP=${jenkins_group} JENKINS_GID=${jenkins_gid}"
}
post {
always {
junit(testResults: 'integration-tests/**/surefire-reports/*.xml', allowEmptyResults: true)
sh "docker-compose -f 'docker/integration-tests/docker-compose-ci.yaml' down --rmi all"
}
}
}

This file was deleted.

@@ -30,4 +30,4 @@ services:
- ../../integration-tests/:/files
environment:
- FLASK_ENV=docker
command: [ "bash", "-c", "/files/scripts/run-tests.sh" ]
command: [ "bash", "-c", "/files/scripts/run-tests.sh ${PROJECT_NAME}" ]
@@ -0,0 +1,39 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

version: '3'
services:
integration_test_cassandra:
extends:
file: integration-tests-base.yaml
service: integration_test
depends_on:
cassandra:
condition: service_healthy
links:
- cassandra

cassandra:
image: cassandra:latest
ports:
- "9042"
- "9160"
healthcheck:
test: [ "CMD-SHELL", "[ $$(nodetool statusgossip) = running ]" ]
interval: 10s
timeout: 5s
retries: 50
@@ -0,0 +1,38 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

version: '3'
services:
integration_test_mongo:
extends:
file: integration-tests-base.yaml
service: integration_test
depends_on:
mongo:
condition: service_healthy
links:
- mongo

mongo:
image: mongo:latest
ports:
- "27017"
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo 127.0.0.1:27017/test --quiet
interval: 10s
timeout: 10s
retries: 5
@@ -0,0 +1,41 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

version: '3'
services:
integration_test_neo4j:
extends:
file: integration-tests-base.yaml
service: integration_test
depends_on:
neo4j:
condition: service_healthy
links:
- neo4j

neo4j:
image: neo4j:latest
ports:
- "7474"
- "7687"
environment:
- NEO4J_AUTH=neo4j/abcd
healthcheck:
test: echo 'ok'
interval: 10s
timeout: 10s
retries: 5
@@ -85,19 +85,12 @@ mvn clean install
. Run the Docker Compose script
+
----
docker-compose -f docker/integration-tests/docker-compose-ci.yaml up -d
----
+
. Check the running container
+
----
docker logs integration-tests_integration_test_1
----
+
. Cleanup after run
+
----
docker-compose -f docker/integration-tests/docker-compose-ci.yaml down --rmi all
cd integration-tests/scripts
./run-tests-docker.sh
# Optionally you can run a single project by adding the PROJECT_NAME variable to the script
./run-tests-docker.sh PROJECT_NAME=database
----
+
. Surefire Reports
@@ -108,7 +101,7 @@ We generate xml reports that can be used by Jenkins to generate reports. these r

A script is also provided to run the test without using Docker. This script is also used inside the automated test suite but can be used in a stand alone mode.

This script can be found at following location `incubator-hop/integration-tests/scripts/run-tests.sh`. Be sure to export the needed system variables for the script to find the correct paths to run the tests.
This script can be found at following location `incubator-hop/integration-tests/scripts/run-tests.sh`. Be sure to export the needed system variables for the script to find the correct paths to run the tests. You can aslo run a single project by adding the project name to the command `./run-tests.sh projectname`


== Special checks

This file was deleted.

0 comments on commit 2c8cfbe

Please sign in to comment.