Skip to content

Commit b41cbbf

Browse files
pablo-garaysajadn
authored andcommitted
tests: add more logs (#64)
* tests: add more logs Signed-off-by: Pablo Garay <[email protected]> * update Signed-off-by: Pablo Garay <[email protected]> * update2 Signed-off-by: Pablo Garay <[email protected]> --------- Signed-off-by: Pablo Garay <[email protected]>
1 parent 1718290 commit b41cbbf

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

tests/conftest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,7 @@ def pytest_configure(config):
6868
"markers",
6969
"pleasefixme: marks test as needing fixes (will be skipped in CI)",
7070
)
71+
config.addinivalue_line(
72+
"markers",
73+
"run_only_on: marks test to run only on specific hardware (CPU/GPU)",
74+
)

tests/functional_tests/mcore/recipes/test_dit_pretrain.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ def test_DiT_pretrain_mock(self, tmp_path):
6363
]
6464

6565
# Run the command with a timeout
66+
result = None
6667
try:
67-
# Stream output in real-time instead of capturing it
6868
result = subprocess.run(
6969
cmd,
7070
capture_output=True,
@@ -73,14 +73,16 @@ def test_DiT_pretrain_mock(self, tmp_path):
7373
check=True,
7474
)
7575

76-
# Print output for debugging if needed
77-
print("STDOUT:", result.stdout)
78-
print("STDERR:", result.stderr)
79-
8076
# Basic verification that the run completed
8177
assert result.returncode == 0, f"Command failed with return code {result.returncode}"
8278

8379
except subprocess.TimeoutExpired:
8480
pytest.fail("DiT pretrain mock run exceeded timeout of 1800 seconds (30 minutes)")
8581
except subprocess.CalledProcessError as e:
82+
result = e
8683
pytest.fail(f"DiT pretrain mock run failed with return code {e.returncode}")
84+
finally:
85+
# Always print output for debugging
86+
if result is not None:
87+
print("STDOUT:", result.stdout)
88+
print("STDERR:", result.stderr)

tests/functional_tests/mcore/recipes/test_wan_pretrain.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ def test_wan_pretrain_mock(self, tmp_path):
8181
]
8282

8383
# Run the command with a timeout
84+
result = None
8485
try:
85-
# Stream output in real-time instead of capturing it
8686
result = subprocess.run(
8787
cmd,
8888
capture_output=True,
@@ -91,14 +91,16 @@ def test_wan_pretrain_mock(self, tmp_path):
9191
check=True,
9292
)
9393

94-
# Print output for debugging if needed
95-
print("STDOUT:", result.stdout)
96-
print("STDERR:", result.stderr)
97-
9894
# Basic verification that the run completed
9995
assert result.returncode == 0, f"Command failed with return code {result.returncode}"
10096

10197
except subprocess.TimeoutExpired:
10298
pytest.fail("WAN pretrain mock run exceeded timeout of 1800 seconds (30 minutes)")
10399
except subprocess.CalledProcessError as e:
100+
result = e
104101
pytest.fail(f"WAN pretrain mock run failed with return code {e.returncode}")
102+
finally:
103+
# Always print output for debugging
104+
if result is not None:
105+
print("STDOUT:", result.stdout)
106+
print("STDERR:", result.stderr)

0 commit comments

Comments
 (0)