diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 251892f1..315556d1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,12 +14,13 @@ jobs: py38: 3.8 py39: 3.9 py310: "3.10" + py311: "3.11" RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false # ensures the entire test matrix is run, even if one permutation fails matrix: - python-version: [ py37, py38, py39, py310 ] + python-version: [ py37, py38, py39, py310, py311 ] package: ["distro"] os: [ ubuntu-20.04, windows-2019 ] steps: @@ -31,7 +32,7 @@ jobs: python-version: ${{ env[matrix.python-version] }} architecture: 'x64' - name: Install tox - run: pip install -U tox-factor + run: pip install tox==3.27.1 -U tox-factor - name: Cache tox environment # Preserves .tox directory between runs for faster installs uses: actions/cache@v2 @@ -40,6 +41,11 @@ jobs: .tox ~/.cache/pip key: v3-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'test-requirements.txt') }} + - name: Windows does not let git check out files with long names + if: ${{ matrix.os == 'windows-2019'}} + run: git config --system core.longpaths true + - name: run tox + run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} misc: strategy: fail-fast: false @@ -53,7 +59,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: 3.11 architecture: 'x64' - name: Install tox run: pip install -U tox diff --git a/test-requirements.txt b/test-requirements.txt index 9d908300..a6c7e573 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,5 @@ pytest psycopg2 flask +django requests \ No newline at end of file diff --git a/tox.ini b/tox.ini index 8e2f8937..0aad9c15 100644 --- a/tox.ini +++ b/tox.ini @@ -2,21 +2,25 @@ skipsdist = True skip_missing_interpreters = True envlist = - py3{6,7,8,9,10,11}-distro + py3{7,8,9,10,11}-distro lint [testenv] deps = -r test-requirements.txt +changedir = + distro: azure-monitor-opentelemetry-distro/tests + commands_pre = - python -m pip install -e {toxinidir}/azure-monitor-opentelemetry-distro + py3{7,8,9,10,11}: python -m pip install -U pip setuptools wheel + distro: pip install {toxinidir}/azure-monitor-opentelemetry-distro commands = - pytest {posargs} + distro: pytest {posargs} [testenv:lint] -basepython: python3.9 +basepython: python3.11 recreate = True deps = -r lint-requirements.txt