Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects

adding resource group.

Merged Diego MENDEZ requested to merge bugfix/ci_job_collision into develop
Compare and Show latest version
3 files
+ 41
31
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 35
24
stages:
- test
workflow:
- if: $CI_PIPELINE_SOURCE == "parent_pipeline"
.test-core: &test-core
stage: test
@@ -9,10 +9,16 @@ stages:
TEST_TAG: test
TEST_HOST: localhost
TEST_PORT: 8000
PROJ_DIR: ${PARENT_PROJECT_DIR}
.manual-run-not-allowed: &manual-run-not-allowed
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: never
- when: on_success
up-test-env-job:
<<: *test-core
<<: *manual-run-not-allowed
before_script:
# check that no other unrelated Netbox is up on destination port.
- if [[ $(curl -f -s http://${TEST_HOST}:${TEST_PORT}/metrics |wc -l) != 0 ]];
@@ -38,49 +44,54 @@ up-test-env-job:
run-test-job:
<<: *test-core
<<: *manual-run-not-allowed
before_script:
- python3 -m venv "${PROJ_DIR}/plugins/venv"
- source "${PROJ_DIR}/plugins/venv/bin/activate"
- pip install -r "${PROJ_DIR}/plugins/netbox-rps-plugin/tests/requirements.e2e.txt"
- pip install -r "${PROJ_DIR}/plugins/netbox-cert-plugin/tests/requirements.e2e.txt"
- pip install -r "${PROJ_DIR}/tests/requirements.e2e.txt"
# - pwd && ls && echo "$CI_PROJECT_DIR--1" && echo "${PARENT_PROJECT_DIR}--2" && echo "$CI_PROJECT_DIR--3"
# && echo "$$PARENT_PROJECT_DIR--4" && echo "$$PROJ_DIR--5" && echo "$$CI_PROJECT_DIR--6"
- python3 -m venv "$CI_PROJECT_DIR/plugins/venv"
- source "$CI_PROJECT_DIR/plugins/venv/bin/activate"
- pip install -r "$CI_PROJECT_DIR/plugins/netbox-rps-plugin/tests/requirements.e2e.txt"
- pip install -r "$CI_PROJECT_DIR/plugins/netbox-cert-plugin/tests/requirements.e2e.txt"
- pip install -r "$CI_PROJECT_DIR/tests/requirements.e2e.txt"
script:
# - env HOST="${TEST_HOST}" PORT="${TEST_PORT}" API_KEY="$API_KEY"
# pytest -s --junit-xml=tests-report-netbox-rps-plugin.xml "${PROJ_DIR}/plugins/netbox-rps-plugin/tests/"
# pytest -s --junit-xml=tests-report-netbox-rps-plugin.xml "$CI_PROJECT_DIR/plugins/netbox-rps-plugin/tests/"
# - env HOST="${TEST_HOST}" PORT="${TEST_PORT}" API_KEY="$API_KEY"
# pytest -s --junit-xml=tests-report-netbox-cert-plugin.xml "${PROJ_DIR}/plugins/netbox-cert-plugin/tests/"
# pytest -s --junit-xml=tests-report-netbox-cert-plugin.xml "$CI_PROJECT_DIR/plugins/netbox-cert-plugin/tests/"
# - env HOST="${TEST_HOST}" PORT="${TEST_PORT}" API_KEY="$API_KEY"
# pytest -s --junit-xml=tests-report-netbox-dist-plugin.xml "${PROJ_DIR}/tests/e2e/"
# pytest -s --junit-xml=tests-report-netbox-dist-plugin.xml "$CI_PROJECT_DIR/tests/e2e/"
- ls
after_script:
- deactivate
- rm -rf "${PROJ_DIR}/plugins/venv"
# artifacts:
# when: always
# reports:
# junit: tests-report-netbox-*-plugin.xml
- rm -rf "$CI_PROJECT_DIR/plugins/venv"
artifacts:
when: always
reports:
junit: tests-report-netbox-*-plugin.xml
needs:
- up-test-env-job
run-robot-test-job:
<<: *test-core
<<: *manual-run-not-allowed
before_script:
- python3 -m venv "${PROJ_DIR}/plugins/venv"
- source "${PROJ_DIR}/plugins/venv/bin/activate"
- python3 -m venv "$CI_PROJECT_DIR/plugins/venv"
- source "$CI_PROJECT_DIR/plugins/venv/bin/activate"
- docker build -t robotframework:latest ./tests/docker/
script:
# - docker run --rm -v ${PROJ_DIR}:/project --network "host" robotframework:latest bash -c
# - docker run --rm -v $CI_PROJECT_DIR:/project --network "host" robotframework:latest bash -c
# "robot -v HOST:"${TEST_HOST}" -v PORT:"${TEST_PORT}" -v API_TOKEN:"$API_KEY" --outputdir /project/reports /project/tests/robot/"
- ls
after_script:
- sudo chmod -R 777 reports
- docker image rm robotframework:latest --force
- deactivate
- rm -rf "${PROJ_DIR}/plugins/venv"
# artifacts:
# when: always
# paths:
# - reports/*
- rm -rf "$CI_PROJECT_DIR/plugins/venv"
artifacts:
when: always
paths:
- reports/*
needs:
- up-test-env-job
- run-test-job
Loading