Skip to content

Commit 9ec629f

Browse files
authored
Update test_plugin.yml
chore: update paths in test workflow
1 parent 6c8afaf commit 9ec629f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/test_plugin.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ on:
2020
env:
2121
# plugin name/directory where the code for the plugin is stored
2222
PLUGIN_NAME: geovita_processing_plugin
23-
# TESTS_RUN_FUNCTION er ikke lenger nødvendig med pytest
2423
# Docker settings
2524
DOCKER_IMAGE: qgis/qgis
2625

@@ -51,7 +50,9 @@ jobs:
5150
docker exec qgis-testing-environment sh -c "mkdir -p /root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/"
5251
docker exec qgis-testing-environment sh -c "rm -f /root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/$PLUGIN_NAME"
5352
docker exec qgis-testing-environment sh -c "ln -s /tests_directory/$PLUGIN_NAME /root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/$PLUGIN_NAME"
54-
docker exec qgis-testing-environment sh -c "pip3 install --break-system-packages -r /tests_directory/REQUIREMENTS_TESTING.txt"
53+
54+
# ENDRING HER: Lagt til 'coverage' i installasjonen
55+
docker exec qgis-testing-environment sh -c "pip3 install --break-system-packages -r /tests_directory/REQUIREMENTS_TESTING.txt coverage"
5556
5657
docker exec qgis-testing-environment sh -c "ls -l /root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/"
5758
docker exec qgis-testing-environment sh -c "ls -l /root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/$PLUGIN_NAME"
@@ -63,9 +64,8 @@ jobs:
6364
6465
- name: Docker run plugin tests
6566
run: |
66-
# ENDRING HER: Kjører pytest direkte.
67-
# Vi bytter katalog til /tests_directory først, slik at pytest finner testfilene.
68-
docker exec qgis-testing-environment sh -c "cd /tests_directory && xvfb-run pytest"
67+
# ENDRING HER: Setter PYTHONPATH til å inkludere submodule-mappen før pytest kjøres
68+
docker exec qgis-testing-environment sh -c "cd /tests_directory && export PYTHONPATH=$PYTHONPATH:./geovita_processing_plugin/REMEDY_GIS_RiskTool && xvfb-run pytest"
6969
7070
Check-code-quality:
7171
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)