Skip to content

Commit ebaa374

Browse files
authored
PyTest Migration (pulp-platform#144)
* Add PyTest-base testing infra for generic platform * Remove nvidia-pyindex install (not needed anymore) * Add nvidia channel to the pip config instead of via nvidia-pyindex (depreciated) * Update banshee.patch * Fix patch * Update banshee patch * Update CI docker * Update generic platform CI to use PyTest * Lint and format * Cleanup pytest.ini * Apply Calin's comments * Refactor to better support multiple platforms and add cortexm to pytest suite * Add PyTest suite for Siracusa and Siracusa Tiled * Alpha version of CI suite using PyTest for Siracusa and Siracusa Tiled * Add L2_DOUBLEBUFFER_MODELS to the pytest suite, add -s to debug slow test, fix generic runner * Fix typo * Make test use common build folder among a worker to improve compilation speed * Cleanup unused runners and increase timeout for L3 models * format and lint * Migrate Mempool tests to PyTest * Migrate Snitch, Chimera, and SoftHier tests to PyTest * Format and Lint * Migrate Snitch tiled tests to PyTest * Use the pytest suite in CI for CortexM platform * Add Siracusa Tiled with Neureka to the pytest suite * Format and lint * Fix SoftHier test runner call * Format and lint * Remove useless comments and add README for PyTest suite * Cleanup GitHub action for siracusa with neureka * Simplify siracusa tiled platform GitHub CI * Remove unused testRunner * Update ccache generation to use PyTest suite * Cleanup generate_test_param function * DMA test migration to pytest works but only when running test one by one (state contamination) * Move DMA test to pytest and update CI * Format and lint * Adapt the pytest suite and CI for the new test structure * Fix test path * Format and lint * Move internal deeploy test to pytest * Improve DeeployTest Readme * Apply code rabbit suggestions * Fix typo * Centralize runner logic for test suite and CLI * Add deeploy runners for the other platforms * Update README * Fix import * Format and lint * Format and lint * Fix import and sanitize build folder path * Move pytest.ini to project root and restrict tests to live in DeeployTest dir * Add back --profileUntiled flag * Linting * Update changelog and revert docker link (CI will fail) * Change docker link
1 parent 0b554e9 commit ebaa374

80 files changed

Lines changed: 3648 additions & 1876 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/_runner-chimera.yml

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ name: _runner-chimera
1414
docker-image:
1515
required: true
1616
type: string
17-
test-names:
18-
required: true
19-
type: string
20-
simulators:
17+
pytest-marker:
2118
required: true
2219
type: string
2320

@@ -39,22 +36,11 @@ jobs:
3936
with:
4037
path: /app/.ccache
4138
key: ccache-ci
42-
- name: Run Test
39+
- name: Run Test # VJUNG: Run tests with 4 parallel threads as GitHub action VM has 4 cores.
4340
run: |
44-
testNames="${{ inputs.test-names }}"
45-
simulators="${{inputs.simulators}}"
4641
cd DeeployTest
4742
mkdir -p /app/.ccache
4843
export CCACHE_DIR=/app/.ccache
4944
export CHIMERA_SDK_HOME=/app/install/chimera-sdk
50-
echo "$simulators" | while IFS= read -r simulator; do
51-
if [[ -n "$simulator" ]]; then
52-
echo "$testNames" | while IFS= read -r testName; do
53-
if [[ -n "$testName" ]]; then
54-
echo "Running test $testName using $simulator"
55-
python testRunner_chimera.py -t Tests/$testName --simulator=$simulator
56-
fi
57-
done
58-
fi
59-
done
45+
pytest test_platforms.py -v -n 4 -m "chimera and ${{ inputs.pytest-marker }}"
6046
shell: bash

.github/workflows/_runner-cortexm.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ name: _runner-cortexm
1414
docker-image:
1515
required: true
1616
type: string
17-
test-names:
17+
pytest-marker:
1818
required: true
1919
type: string
2020

@@ -36,16 +36,10 @@ jobs:
3636
with:
3737
path: /app/.ccache
3838
key: ccache-ci
39-
- name: Run Test
39+
- name: Run Test # VJUNG: Run tests with 4 parallel threads as GitHub action VM has 4 cores.
4040
run: |
41-
testNames="${{ inputs.test-names }}"
4241
cd DeeployTest
4342
mkdir -p /app/.ccache
4443
export CCACHE_DIR=/app/.ccache
45-
echo "$testNames" | while IFS= read -r testName; do
46-
if [[ -n "$testName" ]]; then
47-
echo "Running test: $testName"
48-
python testRunner_cortexm.py -t Tests/$testName
49-
fi
50-
done
44+
pytest test_platforms.py -v -n 4 -m "cortexm and ${{ inputs.pytest-marker }}"
5145
shell: bash

.github/workflows/_runner-generic.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ name: _runner-generic
1414
docker-image:
1515
required: true
1616
type: string
17-
test-names:
17+
pytest-marker:
1818
required: true
1919
type: string
2020

@@ -36,16 +36,10 @@ jobs:
3636
with:
3737
path: /app/.ccache
3838
key: ccache-ci
39-
- name: Run Test
39+
- name: Run Test # VJUNG: Run tests with 4 parallel threads as GitHub action VM has 4 cores.
4040
run: |
41-
testNames="${{ inputs.test-names }}"
4241
cd DeeployTest
4342
mkdir -p /app/.ccache
4443
export CCACHE_DIR=/app/.ccache
45-
echo "$testNames" | while IFS= read -r testName; do
46-
if [[ -n "$testName" ]]; then
47-
echo "Running test: $testName"
48-
python testRunner_generic.py -t Tests/$testName
49-
fi
50-
done
44+
pytest test_platforms.py -v -n 4 -m "generic and ${{ inputs.pytest-marker }}"
5145
shell: bash

.github/workflows/_runner-mempool.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ name: _runner-mempool
1414
docker-image:
1515
required: true
1616
type: string
17-
test-names:
17+
pytest-marker:
1818
required: true
1919
type: string
2020

@@ -36,16 +36,10 @@ jobs:
3636
with:
3737
path: /app/.ccache
3838
key: ccache-ci
39-
- name: Run Test
39+
- name: Run Test # VJUNG: Run tests with 4 parallel threads as GitHub action VM has 4 cores.
4040
run: |
41-
testNames="${{ inputs.test-names }}"
4241
cd DeeployTest
4342
mkdir -p /app/.ccache
4443
export CCACHE_DIR=/app/.ccache
45-
echo "$testNames" | while IFS= read -r testName; do
46-
if [[ -n "$testName" ]]; then
47-
echo "Running test: $testName"
48-
python testRunner_mempool.py -t Tests/$testName
49-
fi
50-
done
44+
pytest test_platforms.py -v -n 4 -m "mempool and ${{ inputs.pytest-marker }}"
5145
shell: bash

.github/workflows/_runner-siracusa-neureka-tiled-sequential.yml

Lines changed: 0 additions & 84 deletions
This file was deleted.

.github/workflows/_runner-siracusa-neureka-tiled.yml

Lines changed: 9 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
---
6-
name: _runner-siracusa-neureka-tiled
6+
name: _runner-siracusa-neureka-tiled-sequential
77

88
"on":
99
workflow_call:
@@ -14,44 +14,12 @@ name: _runner-siracusa-neureka-tiled
1414
docker-image:
1515
required: true
1616
type: string
17-
test-name:
17+
pytest-marker:
1818
required: true
1919
type: string
20-
num-cores:
21-
required: false
22-
default: 8
23-
type: number
24-
L1:
25-
required: false
26-
default: "[64000]"
27-
type: string
28-
default-memory-level:
29-
required: false
30-
default: "L2"
31-
type: string
32-
double-buffer:
33-
required: false
34-
default: false
35-
type: boolean
36-
memory-allocation-strategy:
37-
required: false
38-
default: "MiniMalloc"
39-
type: string
40-
search-strategy:
41-
required: false
42-
default: "random-max"
43-
type: string
44-
neureka-wmem:
45-
required: false
46-
default: false
47-
type: boolean
4820

4921
jobs:
5022
test-runner-siracusa-neureka-tiled:
51-
strategy:
52-
fail-fast: false
53-
matrix:
54-
L1: ${{ fromJSON(inputs.L1) }}
5523
runs-on: ${{ inputs.runner }}
5624
container:
5725
image: ${{ inputs.docker-image }}
@@ -63,20 +31,10 @@ jobs:
6331
- name: Build Deeploy
6432
shell: bash
6533
run: pip install -e .
66-
- name: Cache ccache
67-
uses: actions/cache/restore@v4
68-
with:
69-
path: /app/.ccache
70-
key: ccache-ci
71-
- name: Run Test
72-
uses: nick-fields/retry@v3
73-
with:
74-
timeout_minutes: 5
75-
max_attempts: 3
76-
retry_on: timeout
77-
command: |
78-
cd DeeployTest
79-
mkdir -p /app/.ccache
80-
export CCACHE_DIR=/app/.ccache
81-
python testRunner_tiled_siracusa_w_neureka.py -t Tests/${{ inputs.test-name }} --cores=${{ inputs.num-cores }} --l1 ${{ matrix.L1 }} --defaultMemLevel=${{ inputs.default-memory-level }} ${{ inputs.double-buffer && '--doublebuffer' || '' }} ${{ inputs.neureka-wmem && '--neureka-wmem' || '' }} --memAllocStrategy=${{ inputs.memory-allocation-strategy }} --searchStrategy=${{ inputs.search-strategy }}
82-
shell: bash
34+
- name: Run Test # VJUNG: Run tests with 4 parallel threads as GitHub action VM has 4 cores.
35+
run: |
36+
cd DeeployTest
37+
mkdir -p /app/.ccache
38+
export CCACHE_DIR=/app/.ccache
39+
pytest test_platforms.py -v -n 4 -m "siracusa_neureka_tiled and ${{ inputs.pytest-marker }}"
40+
shell: bash

.github/workflows/_runner-siracusa-tiled-sequential.yml

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)