Skip to content

Commit 8ebf7af

Browse files
committed
Register new 'no_auto' job for special purpose tests
Test for log collection need to fail in order to trigger the log collection; so pytest.mark.xfail can't be used. But tests need to by referenced by a job, otherwise './jobs.py check' will fail. Signed-off-by: Emmanuel Varagnat <emmanuel.varagnat@vates.tech>
1 parent 7273e22 commit 8ebf7af

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

jobs.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,15 @@
446446
"nb_pools": 2,
447447
"params": {},
448448
"paths": ["tests/misc/test_pool.py"],
449+
},
450+
"no_auto": {
451+
"description": "Tests for special purposes",
452+
"requirements": [
453+
"1 XCP-ng host >= 8.2"
454+
],
455+
"nb_pools": 1,
456+
"params": {},
457+
"paths": ["tests/misc/test_log_collection.py"],
449458
}
450459
}
451460

tests/misc/test_log_collection.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def test_yet_another_pass(self, host: Host):
4747
class TestWithConsoleCapture:
4848
"""Tests in this class will capture VM console screenshots on failure."""
4949

50+
@pytest.mark.small_vm
5051
def test_vm_failure_with_console(self, running_vm: VM):
5152
"""This test fails with a running VM - console will be captured."""
5253
vm = running_vm
@@ -55,6 +56,7 @@ def test_vm_failure_with_console(self, running_vm: VM):
5556
# This will fail and trigger both log collection AND console capture
5657
assert False, "Intentional failure to test console capture"
5758

59+
@pytest.mark.small_vm
5860
def test_vm_passing_no_console(self, running_vm: VM):
5961
"""This test passes - no console capture needed."""
6062
vm = running_vm

0 commit comments

Comments
 (0)