Skip to content

Commit 37db3f3

Browse files
committed
Refactor eco testing
1 parent 8c9b342 commit 37db3f3

29 files changed

+893
-46
lines changed

.github/workflows/tox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ jobs:
4141
hook
4242
docs
4343
schemas
44-
eco
4544
pre
4645
py311-devel
4746
py310-lower
@@ -110,6 +109,7 @@ jobs:
110109
with:
111110
path: |
112111
.cache/eco
112+
test/fixtures/eco/*/.tox
113113
examples/playbooks/collections/ansible_collections
114114
~/.cache/ansible-compat
115115
~/.ansible/collections

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,4 @@ node_modules
8282
.direnv
8383
uv.lock
8484
.ansible
85+
test/fixtures/eco

.gitmodules

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[submodule "test/fixtures/eco/bootstrap"]
2+
path = test/fixtures/eco/bootstrap
3+
url = https://github.com/robertdebock/ansible-role-bootstrap
4+
[submodule "test/fixtures/eco/cisco.nxos"]
5+
path = test/fixtures/eco/cisco.nxos
6+
url = https://github.com/ansible-collections/cisco.nxos
7+
[submodule "test/fixtures/eco/ansible_collection_system"]
8+
path = test/fixtures/eco/ansible_collection_system
9+
url = https://github.com/devroles/ansible_collection_system
10+
[submodule "test/fixtures/eco/ansible-docker-rootless"]
11+
path = test/fixtures/eco/ansible-docker-rootless
12+
url = https://github.com/konstruktoid/ansible-docker-rootless
13+
[submodule "test/fixtures/eco/ansible-role-hardening"]
14+
path = test/fixtures/eco/ansible-role-hardening
15+
url = https://github.com/konstruktoid/ansible-role-hardening
16+
[submodule "test/fixtures/eco/ansible-role-mysql"]
17+
path = test/fixtures/eco/ansible-role-mysql
18+
url = https://github.com/geerlingguy/ansible-role-mysql.git
19+
[submodule "test/fixtures/eco/debops"]
20+
path = test/fixtures/eco/debops
21+
url = https://github.com/debops/debops

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ exclude: >
2222
examples/playbooks/vars/empty.transformed.yml|
2323
examples/playbooks/vars/empty.yml|
2424
src/ansiblelint/schemas/rulebook.json|
25+
test/fixtures/eco/.*|
2526
test/schemas/data/licenses.json|
2627
test/schemas/negative_test|
2728
test/schemas/package-lock.json

codecov.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
comment: false
33
coverage:
44
status:
5-
patch: true
5+
patch: false # avoid false positives
66
project:
7-
default:
8-
threshold: 0.5%
7+
default: true

cspell.config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ ignorePaths:
1919
- docs/requirements.in
2020
# Test fixtures generated from outside
2121
- test/**/*.result
22+
- test/fixtures/eco/**
2223
- src/ansiblelint/schemas/*.json
2324
# Other
2425
- "*.svg"

pyproject.toml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ repository = "https://github.com/ansible/ansible-lint"
5151
[tool.codespell]
5252
# indention is a typo in ruamel.yaml's API
5353
ignore-words-list = "indention"
54-
skip = ".tox,.mypy_cache,build,.git,.eggs,pip-wheel-metadata"
54+
skip = ".tox,.mypy_cache,build,.git,.eggs,pip-wheel-metadata,test/fixtures/eco/*.json"
5555

5656
# Keep this default because xml/report do not know to use load it from config file:
5757
# data_file = ".coverage"
@@ -86,7 +86,7 @@ disallow_untyped_calls = true
8686
disallow_untyped_defs = true
8787
error_summary = true
8888
# site-packages is here to help vscode mypy integration getting confused
89-
exclude = "(.cache|.config|.eggs|.tox|_readthedocs|build|dist|test/local-content|site|site-packages|~/.pyenv|examples|plugins/modules).*"
89+
exclude = "(.cache|.config|.eggs|.tox|_readthedocs|build|dist|test/local-content|site|site-packages|~/.pyenv|examples|plugins/modules|test/fixtures/eco).*"
9090
# https://github.com/python/mypy/issues/12664
9191
follow_untyped_imports = true
9292
incremental = false
@@ -392,7 +392,7 @@ reportPrivateImportUsage = false
392392
[tool.pytest.ini_options]
393393
# do not add options here as this will likely break either console runs or IDE
394394
# integration like vscode or pycharm
395-
addopts = "-p no:pytest_cov --durations=10 --failed-first"
395+
addopts = "-p no:pytest_cov --durations=10 --failed-first -m 'not eco'"
396396
doctest_optionflags = ["ALLOW_UNICODE", "ELLIPSIS"]
397397
filterwarnings = [
398398
"error",
@@ -409,6 +409,9 @@ filterwarnings = [
409409
"ignore:Attribute s is deprecated and will be removed in Python 3.14; use value instead:DeprecationWarning"
410410
]
411411
junit_family = "legacy"
412+
markers = [
413+
"eco: test impact on ecosystem repositories (slow)"
414+
]
412415
minversion = "4.6.6"
413416
# https://code.visualstudio.com/docs/python/testing
414417
# coverage is re-enabled in `tox.ini`. That approach is safer than
@@ -435,6 +438,7 @@ norecursedirs = [
435438
"plugins",
436439
"site",
437440
"src/ansible_lint.egg-info",
441+
"test/fixtures/eco",
438442
"test/schemas"
439443
]
440444
python_files = [
@@ -574,6 +578,7 @@ exclude = [
574578
"collections",
575579
"examples",
576580
"plugins",
581+
"test/fixtures/eco",
577582
"test/local-content",
578583
"venv",
579584
"src/ansiblelint/_version.py"
Submodule ansible-docker-rootless added at a8b4650

test/fixtures/eco/ansible-docker-rootless.json

Whitespace-only changes.
Submodule ansible-role-hardening added at 8316d2a

0 commit comments

Comments
 (0)