-
Notifications
You must be signed in to change notification settings - Fork 78
175 lines (173 loc) · 6.21 KB
/
nightly-pytest.yml
File metadata and controls
175 lines (173 loc) · 6.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: nightly-pytest
on:
# allow manually trigger
workflow_dispatch:
schedule:
- cron: '0 20 * * *' # Every day at 8 PM UTC
permissions:
contents: read
jobs:
run-pytest:
strategy:
matrix:
nic:
- e810
- e810-dell
- e830
dir:
- dma
- ffmpeg
- gstreamer
- kernel_socket
- performance
- ptp
- rss_mode
- rx_timing
- st20p
- st22p
- st30p
- st41
- udp
- virtio_user
- xdp
fail-fast: false
runs-on: ${{ matrix.nic }}
timeout-minutes: 720
steps:
- name: 'preparation: Harden Runner'
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
with:
egress-policy: audit
- name: 'preparation: Checkout MTL'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: '${{ github.ref }}'
- uses: ./.github/actions/build
- name: 'installation: Install pipenv environment'
working-directory: tests/validation
id: pipenv-install
run: |
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
- name: Create session ID
run: |
runner_name=${{ runner.name }}
echo "SESSION_ID=${runner_name##*-}" >> "$GITHUB_ENV"
- name: Set PCI device env variable
run: |
if [ "${{ matrix.nic }}" = "e810" ]; then
echo "PCI_DEVICE=8086:1592,8086:1592" >> "$GITHUB_ENV"
elif [ "${{ matrix.nic }}" = "e810-dell" ]; then
echo "PCI_DEVICE=8086:1592,8086:1592" >> "$GITHUB_ENV"
elif [ "${{ matrix.nic }}" = "e830" ]; then
echo "PCI_DEVICE=8086:12d2,8086:12d2" >> "$GITHUB_ENV"
fi
- name: Generate test framework config files
working-directory: tests/validation/configs
run: |
python3 gen_config.py \
--session_id ${{ env.SESSION_ID }} \
--mtl_path ${{ secrets.RUNNER_MTL_PATH }} \
--pci_device ${{ env.PCI_DEVICE }} \
--ip_address 127.0.0.1 \
--username ${{ secrets.RUNNER_USERNAME }} \
--key_path ${{ secrets.RUNNER_KEY_PATH }} \
--ebu_ip ${{ secrets.RUNNER_EBU_LIST_IP }} \
--ebu_user ${{ secrets.RUNNER_EBU_LIST_USER }} \
--ebu_password ${{ secrets.RUNNER_EBU_LIST_PASSWORD }}
- name: Export workflow tag for PCAP naming
shell: bash
run: |
echo "MTL_GITHUB_WORKFLOW=${{ github.workflow }}:${{ matrix.nic }}" >> "$GITHUB_ENV"
- name: 'preparation: Start MtlManager at background'
run: |
sudo MtlManager &
- name: 'execution: Run nightly-bare-metal tests in virtual environment'
working-directory: ./tests/validation
run: |
.venv/bin/python3 -m pytest \
--test_config=./configs/test_config.yaml \
--topology_config=./configs/topology_config.yaml \
-m nightly \
--template=html/index.html \
--report=report.html \
"./tests/single/${{ matrix.dir }}"
- name: 'collect: System status report'
if: always()
run: |
./script/status_report.sh
# Rename to include NIC info
for dir in mtl_system_status_*; do
if [ -d "$dir" ]; then
mv "$dir" "system-info-${{ matrix.nic }}-${{ matrix.dir }}"
break
fi
done
- name: "upload report python"
if: always()
id: upload-report
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: nightly-test-report-${{ matrix.nic }}-${{ matrix.dir }}
path: ./tests/validation/report.html
- name: "upload system info"
if: always()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: system-info-${{ matrix.nic }}-${{ matrix.dir }}
path: ./system-info-${{ matrix.nic }}-${{ matrix.dir }}
aggregate-python-reports:
needs: run-pytest
if: ${{ always() }}
runs-on: ubuntu-22.04
steps:
- name: 'preparation: Checkout MTL'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Download python report artifacts
uses: actions/download-artifact@f093f21ca4cfa7c75ccbbc2be54da76a0c7e1f05 # v4.4.3
with:
pattern: nightly-test-report-*
path: python-reports # Downloads all artifacts into this directory
merge-multiple: false # Each artifact in separate subdirectory
- name: Flatten report directory structure
run: |
cd python-reports
for dir in ./nightly-test-report-*; do
if [ -d "$dir" ] && [ -f "$dir/report.html" ]; then
mv "$dir/report.html" "${dir}.html"
rm -rf "$dir"
fi
done
ls -lh ./*.html
- name: Install report dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install pandas beautifulsoup4 openpyxl
- name: Combine python reports
id: combine
run: |
set -euo pipefail
OUTPUT_PATH=$(python3 .github/scripts/combine_reports.py \
--directory python-reports \
--timestamp \
--quiet \
--print-path)
if [ -z "${OUTPUT_PATH}" ]; then
echo "combine_reports.py did not emit an output path" >&2
exit 1
fi
if [ ! -f "${OUTPUT_PATH}" ]; then
echo "Combined report not found at ${OUTPUT_PATH}" >&2
echo "Available files:"
ls -la python-reports
exit 1
fi
echo "Combined report path: ${OUTPUT_PATH}"
printf 'report_path=%s\n' "$OUTPUT_PATH" >> "$GITHUB_OUTPUT"
- name: Upload combined python report
if: always()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: nightly-pytest-combined-report
path: ${{ steps.combine.outputs.report_path }}