diff --git a/.github/actions/test-integration/action.yml b/.github/actions/test-integration/action.yml new file mode 100644 index 0000000..13b5dbf --- /dev/null +++ b/.github/actions/test-integration/action.yml @@ -0,0 +1,47 @@ +--- +name: Test Unit +description: Check unit tests +inputs: + python-version: + description: "Python version" + required: true + os: + description: "Operating system" + required: true + report_job: + description: "Job name to update by JUnit report" + required: true + +runs: + using: "composite" + steps: + - name: Install package + uses: ./.github/actions/install-package + with: + python-version: ${{ inputs.python-version }} + os: ${{ inputs.os }}-latest + + - name: Test + run: | + pytest -v -n 2 ./tests/integration/ \ + --timeout=120 --timeout_method=thread \ + --color=yes \ + --junitxml="./test-results/test-integration-${{ inputs.os }}-${{ inputs.python-version }}.xml" + shell: bash + + - name: Upload test reports + uses: actions/upload-artifact@v3 + if: always() + with: + name: test-artifacts + path: ./test-results + + - name: Report + uses: mikepenz/action-junit-report@v3.6.2 + if: always() + with: + report_paths: './test-results/test-integration-*.xml' + update_check: true + include_passed: true + annotate_notice: true + job_name: ${{ inputs.report_job }} diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml new file mode 100644 index 0000000..2089b54 --- /dev/null +++ b/.github/workflows/integration-tests.yml @@ -0,0 +1,39 @@ +name: integration + +on: + workflow_call: + workflow_dispatch: + pull_request: + push: + branches: + - master + +jobs: + test: + timeout-minutes: 75 + strategy: + fail-fast: false + matrix: + python-version: ["3.7", "3.12"] + os: [ubuntu, windows] + include: + - python-version: "3.7.16" + os: macos + - python-version: "3.12" + os: macos + + name: 'test (${{ matrix.os }} - py${{ matrix.python-version }})' + runs-on: ${{ matrix.os }}-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event.client_payload.pull_request.head.ref }} + + - name: Run tests + uses: ./.github/actions/test-integration + with: + python-version: ${{ matrix.python-version }} + os: ${{ matrix.os }} + report_job: 'test (${{ matrix.os }} - py${{ matrix.python-version }})' diff --git a/dev_requirements.txt b/dev_requirements.txt index 05ae193..5440b63 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -3,4 +3,7 @@ behave mock pre-commit pytest +pytest-mock +pytest-timeout +pytest-xdist icecream diff --git a/pyproject.toml b/pyproject.toml index cf3caee..53e846a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ pattern = "default-unprefixed" python = "^3.7" # Base neptune package -neptune = "*" +neptune = "2.0.0a0" # Optional for default progress update handling tqdm = { version = ">=4.66.0", optional = true }