Skip to content

Commit ae98264

Browse files
committed
add dependencies step in find-e2e-tests job
1 parent 533a68d commit ae98264

File tree

1 file changed

+25
-18
lines changed

1 file changed

+25
-18
lines changed

.github/workflows/check_sdk_tests.yml

+25-18
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,35 @@ jobs:
2626
- name: Check out repository
2727
uses: actions/checkout@v4
2828

29+
find-e2e-tests:
30+
runs-on: ubuntu-latest
31+
outputs:
32+
test-files: ${{ steps.get-tests.outputs.test-files }}
33+
steps:
34+
- name: Research preparation
35+
working-directory: ${{ github.workspace }}
36+
run: git clone https://github.com/opentensor/bittensor.git
37+
38+
- name: Checkout
39+
working-directory: ${{ github.workspace }}/bittensor
40+
run: git checkout staging
41+
42+
- name: Install dependencies
43+
run: sudo apt-get install -y jq
44+
45+
- name: Find e2e test files
46+
id: get-tests
47+
run: |
48+
test_files=$(find ${{ github.workspace }}/bittensor/tests/e2e_tests -name "test*.py" | jq -R -s -c 'split("\n") | map(select(. != ""))')
49+
echo "::set-output name=test-files::$test_files"
50+
shell: bash
51+
2952
run-tests:
3053
needs:
54+
- find-e2e-tests
3155
- check-labels
3256
runs-on: ubuntu-latest
3357
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft == false && needs.check-labels.outputs.run-sdk-tests == 'true' }}
34-
outputs:
35-
test-files: ${{ steps.get-tests.outputs.test-files }}
3658
strategy:
3759
fail-fast: false
3860
max-parallel: 8
@@ -43,7 +65,7 @@ jobs:
4365
- x86_64-unknown-linux-gnu
4466
os:
4567
- ubuntu-latest
46-
test-file: ${{ fromJson(outputs.test-files) }}
68+
test-file: ${{ fromJson(needs.find-e2e-tests.outputs.test-files) }}
4769
timeout-minutes: 60
4870
steps:
4971
- name: Check-out repository
@@ -99,19 +121,6 @@ jobs:
99121
source ${{ github.workspace }}/venv/bin/activate
100122
maturin develop
101123
102-
- name: Debug test files directory
103-
run: |
104-
ls -la ${{ github.workspace }}/bittensor/tests/e2e_tests
105-
shell: bash
106-
107-
- name: Find e2e test files
108-
id: get-tests
109-
run: |
110-
test_files=$(find ${{ github.workspace }}/bittensor/tests/e2e_tests -name "test*.py" | jq -R -s -c 'split("\n") | map(select(. != ""))')
111-
echo "Detected test files: $test_files"
112-
echo "::set-output name=test-files::$test_files"
113-
shell: bash
114-
115124
- name: Clone Subtensor repo
116125
working-directory: ${{ github.workspace }}
117126
run: git clone https://github.com/opentensor/subtensor.git
@@ -121,7 +130,5 @@ jobs:
121130
run: git checkout devnet-ready
122131

123132
- name: Run Bittensor SDK e2e test
124-
working-directory: ${{ github.workspace }}
125133
run: |
126-
source ${{ github.workspace }}/venv/bin/activate
127134
LOCALNET_SH_PATH="${{ github.workspace }}/subtensor/scripts/localnet.sh" pytest ${{ matrix.test-file }} -s

0 commit comments

Comments
 (0)