diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 457626b0c34f99c5bcac138ac10a412a7defd908..5ef1708a2e3c6907a73f7ed0c20b52ea805c69bb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,9 +23,14 @@ run-test: before_script: - chmod 600 $ANSIBLE_PRIVATE_KEY_FILE - env ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_PRIVATE_KEY_FILE="$ANSIBLE_PRIVATE_KEY_FILE" ansible-playbook -i "$TESTING_HOSTS" -u debian ansible/deploy_on_test.yml - script: echo "testing" + script: + - python3 -m venv "$CI_PROJECT_DIR/plugins/netbox-rps-plugin/venv" + - source "$CI_PROJECT_DIR/plugins/netbox-rps-plugin/venv/bin/activate" + - pip install -r "$CI_PROJECT_DIR/plugins/netbox-rps-plugin/tests/requirements.e2e.txt" + - env HOST="$HOST" PORT="$PORT" API_KEY="$API_KEY" python3 -m unittest discover -b "$CI_PROJECT_DIR/plugins/netbox-rps-plugin/tests/" after_script: - env ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_PRIVATE_KEY_FILE="$ANSIBLE_PRIVATE_KEY_FILE" ansible-playbook -i "$TESTING_HOSTS" -u debian ansible/halt_test.yml + - rm -rf "$CI_PROJECT_DIR/plugins/netbox-rps-plugin/venv" deliver-latest-job: stage: deliver diff --git a/docker-compose.yml b/docker-compose.yml index 80cffc2b09b294fec40f42138878aa4574bba524..53e339c3023128e2e9a6046d0afd4c41df4e6bd3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: - redis-cache user: 'unit:root' healthcheck: - start_period: 180s + start_period: 60s timeout: 3s interval: 15s test: "curl -f http://localhost:8080/api/ || exit 1" diff --git a/tests/docker-compose.test.yml b/tests/docker-compose.test.yml index 38f733d17f231756d91d2aebe40da37cb2a01cc6..bb018c0bb797969b83ab89b51f796b781ac917fd 100644 --- a/tests/docker-compose.test.yml +++ b/tests/docker-compose.test.yml @@ -4,6 +4,8 @@ services: image: "code.europa.eu:4567/digit-c4/netbox-plugins:${TAG}" ports: - 8080:8080 + healthcheck: + start_period: 240s env_file: env/netbox.env netbox-worker: env_file: env/netbox.env