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
+ 38
26
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 28
24
stages:
- test
@@ -10,6 +9,7 @@ stages:
TEST_TAG: test
TEST_HOST: localhost
TEST_PORT: 8000
PROJ_DIR: ${PARENT_PROJECT_DIR}
up-test-env-job:
<<: *test-core
@@ -39,43 +39,48 @@ up-test-env-job:
run-test-job:
<<: *test-core
before_script:
- 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"
- 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"
script:
- env HOST="${TEST_HOST}" PORT="${TEST_PORT}" API_KEY="$API_KEY" 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 "$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 "$CI_PROJECT_DIR/tests/e2e/"
# - 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/"
# - 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/"
# - 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/"
- ls
after_script:
- deactivate
- rm -rf "$CI_PROJECT_DIR/plugins/venv"
artifacts:
when: always
reports:
junit: tests-report-netbox-*-plugin.xml
- rm -rf "${PROJ_DIR}/plugins/venv"
# artifacts:
# when: always
# reports:
# junit: tests-report-netbox-*-plugin.xml
needs:
- up-test-env-job
run-robot-test-job:
<<: *test-core
before_script:
- python3 -m venv "$CI_PROJECT_DIR/plugins/venv"
- source "$CI_PROJECT_DIR/plugins/venv/bin/activate"
- python3 -m venv "${PROJ_DIR}/plugins/venv"
- source "${PROJ_DIR}/plugins/venv/bin/activate"
- docker build -t robotframework:latest ./tests/docker/
script:
- 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/"
# - docker run --rm -v ${PROJ_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 "$CI_PROJECT_DIR/plugins/venv"
artifacts:
when: always
paths:
- reports/*
- rm -rf "${PROJ_DIR}/plugins/venv"
# artifacts:
# when: always
# paths:
# - reports/*
needs:
- up-test-env-job
- run-test-job
@@ -93,4 +98,3 @@ down-test-env-job:
- run-test-job
- run-robot-test-job
when: always
Loading