@@ -14,6 +14,12 @@ env_dir="${root_dir}/env"
14
14
15
15
cd " ${root_dir} "
16
16
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
+
17
23
eval " $( $( which conda) shell.bash hook) " && set -x
18
24
19
25
# Create test environment at ./env
@@ -28,11 +34,12 @@ echo $(which python)
28
34
echo $( python --version)
29
35
echo $( conda info -e)
30
36
31
-
37
+ echo " === Installing test dependencies === "
32
38
python -m pip install hypothesis future cloudpickle pytest pytest-cov pytest-mock pytest-instafail pytest-rerunfailures expecttest pyyaml scipy coverage
33
39
34
40
# =================================== Install =================================================
35
41
42
+ echo " === Installing PyTorch and dependencies ==="
36
43
37
44
# TODO, refactor the below logic to make it easy to understand how to get correct cuda_version.
38
45
if [ " ${CU_VERSION:- } " == cpu ] ; then
56
63
cudatoolkit=" ${cuda_toolkit_pckg} =${version} "
57
64
fi
58
65
59
-
60
66
# submodules
67
+ echo " === Updating git submodules ==="
61
68
git submodule sync && git submodule update --init --recursive
62
69
python -m pip install " numpy<2.0"
63
70
92
99
# python -m pip install pip --upgrade
93
100
94
101
# install tensordict
102
+ echo " === Installing tensordict ==="
95
103
if [[ " $RELEASE " == 0 ]]; then
96
104
conda install anaconda::cmake -y
97
105
@@ -103,11 +111,13 @@ else
103
111
fi
104
112
105
113
# smoke test
114
+ echo " === Testing tensordict import ==="
106
115
python -c " " "
107
116
from tensordict import TensorDict
108
117
print('successfully imported tensordict')
109
118
" " "
110
119
120
+ echo " === Setting up CUDA environment ==="
111
121
source " $this_dir /set_cuda_envs.sh"
112
122
113
123
printf " * Installing torchrl\n"
@@ -117,13 +127,15 @@ whatsinside=$(ls -rtlh ./torchrl)
117
127
echo $whatsinside
118
128
119
129
# smoke test
130
+ echo " === Testing torchrl import ==="
120
131
python -c " " "
121
132
from torchrl.data import ReplayBuffer
122
133
print('successfully imported torchrl')
123
134
" " "
124
135
125
136
# =================================== Run =================================================
126
137
138
+ echo " === Setting up test environment ==="
127
139
source " $this_dir /set_cuda_envs.sh"
128
140
129
141
# we don't use torchsnapshot
@@ -132,5 +144,24 @@ export MAX_IDLE_COUNT=60
132
144
export BATCHED_PIPE_TIMEOUT=60
133
145
export LAZY_LEGACY_OP=False
134
146
147
+ echo " === Collecting environment info ==="
135
148
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