-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- replace all tests by GitHub actions - fix some tests failing in real fs due to different environment
- Loading branch information
1 parent
12abe91
commit 6646762
Showing
22 changed files
with
145 additions
and
356 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,79 @@ | ||
name: Python package | ||
|
||
on: [push] | ||
|
||
jobs: | ||
linter: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: [3.8] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install linter | ||
run: python -m pip install flake8 | ||
- name: Check syntax and style | ||
run: flake8 . --exclude get-pip.py --max-complexity=13 --statistics | ||
|
||
tests: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macOS-latest, windows-2016] | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
include: | ||
- python-version: pypy3 | ||
os: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install -r extra_requirements.txt | ||
pip install . | ||
- name: Run unit tests with extra packages as non-root user | ||
run: | | ||
python -m pyfakefs.tests.all_tests | ||
- name: Run unit tests without extra packages as non-root user | ||
run: | | ||
export TEST_REAL_FS=1 | ||
python -m pyfakefs.tests.all_tests_without_extra_packages | ||
shell: bash | ||
- name: Run unit tests without extra packages as root | ||
run: | | ||
if [[ '${{ matrix.os }}' != 'windows-2016' ]]; then | ||
# provide the same path as non-root to get the correct virtualenv | ||
sudo env "PATH=$PATH" python -m pyfakefs.tests.all_tests_without_extra_packages | ||
fi | ||
shell: bash | ||
- name: Run pytest tests | ||
run: | | ||
export PY_VERSION=${{ matrix.python-version }} | ||
$GITHUB_WORKSPACE/.github/workflows/run_pytest.sh | ||
shell: bash | ||
|
||
dockertests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
docker-image: [centos, debian, fedora, ubuntu] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup docker container | ||
run: | | ||
docker build -t pyfakefs -f $GITHUB_WORKSPACE/.github/workflows/dockerfiles/Dockerfile_${{ matrix.docker-image }} . --build-arg github_repo=$GITHUB_REPOSITORY --build-arg github_branch=$(basename $GITHUB_REF) | ||
- name: Run tests | ||
run: docker run -t pyfakefs |
9 changes: 4 additions & 5 deletions
9
.travis/run_pytest_plugin_test.sh → .github/workflows/run_pytest.sh
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,8 @@ | ||
#!/bin/bash | ||
|
||
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then | ||
source ~/.venv/bin/activate | ||
python -m pytest pyfakefs/pytest_tests/pytest_plugin_test.py | ||
if [[ $PY_VERSION == '3.6' ]] || [[ $PY_VERSION == '3.7' ]] || [[ $PY_VERSION == '3.8' ]] || [[ $PY_VERSION == '3.9' ]] ; then | ||
python -m pytest pyfakefs/pytest_tests/pytest_fixture_test.py | ||
fi | ||
|
||
python -m pytest pyfakefs/pytest_tests/pytest_plugin_failing_helper.py > ./testresult.txt | ||
python -m pytest pyfakefs/pytest_tests/pytest_check_failed_plugin_test.py && \ | ||
python -m pytest pyfakefs/pytest_tests/pytest_plugin_test.py | ||
python -m pytest pyfakefs/pytest_tests/pytest_check_failed_plugin_test.py |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.