Skip to content

Commit de3b8ce

Browse files
author
Roman
committed
test
1 parent 624fa59 commit de3b8ce

File tree

1 file changed

+78
-76
lines changed

1 file changed

+78
-76
lines changed

.github/workflows/e2e-subtensor-tests.yaml

Lines changed: 78 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -66,75 +66,75 @@ jobs:
6666
path: subtensor-localnet.tar
6767

6868
# Job to run tests in parallel
69-
run-e2e-test:
70-
name: ${{ matrix.test-file }} / Python ${{ matrix.python-version }}
71-
needs:
72-
- find-tests
73-
- pull-docker-image
74-
runs-on: ubuntu-latest
75-
timeout-minutes: 45
76-
strategy:
77-
fail-fast: false # Allow other matrix jobs to run even if this job fails
78-
max-parallel: 32 # Set the maximum number of parallel jobs (same as we have cores in ubuntu-latest runner)
79-
matrix:
80-
os:
81-
- ubuntu-latest
82-
test-file: ${{ fromJson(needs.find-tests.outputs.test-files) }}
83-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
84-
steps:
85-
- name: Check-out repository
86-
uses: actions/checkout@v4
87-
88-
- name: Set up Python ${{ matrix.python-version }}
89-
uses: actions/setup-python@v5
90-
with:
91-
python-version: ${{ matrix.python-version }}
92-
93-
- name: Install uv
94-
uses: astral-sh/setup-uv@v4
95-
96-
- name: install dependencies
97-
run: uv sync --extra dev --dev
98-
99-
- name: Download Cached Docker Image
100-
uses: actions/download-artifact@v4
101-
with:
102-
name: subtensor-localnet
103-
104-
- name: Load Docker Image
105-
run: docker load -i subtensor-localnet.tar
106-
107-
# - name: Run tests
108-
# run: uv run pytest ${{ matrix.test-file }} -s
109-
110-
- name: Run tests with retry
111-
run: |
112-
set +e
113-
for i in 1 2 3; do
114-
echo "🔁 Attempt $i: Running tests"
115-
uv run pytest ${{ matrix.test-file }} -s
116-
status=$?
117-
if [ $status -eq 0 ]; then
118-
echo "✅ Tests passed on attempt $i"
119-
break
120-
else
121-
echo "❌ Tests failed on attempt $i"
122-
if [ $i -eq 3 ]; then
123-
echo "Tests failed after 3 attempts"
124-
exit 1
125-
fi
126-
echo "Retrying..."
127-
sleep 5
128-
fi
129-
done
69+
# run-e2e-test:
70+
# name: ${{ matrix.test-file }} / Python ${{ matrix.python-version }}
71+
# needs:
72+
# - find-tests
73+
# - pull-docker-image
74+
# runs-on: ubuntu-latest
75+
# timeout-minutes: 45
76+
# strategy:
77+
# fail-fast: false # Allow other matrix jobs to run even if this job fails
78+
# max-parallel: 32 # Set the maximum number of parallel jobs (same as we have cores in ubuntu-latest runner)
79+
# matrix:
80+
# os:
81+
# - ubuntu-latest
82+
# test-file: ${{ fromJson(needs.find-tests.outputs.test-files) }}
83+
# python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
84+
# steps:
85+
# - name: Check-out repository
86+
# uses: actions/checkout@v4
87+
#
88+
# - name: Set up Python ${{ matrix.python-version }}
89+
# uses: actions/setup-python@v5
90+
# with:
91+
# python-version: ${{ matrix.python-version }}
92+
#
93+
# - name: Install uv
94+
# uses: astral-sh/setup-uv@v4
95+
#
96+
# - name: install dependencies
97+
# run: uv sync --extra dev --dev
98+
#
99+
# - name: Download Cached Docker Image
100+
# uses: actions/download-artifact@v4
101+
# with:
102+
# name: subtensor-localnet
103+
#
104+
# - name: Load Docker Image
105+
# run: docker load -i subtensor-localnet.tar
106+
#
107+
## - name: Run tests
108+
## run: uv run pytest ${{ matrix.test-file }} -s
109+
#
110+
# - name: Run tests with retry
111+
# run: |
112+
# set +e
113+
# for i in 1 2 3; do
114+
# echo "🔁 Attempt $i: Running tests"
115+
# uv run pytest ${{ matrix.test-file }} -s
116+
# status=$?
117+
# if [ $status -eq 0 ]; then
118+
# echo "✅ Tests passed on attempt $i"
119+
# break
120+
# else
121+
# echo "❌ Tests failed on attempt $i"
122+
# if [ $i -eq 3 ]; then
123+
# echo "Tests failed after 3 attempts"
124+
# exit 1
125+
# fi
126+
# echo "Retrying..."
127+
# sleep 5
128+
# fi
129+
# done
130130

131131
# `build-patched-image` and `cron-e2e-test-with-non-fast-block` should run once per week
132132
build-patched-image:
133133
# if: github.event_name == 'schedule'
134134
runs-on: ubuntu-latest
135135

136136
outputs:
137-
image-tag: ${{ steps.set-tag.outputs.tag }}
137+
image_name: ${{ steps.set-image.outputs.image_name }}
138138

139139
steps:
140140
# - name: Check if today is Saturday
@@ -154,19 +154,19 @@ jobs:
154154
git checkout devnet-ready
155155
sed -i 's|7 \* 24 \* 60 \* 60 / 12 // 7 days|5 // Only 5 blocks for tests|' runtime/src/lib.rs
156156
157-
- name: Build Docker image
158-
run: |
159-
cd subtensor
160-
docker build -t subtensor-patched-devnet .
161-
162-
- name: Save Docker image
163-
run: docker save subtensor-patched-devnet -o subtensor-patched-localnet.tar
164-
165-
- name: Upload image as artifact
166-
uses: actions/upload-artifact@v4
167-
with:
168-
name: subtensor-patched-localnet
169-
path: subtensor-patched-localnet.tar
157+
# - name: Build Docker image
158+
# run: |
159+
# cd subtensor
160+
# docker build -t subtensor-patched-devnet .
161+
#
162+
# - name: Save Docker image
163+
# run: docker save subtensor-patched-devnet -o subtensor-patched-localnet.tar
164+
#
165+
# - name: Upload image as artifact
166+
# uses: actions/upload-artifact@v4
167+
# with:
168+
# name: subtensor-patched-localnet
169+
# path: subtensor-patched-localnet.tar
170170

171171

172172
cron-e2e-test-with-non-fast-block:
@@ -211,9 +211,11 @@ jobs:
211211

212212
- name: Run patched E2E tests
213213
env:
214-
LOCALNET_IMAGE_NAME: ${{ needs.build-patched-image.outputs.image_name }}
214+
LOCALNET_IMAGE_NAME: "subtensor-patched-localnet"
215215
FAST_BLOCKS: "False"
216216
run: |
217+
echo "LOCALNET_IMAGE_NAME=${LOCALNET_IMAGE_NAME}"
218+
echo "FAST_BLOCKS=${FAST_BLOCKS}"
217219
set +e
218220
for i in 1 2 3; do
219221
echo "🔁 Attempt $i: Running tests"

0 commit comments

Comments
 (0)