From 2cc6a377130ae036ea50fc60785894c48d069549 Mon Sep 17 00:00:00 2001 From: Willi Ballenthin Date: Thu, 19 Oct 2023 10:23:03 +0000 Subject: [PATCH] ci: run fast tests before the full suite --- .github/workflows/tests.yml | 4 ++++ .pre-commit-config.yaml | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c688e20b..dc2d2df4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -95,6 +95,10 @@ jobs: run: sudo apt-get install -y libyaml-dev - name: Install capa run: pip install -e .[dev] + - name: Run tests (fast) + # this set of tests runs about 80% of the cases in 20% of the time, + # and should catch most errors quickly. + run: pre-commit run pytest-fast --all-files - name: Run tests run: pytest -v tests/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dbc6e80f..7e73306c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -109,3 +109,21 @@ repos: - "tests/" always_run: true pass_filenames: false + +- repo: local + hooks: + - id: pytest-fast + name: pytest (fast) + stages: [] + language: system + entry: pytest + args: + - "tests/" + - "--ignore=tests/test_binja_features.py" + - "--ignore=tests/test_ghidra_features.py" + - "--ignore=tests/test_ida_features.py" + - "--ignore=tests/test_viv_features.py" + - "--ignore=tests/test_main.py" + - "--ignore=tests/test_scripts.py" + always_run: true + pass_filenames: false