Skip to content

Commit 09b8273

Browse files
committed
update tests
1 parent 865d2c8 commit 09b8273

File tree

7 files changed

+16
-69
lines changed

7 files changed

+16
-69
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ squashfs-root
3030

3131
subunit.html
3232
subunit.out
33+
34+
.benchmark

tests/integration/requirements-test.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
coverage[toml]==7.2.5
22
pytest==7.3.1
3-
pytest_tagging==1.5.3
3+
pytest_tagging==1.6.0
4+
pytest-benchmark==5.0.0
45
PyYAML==6.0.1
56
tenacity==8.2.3
67
pylint==3.2.5

tests/integration/tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
LOG = logging.getLogger(__name__)
1616

17-
pytest_plugins = ("pytest_tagging", "pytest-benchmark")
17+
pytest_plugins = ("pytest_tagging","pytest_benchmark")
1818

1919

2020
def pytest_itemcollected(item):
@@ -24,11 +24,11 @@ def pytest_itemcollected(item):
2424
# Check for tags in the pytest.mark attributes
2525
marked_tags = [mark for mark in item.iter_markers(name="tags")]
2626
if not marked_tags or not any(
27-
tag.args[0] in tags.TEST_LEVELS for tag in marked_tags
27+
tag.args[0] in tags.TEST_TAGS for tag in marked_tags
2828
):
2929
pytest.fail(
3030
f"The test {item.nodeid} does not have one of the test level tags."
31-
f"Please add at least one test-level tag using @pytest.mark.tags ({tags.TEST_LEVELS})."
31+
f"Please add at least one test tag using @pytest.mark.tags ({tags.TEST_TAGS})."
3232
)
3333

3434

tests/integration/tests/performance/create_benchmark_baselines.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

tests/integration/tests/test_util/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,6 @@
188188

189189
# SONOBUOY_VERSION is the version of sonobuoy to use for CNCF conformance tests.
190190
SONOBUOY_VERSION = os.getenv("TEST_SONOBUOY_VERSION") or "v0.57.3"
191+
192+
# PERF_DEFAULT_ROUNDS is the number of rounds to run for performance tests.
193+
PERF_DEFAULT_ROUNDS = int(os.getenv("TEST_PERF_DEFAULT_ROUNDS") or 5)

tests/integration/tests/test_util/tags.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
WEEKLY = "weekly"
99
GPU = "gpu"
1010
CONFORMANCE = "conformance_tests"
11+
PERFORMANCE = "performance"
1112

12-
TEST_LEVELS = [PULL_REQUEST, NIGHTLY, WEEKLY, CONFORMANCE]
13+
# Each test needs to be tagged with at least one of the following tags.
14+
# This is enforced by conftest.
15+
TEST_TAGS = [PULL_REQUEST, NIGHTLY, WEEKLY, CONFORMANCE, PERFORMANCE, GPU]
1316

1417
# Those tags can be used for a convenient way to run multiple test levels.
1518
combine_tags("up_to_nightly", PULL_REQUEST, NIGHTLY)

tests/integration/tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ commands_post =
4747
passenv =
4848
TEST_*
4949

50-
[testenv:create_benchmark_baselines]
50+
[testenv:create_benchmark_baseline]
5151
description = Generate baselines for performance tests
5252
deps =
5353
-r {toxinidir}/requirements-test.txt
5454
commands =
55-
python3 {toxinidir}/tests/performance/create_benchmark_baselines.py {posargs}
55+
python3 {toxinidir}/tests/performance/create_baselines.py {posargs}
5656
passenv =
5757
TEST_*
5858

0 commit comments

Comments
 (0)