Skip to content

Commit 994fdef

Browse files
committed
chore: refactor eco testing
1 parent efe2751 commit 994fdef

37 files changed

+819
-39
lines changed

.github/workflows/tox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
default_python: "3.13"
3030
max_python: "3.13"
3131
other_names: |
32-
lint-pkg-schemas-eco:tox -e lint;tox -e pkg;tox -e schemas;tox -e eco
32+
lint-pkg-schemas:tox -e lint;tox -e pkg;tox -e schemas
3333
hook
3434
docs
3535
py312-devel

.gitmodules

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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

.pre-commit-config.yaml

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

cspell.config.yaml

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

pyproject.toml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ disallow_untyped_calls = true
161161
disallow_untyped_defs = true
162162
error_summary = true
163163
# site-packages is here to help vscode mypy integration getting confused
164-
exclude = "(.config|test/local-content|site-packages|~/.pyenv|examples|plugins/modules).*"
164+
exclude = "(.config|test/local-content|test/fixtures/eco|site-packages|~/.pyenv|examples|plugins/modules).*"
165165
exclude_gitignore = true
166166
# https://github.com/python/mypy/issues/12664
167167
follow_untyped_imports = true
@@ -463,7 +463,12 @@ reportPrivateImportUsage = false
463463
[tool.pytest]
464464
# do not add options here as this will likely break either console runs or IDE
465465
# integration like vscode or pycharm
466-
addopts = ["--durations=10", "--failed-first", "-p no:pytest_cov"]
466+
addopts = [
467+
"--durations=10",
468+
"--failed-first",
469+
# "-m=eco",
470+
"-p no:pytest_cov",
471+
]
467472
doctest_optionflags = ["ALLOW_UNICODE", "ELLIPSIS"]
468473
filterwarnings = [
469474
# We raise one non critical warning from our own conftest.py:
@@ -476,7 +481,10 @@ filterwarnings = [
476481
"ignore:Attribute s is deprecated and will be removed in Python 3.14; use value instead:DeprecationWarning",
477482
]
478483
junit_family = "xunit2"
479-
markers = ["libyaml: tests that will pass only with pyyaml libyaml is present."]
484+
markers = [
485+
"eco: test impact on ecosystem repositories (slow)",
486+
"libyaml: tests that will pass only with pyyaml libyaml is present."
487+
]
480488
minversion = "9.0" # toml config changes
481489
# https://code.visualstudio.com/docs/python/testing
482490
# coverage is re-enabled in `tox.ini`. That approach is safer than
@@ -503,6 +511,7 @@ norecursedirs = [
503511
"plugins",
504512
"site",
505513
"src/ansible_lint.egg-info",
514+
"test/fixtures/eco",
506515
"test/schemas",
507516
]
508517
python_files = [
@@ -684,14 +693,6 @@ set_env.DYLD_FALLBACK_LIBRARY_PATH = "/opt/homebrew/lib:{env:LD_LIBRARY_PATH}"
684693
set_env.NO_COLOR = "1"
685694
set_env.TERM = "dump"
686695

687-
[tool.tox.env.eco]
688-
commands = [
689-
["sh", "-c", "tools/test-eco.sh"],
690-
]
691-
commands_post = []
692-
commands_pre = []
693-
description = "Perform ecosystem impact (downstream testing) https://github.com/ansible/ansible-lint/discussions/1403"
694-
695696
[tool.tox.env.hook]
696697
commands = [["{tox_root}/tools/test-hook.sh"]]
697698
dependency_groups = ["lint"]
@@ -887,6 +888,7 @@ exclude = [
887888
"test/local-content",
888889
"venv",
889890
"src/ansiblelint/_version.py",
891+
"test/fixtures/eco"
890892
]
891893
ignore_names = [
892894
"_ANSIBLE_ARGS",
Submodule ansible-docker-rootless added at a8b4650

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

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0

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

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

0 commit comments

Comments
 (0)