Skip to content

Commit 4e07413

Browse files
committed
[REF] test: Add LINT_COMPATIBILITY_VERSION matrix testing
1 parent f0b4beb commit 4e07413

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.github/workflows/github-actions.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,18 @@ jobs:
2222
image: quay.io/vauxoo/dockerv:latest
2323
options: --user root
2424
name: docker vauxoo light image
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
lint_compatibility_version:
29+
- ""
30+
- "0.0.0.0.0.0.0.0"
31+
- "10.10.10.10.10.10.10.10"
32+
- "20.20.20.20.20.20.20.20"
2533
env:
2634
PIP_CACHE_DIR: "/root/.cache/pip"
2735
PRE_COMMIT_HOME: "/root/.cache/pre-commit"
36+
LINT_COMPATIBILITY_VERSION: ${{ matrix.lint_compatibility_version }}
2837
steps:
2938
- uses: actions/checkout@v4
3039
- name: Upgrade pre-commit-vauxoo to the latest version (w/o update dependencies if not needed)

tests/test_pre_commit_vauxoo.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from distutils.dir_util import copy_tree # pylint:disable=deprecated-module
1313
from io import StringIO
1414

15+
import pytest
1516
from click.testing import CliRunner
1617
from pylint.lint import Run
1718
from yaml import Loader, load
@@ -21,6 +22,16 @@
2122
ANSI_ESCAPE_RE = re.compile(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])")
2223

2324

25+
@pytest.fixture(params=[None, "0.0.0.0.0.0.0.0", "10.10.10.10.10.10.10.10", "20.20.20.20.20.20.20.20"])
26+
def env_mode(request, monkeypatch):
27+
if request.param is None:
28+
monkeypatch.delenv("LINT_COMPATIBILITY_VERSION", raising=False)
29+
else:
30+
monkeypatch.setenv("LINT_COMPATIBILITY_VERSION", request.param)
31+
return request.param
32+
33+
34+
@pytest.mark.usefixtures("env_mode")
2435
class TestPreCommitVauxoo:
2536
def strip_ansi(self, text: str) -> str:
2637
return ANSI_ESCAPE_RE.sub("", text)

0 commit comments

Comments
 (0)