Closed peterdudfield closed 1 month ago
Hi Peter,
I've taken a look at this. This is the work I've done so far;
I used the same specifications for both of them as set out in the original Run pytest command. Here's the updated workflow snippet:
- name: Run unit tests # ----- ADDED THIS LINE
run: |
pytest tests/unitTest # ----- ADDED THIS LINE
export EUMETSAT_USER_KEY="${{ secrets.EUMETSAT_USER_KEY }}"
export EUMETSAT_USER_SECRET="${{ secrets.EUMETSAT_USER_SECRET }}"
export PYTEST_COMMAND="pytest $PYTESTCOV $PYTESTXDIST -s --log-level=DEBUG tests/unit" # ----- CHANGED THIS LINE
echo "Will be running this command: $PYTEST_COMMAND"
eval $PYTEST_COMMAND
- name: Show coverage
run: coverage report -m
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: false
- name: Run integration tests #------- ADDED THIS LINE
run: |
pytest tests/integrationTest # ------ ADDED THIS LINE
export EUMETSAT_USER_KEY="${{ secrets.EUMETSAT_USER_KEY }}"
export EUMETSAT_USER_SECRET="${{ secrets.EUMETSAT_USER_SECRET }}"
export PYTEST_COMMAND="pytest $PYTESTCOV $PYTESTXDIST -s --log-level=DEBUG tests/integration" # ----- CHANGED THIS LINE
echo "Will be running this command: $PYTEST_COMMAND"
eval $PYTEST_COMMAND
- name: Show coverage
run: coverage report -m
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: false
Next Steps: I'm now at the stage where I need to test the code to ensure everything is running correctly. I'm unsure of how to go about doing that. Do you have any suggestions on how I can proceed or any guidance on testing these changes?
Thanks so much for doing this.
So the unit tests, you should be able to run, but the intergation test will need some secrets.
Do you want to do a PR, and then we can work out if its right?
Detailed Description
There are both intergations tests and unit tests. It would be good to split these up, perhaps into different folders. Then we can always run the unit tests.
Context
Possible Implementation
Split tests into unit and integrations, two different folders.