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

Skip to content
Snippets Groups Projects

Run some tests just if plugin is installed.

Merged Diego MENDEZ requested to merge feature/test_tags into develop
All threads resolved!
5 files
+ 16
2
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 12
0
@@ -42,6 +42,12 @@ run-test-job:
- python3 -m venv "$CI_PROJECT_DIR/plugins/venv"
- source "$CI_PROJECT_DIR/plugins/venv/bin/activate"
- pip install -r "$CI_PROJECT_DIR/tests/requirements.e2e.txt"
# Remove some tests if plugins are not installed, to keep compatibility with Netbox_v4 branches.
- if [[ $(cat requirements.txt | grep -e mac -e cert -e rps | wc -l) == 0 ]];
then
rm -r $CI_PROJECT_DIR/tests/e2e/netbox/{netbox_cert_plugin,netbox_mac_address_plugin,netbox_rps_plugin};
echo "Removed mac's, cert's && rps' tests.";
fi
script:
- 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/"
after_script:
@@ -60,6 +66,12 @@ run-robot-test-job:
- python3 -m venv "$CI_PROJECT_DIR/plugins/venv"
- source "$CI_PROJECT_DIR/plugins/venv/bin/activate"
- docker build -t robotframework:latest ./tests/docker/
# Remove some tests if plugins are not installed, to keep compatibility with Netbox_v4 branches.
- if [[ $(cat requirements.txt | grep -e mac -e cert | wc -l) == 0 ]];
then
rm -r $CI_PROJECT_DIR/tests/robot/netbox_mac_address_plugin;
echo "Removed mac's tests.";
fi
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/"
Loading