From 59d75814991104e9f72acde7da6ebb191aa75966 Mon Sep 17 00:00:00 2001 From: "Gabriele N. Tornetta" Date: Mon, 4 Sep 2023 23:24:33 +0100 Subject: [PATCH] tests: categorise tests We group tests in categories to allow for better fine-graining when running the suite. --- .github/workflows/tests.yml | 87 ++++++++++++++++++++------- test/functional/__init__.py | 0 test/{ => functional}/test_attach.py | 0 test/{ => functional}/test_cli.py | 0 test/{ => functional}/test_fork.py | 0 test/{ => functional}/test_gc.py | 0 test/{ => functional}/test_mojo.py | 0 test/{ => functional}/test_pipe.py | 0 test/integrity/__init__.py | 0 test/{ => integrity}/test_accuracy.py | 0 test/{ => integrity}/test_valgrind.py | 0 test/support/__init__.py | 0 12 files changed, 66 insertions(+), 21 deletions(-) create mode 100644 test/functional/__init__.py rename test/{ => functional}/test_attach.py (100%) rename test/{ => functional}/test_cli.py (100%) rename test/{ => functional}/test_fork.py (100%) rename test/{ => functional}/test_gc.py (100%) rename test/{ => functional}/test_mojo.py (100%) rename test/{ => functional}/test_pipe.py (100%) create mode 100644 test/integrity/__init__.py rename test/{ => integrity}/test_accuracy.py (100%) rename test/{ => integrity}/test_valgrind.py (100%) create mode 100644 test/support/__init__.py diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8b83c7c9..588e52be 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -114,21 +114,38 @@ jobs: source .venv/bin/activate pip install --upgrade pip pip install -r test/requirements.txt - deactivate - - - name: Run tests (with sudo) - run: | ulimit -c unlimited - source .venv/bin/activate - sudo -E env PATH="$PATH" .venv/bin/pytest --pastebin=failed -svr a - deactivate - - name: Run tests (without sudo) - run: | - ulimit -c unlimited - source .venv/bin/activate - .venv/bin/pytest --pastebin=failed -svr a - deactivate + - name: Run unit tests + run: .venv/bin/pytest -sv test/cunit + + - name: Run functional Austin tests (with sudo) + run: sudo -E env PATH="$PATH" .venv/bin/pytest --pastebin=failed -svr a test/functional -n auto -k "not austinp" + if: always() + + - name: Run functional Austin tests (without sudo) + run: .venv/bin/pytest --pastebin=failed -svr a test/functional -n auto -k "not austinp" + if: always() + + - name: Run functional austinp tests (with sudo) + run: sudo -E env PATH="$PATH" .venv/bin/pytest --pastebin=failed -svr a test/functional -n auto -k "austinp" + if: always() + + - name: Run functional austinp tests (without sudo) + run: .venv/bin/pytest --pastebin=failed -svr a test/functional -n auto -k "austinp" + if: always() + + - name: Run integrity tests (with sudo) + run: sudo -E env PATH="$PATH" .venv/bin/pytest --pastebin=failed -svr a test/integrity + if: always() + + - name: Run integrity tests (without sudo) + run: .venv/bin/pytest --pastebin=failed -svr a test/integrity + if: always() + + - name: Run support tests + run: .venv/bin/pytest -sv test/support + if: always() wheels-linux: runs-on: ubuntu-20.04 @@ -249,12 +266,29 @@ jobs: python${{ matrix.python-version }} -m venv .venv \ || (python${{ matrix.python-version }} -m pip install virtualenv && python${{ matrix.python-version }} -m virtualenv .venv) - - name: Run tests + - name: Run functional tests run: | source .venv/bin/activate - sudo -E pytest --ignore=test/cunit --pastebin=failed -svr a - pytest --ignore=test/cunit --pastebin=failed -svr a -k _darwin - deactivate + sudo -E pytest --pastebin=failed -svr a -n auto test/functional -k "not austinp" + if: always() + + - name: Run integrity tests + run: | + source .venv/bin/activate + sudo -E pytest --pastebin=failed -svr a -n auto test/integrity -k "not austinp" + if: always() + + - name: Run support tests + run: | + source .venv/bin/activate + sudo -E pytest --pastebin=failed -svr a -n auto test/support + if: always() + + - name: Run Darwin-only tests + run: | + source .venv/bin/activate + pytest --pastebin=failed -svr a -k "_darwin" test/functional + if: always() wheels-osx: runs-on: macos-latest @@ -350,13 +384,24 @@ jobs: venv\Scripts\Activate.ps1 python -m pip install --upgrade pip python -m pip install -r test/requirements.txt - deactivate - - name: Run tests + - name: Run functional tests run: | venv\Scripts\Activate.ps1 - python -m pytest --full-trace --ignore=test\cunit --pastebin=failed -svr a - deactivate + python -m pytest --full-trace --pastebin=failed -svr a test\functional -k "not austinp" + if: always() + + - name: Run integrity tests + run: | + venv\Scripts\Activate.ps1 + python -m pytest --full-trace --pastebin=failed -svr a test\integrity -k "not austinp" + if: always() + + - name: Run support tests + run: | + venv\Scripts\Activate.ps1 + python -m pytest --full-trace --pastebin=failed -svr a test\support + if: always() wheels-win: runs-on: windows-latest diff --git a/test/functional/__init__.py b/test/functional/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test/test_attach.py b/test/functional/test_attach.py similarity index 100% rename from test/test_attach.py rename to test/functional/test_attach.py diff --git a/test/test_cli.py b/test/functional/test_cli.py similarity index 100% rename from test/test_cli.py rename to test/functional/test_cli.py diff --git a/test/test_fork.py b/test/functional/test_fork.py similarity index 100% rename from test/test_fork.py rename to test/functional/test_fork.py diff --git a/test/test_gc.py b/test/functional/test_gc.py similarity index 100% rename from test/test_gc.py rename to test/functional/test_gc.py diff --git a/test/test_mojo.py b/test/functional/test_mojo.py similarity index 100% rename from test/test_mojo.py rename to test/functional/test_mojo.py diff --git a/test/test_pipe.py b/test/functional/test_pipe.py similarity index 100% rename from test/test_pipe.py rename to test/functional/test_pipe.py diff --git a/test/integrity/__init__.py b/test/integrity/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test/test_accuracy.py b/test/integrity/test_accuracy.py similarity index 100% rename from test/test_accuracy.py rename to test/integrity/test_accuracy.py diff --git a/test/test_valgrind.py b/test/integrity/test_valgrind.py similarity index 100% rename from test/test_valgrind.py rename to test/integrity/test_valgrind.py diff --git a/test/support/__init__.py b/test/support/__init__.py new file mode 100644 index 00000000..e69de29b