Skip to content

Commit ce89183

Browse files
committed
init
1 parent ed051bc commit ce89183

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

.github/unittest/windows_optdepts/scripts/unittest.sh

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ env_dir="${root_dir}/env"
1414

1515
cd "${root_dir}"
1616

17+
echo "=== Starting Windows CI setup ==="
18+
echo "Current directory: $(pwd)"
19+
echo "Python version: $PYTHON_VERSION"
20+
echo "CU_VERSION: $CU_VERSION"
21+
echo "TORCH_VERSION: $TORCH_VERSION"
22+
1723
eval "$($(which conda) shell.bash hook)" && set -x
1824

1925
# Create test environment at ./env
@@ -28,11 +34,12 @@ echo $(which python)
2834
echo $(python --version)
2935
echo $(conda info -e)
3036

31-
37+
echo "=== Installing test dependencies ==="
3238
python -m pip install hypothesis future cloudpickle pytest pytest-cov pytest-mock pytest-instafail pytest-rerunfailures expecttest pyyaml scipy coverage
3339

3440
# =================================== Install =================================================
3541

42+
echo "=== Installing PyTorch and dependencies ==="
3643

3744
# TODO, refactor the below logic to make it easy to understand how to get correct cuda_version.
3845
if [ "${CU_VERSION:-}" == cpu ] ; then
@@ -56,8 +63,8 @@ else
5663
cudatoolkit="${cuda_toolkit_pckg}=${version}"
5764
fi
5865

59-
6066
# submodules
67+
echo "=== Updating git submodules ==="
6168
git submodule sync && git submodule update --init --recursive
6269
python -m pip install "numpy<2.0"
6370

@@ -92,6 +99,7 @@ fi
9299
#python -m pip install pip --upgrade
93100

94101
# install tensordict
102+
echo "=== Installing tensordict ==="
95103
if [[ "$RELEASE" == 0 ]]; then
96104
conda install anaconda::cmake -y
97105

@@ -103,11 +111,13 @@ else
103111
fi
104112

105113
# smoke test
114+
echo "=== Testing tensordict import ==="
106115
python -c """
107116
from tensordict import TensorDict
108117
print('successfully imported tensordict')
109118
"""
110119

120+
echo "=== Setting up CUDA environment ==="
111121
source "$this_dir/set_cuda_envs.sh"
112122

113123
printf "* Installing torchrl\n"
@@ -117,13 +127,15 @@ whatsinside=$(ls -rtlh ./torchrl)
117127
echo $whatsinside
118128

119129
# smoke test
130+
echo "=== Testing torchrl import ==="
120131
python -c """
121132
from torchrl.data import ReplayBuffer
122133
print('successfully imported torchrl')
123134
"""
124135

125136
# =================================== Run =================================================
126137

138+
echo "=== Setting up test environment ==="
127139
source "$this_dir/set_cuda_envs.sh"
128140

129141
# we don't use torchsnapshot
@@ -132,5 +144,24 @@ export MAX_IDLE_COUNT=60
132144
export BATCHED_PIPE_TIMEOUT=60
133145
export LAZY_LEGACY_OP=False
134146

147+
echo "=== Collecting environment info ==="
135148
python -m torch.utils.collect_env
136-
pytest --junitxml=test-results/junit.xml -v --durations 200 --ignore test/test_distributed.py --ignore test/test_rlhf.py
149+
150+
echo "=== Starting pytest execution ==="
151+
echo "Current working directory: $(pwd)"
152+
echo "Python executable: $(which python)"
153+
echo "Pytest executable: $(which pytest)"
154+
155+
# Create test-results directory if it doesn't exist
156+
mkdir -p test-results
157+
158+
# Run pytest with explicit error handling
159+
set +e # Don't exit on error for pytest
160+
pytest --junitxml=test-results/junit.xml -v --durations 200 --ignore test/test_distributed.py --ignore test/test_rlhf.py
161+
PYTEST_EXIT_CODE=$?
162+
set -e # Re-enable exit on error
163+
164+
echo "=== Pytest completed with exit code: $PYTEST_EXIT_CODE ==="
165+
166+
# Exit with pytest's exit code
167+
exit $PYTEST_EXIT_CODE

0 commit comments

Comments
 (0)