diff options
Diffstat (limited to '.github/workflows/testsuite.yml')
-rw-r--r-- | .github/workflows/testsuite.yml | 150 |
1 files changed, 150 insertions, 0 deletions
diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml new file mode 100644 index 0000000..51b59b2 --- /dev/null +++ b/.github/workflows/testsuite.yml @@ -0,0 +1,150 @@ +name: Testsuite + +on: + [push, pull_request] + +jobs: + pytype: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: install pytype + run: pip install setuptools pytype pytest scandir pathlib2 pandas xlrd django + - name: Run pytype + run: | + pytype pyfakefs --keep-going --exclude pyfakefs/tests/* --exclude pyfakefs/pytest_tests/* + + tests: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macOS-latest, windows-latest] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12-dev"] + include: + - python-version: "pypy-3.7" + os: ubuntu-latest + - python-version: "pypy-3.9" + os: ubuntu-latest + - python-version: "pypy-3.10" + os: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Get pip cache dir + id: pip-cache + run: | + python -m pip install --upgrade pip + echo "::set-output name=dir::$(pip cache dir)" + + - name: Cache dependencies + id: cache-dep + uses: actions/cache@v3 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ matrix.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/extra_requirements.txt') }} + restore-keys: | + ${{ matrix.os }}-${{ matrix.python-version }}-pip- + + - name: Install dependencies + run: | + pip install setuptools wheel + pip install -r requirements.txt + - name: Run unit tests without extra packages as non-root user + run: | + export TEST_REAL_FS=1 + python -bb -m pyfakefs.tests.all_tests_without_extra_packages + shell: bash + - name: Run setup.py test (uses pytest) + run: | + python setup.py test + shell: bash + - name: Run unit tests without extra packages as root + run: | + if [[ '${{ matrix.os }}' != 'windows-latest' ]]; 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: Install extra dependencies + if: ${{ matrix.python-version != '3.12-dev' }} + run: | + pip install -r extra_requirements.txt + shell: bash + - name: Run unit tests with extra packages as non-root user + if: ${{ matrix.python-version != '3.12-dev' }} + run: | + python -m pyfakefs.tests.all_tests + shell: bash + - name: Run performance tests + run: | + if [[ '${{ matrix.os }}' != 'macOS-latest' ]]; then + export TEST_PERFORMANCE=1 + python -m pyfakefs.tests.performance_test + fi + shell: bash + + pytest-test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macOS-latest, windows-latest] + python-version: ["3.9"] + pytest-version: [3.0.0, 3.5.1, 4.0.2, 4.5.0, 5.0.1, 5.4.3, 6.0.2, 6.2.5, 7.0.1, 7.1.3, 7.2.0, 7.3.1, 7.4.0] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pip install -r requirements.txt + pip install -U pytest==${{ matrix.pytest-version }} + pip install opentimelineio + pip install -e . + if [[ '${{ matrix.pytest-version }}' == '4.0.2' ]]; then + pip install -U attrs==19.1.0 + fi + shell: bash + - name: Run pytest tests + run: | + echo "$(python -m pytest pyfakefs/pytest_tests/pytest_plugin_failing_helper.py)" > ./testresult.txt + python -m pytest pyfakefs/pytest_tests + if [[ '${{ matrix.pytest-version }}' > '3.0.0' ]]; then + cd pyfakefs/pytest_tests/ns_package + python -m pytest --log-cli-level=INFO test + fi + shell: bash + + dependency-check: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + python-version: ["3.10"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pip install -r requirements.txt + pip install -r extra_requirements.txt + pip install pytest-find-dependencies + - name: Check dependencies + run: python -m pytest --find-dependencies pyfakefs/tests + shell: bash |