Skip to content

Commit ba629bb

Browse files
committed
qemu_test: re-use the same qemu vm fixture
Since qemu booting is slow and we want fast developer iteration, we make the optimisation compromise that we will not reset the qemu vm test fixture from a fresh image for every test. Most tests should not collide with each other. If we think a new test will do that and we want to make the compromise of giving it an isolated environment for a slower test suite, we can deal with that then. Signed-off-by: Robie Basak <robie.basak@oss.qualcomm.com>
1 parent 52829d7 commit ba629bb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ci/qemu_test.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,16 @@
1414
import pytest
1515

1616

17-
@pytest.fixture
17+
@pytest.fixture(scope="module")
1818
def vm():
1919
"""A pexpect.spawn object attached to the serial console of a VM freshly
2020
booting with a CoW base of disk-ufs.img"""
21+
# Since qemu booting is slow and we want fast developer iteration, we make the
22+
# optimisation compromise that we will not reset the qemu test fixture from a
23+
# fresh image for every test. Most tests should not collide with each other. If
24+
# we think a new test will do that and we want to make the compromise of giving
25+
# it an isolated environment for a slower test suite, we can deal with that
26+
# then.
2127
with tempfile.TemporaryDirectory() as tmpdir:
2228
qcow_path = os.path.join(tmpdir, "disk1.qcow")
2329
subprocess.run(

0 commit comments

Comments
 (0)