diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-07-03 17:55:05 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-07-03 18:56:54 +0200 |
commit | 2511c3cea47de42e08fe3ef8e45e88d8914fcd04 (patch) | |
tree | 36aca1312a5e6b87533542124f1164d04e4eb0bd | |
parent | c97203dd624aafeda2359d31d020af80033708d6 (diff) | |
download | qutebrowser-2511c3cea47de42e08fe3ef8e45e88d8914fcd04.tar.gz qutebrowser-2511c3cea47de42e08fe3ef8e45e88d8914fcd04.zip |
ci: Write problem matchers for Python/pytest exceptions
-rw-r--r-- | .github/workflows/ci.yml | 4 | ||||
-rw-r--r-- | scripts/dev/ci/problemmatchers.py | 35 |
2 files changed, 39 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc684e47d..47be2944e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,6 +65,8 @@ jobs: options: --privileged --tty steps: - uses: actions/checkout@v2 + - name: Set up problem matchers + run: "python3 scripts/dev/ci/problemmatchers.py py38" - run: tox -e py38 tests: @@ -139,6 +141,8 @@ jobs: if: "endsWith(matrix.python, '-dev')" with: python-version: "${{ matrix.python }}" + - name: Set up problem matchers + run: "python3 scripts/dev/ci/problemmatchers.py ${{ matrix.testenv }}" - name: Install apt dependencies run: sudo apt-get install --no-install-recommends libyaml-dev libegl1-mesa libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 if: "startsWith(matrix.os, 'ubuntu-')" diff --git a/scripts/dev/ci/problemmatchers.py b/scripts/dev/ci/problemmatchers.py index 13f960c31..a10077282 100644 --- a/scripts/dev/ci/problemmatchers.py +++ b/scripts/dev/ci/problemmatchers.py @@ -134,6 +134,38 @@ MATCHERS = { ], }, ], + + "tests": [ + { + # BDD tests / normal Python exceptions + "severity": "error", + "pattern": [ + { + "regexp": r'^E?\s*File "(.*)", line (\d+), in .*$', + "file": 1, + "line": 2, + }, + { + "regexp": r"E?\s*\w+Error: (.*)", + "message": 1, + } + ], + }, + { + # pytest stacktraces + # qutebrowser/utils/utils.py:773: AssertionError + # tests/unit/utils/test_utils.py:887: + "severity": "error", + "pattern": [ + { + "regexp": r'^([^ ]*):(\d+): ?(.*)', + "file": 1, + "line": 2, + "message": 3, + } + ], + }, + ] } @@ -152,6 +184,9 @@ def add_matcher(output_dir, testenv, data): def main(): testenv = sys.argv[1] + if testenv.startswith('py3'): + testenv = 'tests' + if testenv not in MATCHERS: return |