|
1 | | -#Github Workflow to run nosetest tests |
| 1 | +#Github Workflow to run unit tests with pytest |
2 | 2 | # |
3 | | -#SPDX-FileCopyrightText: 2020 IntelMQ Team <[email protected]> |
| 3 | +#SPDX-FileCopyrightText: 2020 IntelMQ Team <[email protected]>, 2022 Sebastian Wagner <[email protected]> |
4 | 4 | #SPDX-License-Identifier: AGPL-3.0-or-later |
5 | 5 | # |
6 | | -name: "Nosetest test suite" |
| 6 | +name: "Unit tests" |
7 | 7 | on: |
8 | 8 | push: |
9 | 9 | branches: [develop, maintenance, master] |
|
15 | 15 | - '.github/**' |
16 | 16 |
|
17 | 17 | jobs: |
18 | | - nosetest: |
| 18 | + unittests: |
19 | 19 | runs-on: ubuntu-latest |
20 | | - name: Run nosetest test suite |
| 20 | + name: Run unit tests with pytest |
21 | 21 | strategy: |
22 | 22 | fail-fast: false |
23 | 23 | matrix: |
24 | | - python-version: ['3.6', '3.7', '3.8', '3.9'] |
| 24 | + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] |
25 | 25 | type: ['full', 'basic'] |
26 | 26 |
|
27 | 27 | services: |
@@ -65,20 +65,22 @@ jobs: |
65 | 65 | run: bash .github/workflows/scripts/setup-full.sh |
66 | 66 |
|
67 | 67 | - name: Install test dependencies |
68 | | - run: pip install nose Cerberus requests_mock coverage codecov |
| 68 | + run: pip install pytest-cov Cerberus requests_mock coverage |
69 | 69 |
|
70 | 70 | - name: Install dependencies |
71 | 71 | if: ${{ matrix.type == 'basic' }} |
72 | 72 | run: pip install -e . |
73 | 73 |
|
74 | 74 | - name: Run basic testsuite |
75 | 75 | if: ${{ matrix.type == 'basic' }} |
76 | | - run: nosetests --with-coverage --cover-package=intelmq --cover-branches |
| 76 | + run: pytest --cov intelmq/ --cov-report=xml --cov-branch intelmq/ |
77 | 77 |
|
78 | 78 | - name: Run full testsuite |
79 | 79 | if: ${{ matrix.type == 'full' }} |
80 | | - run: TZ=utc INTELMQ_TEST_DATABASES=1 INTELMQ_TEST_EXOTIC=1 nosetests --with-coverage --cover-package=intelmq --cover-branches; find contrib/ -name "test*.py" -exec nosetests {} \+ |
| 80 | + run: TZ=utc INTELMQ_TEST_DATABASES=1 INTELMQ_TEST_EXOTIC=1 pytest --cov intelmq/ --cov-report=xml --cov-branch intelmq/ contrib/ |
81 | 81 |
|
82 | 82 | - name: Run codecov |
83 | 83 | if: ${{ matrix.type == 'full' }} |
84 | | - run: codecov |
| 84 | + uses: codecov/codecov-action@v2 |
| 85 | + with: |
| 86 | + fail_ci_if_error: true |
0 commit comments