From 51db6f486e0f3262128b37ea0b0b516c729612b8 Mon Sep 17 00:00:00 2001 From: Terry Kong Date: Mon, 14 Apr 2025 23:01:55 -0700 Subject: [PATCH 1/2] fix: unit tests error on first failure - after one test fails, the cluster may be in a bad state so just exit pytest on the first failure - and move pytest args to pyproject.toml Signed-off-by: Terry Kong --- .gitignore | 1 + pyproject.toml | 1 + tests/run_unit.sh | 3 +-- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 4884d4dc81..e4d68f2e40 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ wandb/ checkpoints/ results/ code_snapshots/ +stress_test_results/ diff --git a/pyproject.toml b/pyproject.toml index b257b7aed5..febbf9c5f1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,6 +79,7 @@ exclude = ''' ''' [tool.pytest.ini_options] +addopts = "--cov=nemo_reinforcer --cov-report=term --cov-report=json -s -rA -x" testpaths = ["tests"] python_files = "test_*.py" diff --git a/tests/run_unit.sh b/tests/run_unit.sh index f51ff49ff6..5367749199 100755 --- a/tests/run_unit.sh +++ b/tests/run_unit.sh @@ -29,11 +29,10 @@ if ! ray status &>/dev/null; then fi export PYTHONPATH=$(realpath ${SCRIPT_DIR}/..):${PYTHONPATH:-} -export RAY_DEDUP_LOGS=0 # Run unit tests echo "Running unit tests..." -if ! pytest unit/ --cov=nemo_reinforcer --cov-report=term --cov-report=json -s -rA "$@"; then +if ! pytest unit/ "$@"; then echo "[ERROR]: Unit tests failed." exit 1 fi From 8d2c06e75af1ea876271a76145cedb89656275ef Mon Sep 17 00:00:00 2001 From: Terry Kong Date: Tue, 15 Apr 2025 09:09:58 -0700 Subject: [PATCH 2/2] revert Signed-off-by: Terry Kong --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index e4d68f2e40..4884d4dc81 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,3 @@ wandb/ checkpoints/ results/ code_snapshots/ -stress_test_results/