Commit 69eb9e6f authored by Muyang Li's avatar Muyang Li
Browse files

chore: better test logs

parent 92d75723
......@@ -108,13 +108,13 @@ jobs:
pwd
cd ../ComfyUI
python nunchaku_tests/scripts/nunchaku-flux1-dev.py
pytest -s nunchaku_tests/
pytest -s -x nunchaku_tests/
- name: Run nunchaku tests
run: |
source $(conda info --base)/etc/profile.d/conda.sh
conda activate test_env || { echo "Failed to activate conda env"; exit 1; }
which python
pytest -s tests/flux/test_flux_examples.py
pytest -s -x tests/flux/test_flux_examples.py
python .github/workflows/run_all_tests.py
- name: clean up
if: always()
......
......@@ -21,7 +21,7 @@ def run_all_tests():
failed_tests = []
for test_file in test_files:
print(f"Running {test_file} ...")
result = subprocess.run(["pytest", "--reruns", "2", "--reruns-delay", "0", "-s", test_file])
result = subprocess.run(["pytest", "--reruns", "2", "--reruns-delay", "0", "-s", "-x", test_file])
if result.returncode != 0:
print(f"Test failed: {test_file}")
failed_tests.append(test_file)
......
......@@ -12,9 +12,7 @@ example_scripts = [f for f in os.listdir(EXAMPLES_DIR) if f.endswith(".py") and
@pytest.mark.parametrize("script_name", example_scripts)
def test_example_script_runs(script_name):
gc.collect()
torch.cuda.empty_cache()
script_path = os.path.join(EXAMPLES_DIR, script_name)
result = subprocess.run(["python", script_path], capture_output=True, text=True)
result = subprocess.run(["python", script_path], text=True)
print(f"Running {script_path} -> Return code: {result.returncode}")
assert result.returncode == 0, f"{script_path} failed with code {result.returncode}"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment