-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2142 from certtools/python-3.10
TST: also test on python 3.10, switch to pytest
- Loading branch information
Showing
10 changed files
with
34 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#Github Workflow to run nosetest tests | ||
#Github Workflow to run unit tests with pytest | ||
# | ||
#SPDX-FileCopyrightText: 2020 IntelMQ Team <[email protected]> | ||
#SPDX-FileCopyrightText: 2020 IntelMQ Team <[email protected]>, 2022 Sebastian Wagner <[email protected]> | ||
#SPDX-License-Identifier: AGPL-3.0-or-later | ||
# | ||
name: "Nosetest test suite" | ||
name: "Unit tests" | ||
on: | ||
push: | ||
branches: [develop, maintenance, master] | ||
|
@@ -15,13 +15,13 @@ on: | |
- '.github/**' | ||
|
||
jobs: | ||
nosetest: | ||
unittests: | ||
runs-on: ubuntu-latest | ||
name: Run nosetest test suite | ||
name: Run unit tests with pytest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.6', '3.7', '3.8', '3.9'] | ||
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] | ||
type: ['full', 'basic'] | ||
|
||
services: | ||
|
@@ -65,20 +65,22 @@ jobs: | |
run: bash .github/workflows/scripts/setup-full.sh | ||
|
||
- name: Install test dependencies | ||
run: pip install nose Cerberus requests_mock coverage codecov | ||
run: pip install pytest-cov Cerberus requests_mock coverage | ||
|
||
- name: Install dependencies | ||
if: ${{ matrix.type == 'basic' }} | ||
run: pip install -e . | ||
|
||
- name: Run basic testsuite | ||
if: ${{ matrix.type == 'basic' }} | ||
run: nosetests --with-coverage --cover-package=intelmq --cover-branches | ||
run: pytest --cov intelmq/ --cov-report=xml --cov-branch intelmq/ | ||
|
||
- name: Run full testsuite | ||
if: ${{ matrix.type == 'full' }} | ||
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 {} \+ | ||
run: TZ=utc INTELMQ_TEST_DATABASES=1 INTELMQ_TEST_EXOTIC=1 pytest --cov intelmq/ --cov-report=xml --cov-branch intelmq/ contrib/ | ||
|
||
- name: Run codecov | ||
if: ${{ matrix.type == 'full' }} | ||
run: codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
fail_ci_if_error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# SPDX-FileCopyrightText: 2022 Sebastian Wagner <[email protected]> | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
[pytest] | ||
# disable warning capture by pytest, so that logging can capture them | ||
# https://docs.pytest.org/en/6.2.x/warnings.html#disabling-warning-capture-entirely | ||
addopts: --cov intelmq/ --cov-report=xml --cov-branch -p no:warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters