Skip to content

Commit 1b500e4

Browse files
committed
Add: nightly tests workflow
Signed-off-by: Natalia Wochtman <natalia.wochtman@intel.com> Signed-off-by: Pawel Staszczuk <pawel.staszczuk@intel.com>
1 parent 274025a commit 1b500e4

File tree

7 files changed

+206
-6
lines changed

7 files changed

+206
-6
lines changed

.github/workflows/nightly-tests.yml

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
name: nightly-tests-bare-metal
2+
on:
3+
push:
4+
branches:
5+
- nwochtma/nightly-tests
6+
env:
7+
BUILD_TYPE: 'Release'
8+
DPDK_VERSION: '25.03'
9+
DPDK_REBUILD: 'false'
10+
permissions:
11+
contents: read
12+
jobs:
13+
validation-build-mtl:
14+
runs-on: [Linux, self-hosted, DPDK]
15+
timeout-minutes: 60
16+
outputs:
17+
pipenv-activate: ${{ steps.pipenv-install.outputs.VIRTUAL_ENV }}
18+
steps:
19+
- name: 'preparation: Harden Runner'
20+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
21+
with:
22+
egress-policy: audit
23+
- name: 'preparation: Restore valid repository owner and print env'
24+
if: always()
25+
run: |
26+
sudo chown -R "${USER}" "$(pwd)" || true
27+
env | grep TEST_ || true
28+
- name: 'preparation: Checkout MTL'
29+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
with:
31+
ref: '${{ github.ref }}'
32+
- name: 'preparation: Checkout DPDK'
33+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
if: env.DPDK_REBUILD == 'true'
35+
with:
36+
repository: 'DPDK/dpdk'
37+
ref: 'v${{ env.DPDK_VERSION }}'
38+
path: 'dpdk'
39+
- name: 'preparation: Checkout openh264'
40+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
41+
with:
42+
repository: 'cisco/openh264'
43+
ref: 'openh264v2.4.0'
44+
path: 'openh264'
45+
- name: 'preparation: Checkout FFmpeg'
46+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
with:
48+
repository: 'FFmpeg/FFmpeg'
49+
ref: 'release/7.0'
50+
path: 'ffmpeg'
51+
- name: 'configuration: Install the build dependency'
52+
run: |
53+
sudo apt update
54+
sudo apt-get remove -y pipenv || true
55+
sudo apt-get install -y \
56+
git gcc meson tar zip \
57+
pkg-config \
58+
python3 \
59+
python3-pyelftools \
60+
python3-virtualenv \
61+
python3-pip \
62+
libnuma-dev \
63+
libjson-c-dev \
64+
libpcap-dev \
65+
libgtest-dev \
66+
libsdl2-dev \
67+
libsdl2-ttf-dev \
68+
libssl-dev \
69+
systemtap-sdt-dev \
70+
libbpf-dev \
71+
libelf1 \
72+
gstreamer1.0-plugins-base \
73+
gstreamer1.0-plugins-good \
74+
gstreamer1.0-tools \
75+
gstreamer1.0-libav \
76+
libgstreamer1.0-dev \
77+
libgstreamer-plugins-base1.0-dev
78+
- name: 'configuration: Apply dpdk patches'
79+
if: env.DPDK_REBUILD == 'true'
80+
run: |
81+
patch -d "dpdk" -p1 -i <(cat patches/dpdk/${{ env.DPDK_VERSION }}/*.patch)
82+
- name: 'installation: Build dpdk'
83+
working-directory: dpdk
84+
if: env.DPDK_REBUILD == 'true'
85+
run: |
86+
meson build
87+
ninja -C build
88+
sudo ninja -C build install
89+
- name: 'installation: Build mtl'
90+
run: |
91+
./build.sh
92+
sudo ldconfig
93+
- name: 'installation: Build openh264'
94+
working-directory: openh264
95+
run: |
96+
make -j "$(nproc)"
97+
sudo make install
98+
sudo ldconfig
99+
- name: 'installation: Build FFmpeg'
100+
working-directory: ffmpeg
101+
run: |
102+
git am ../ecosystem/ffmpeg_plugin/7.0/*.patch
103+
cp ../ecosystem/ffmpeg_plugin/mtl_*.c -rf libavdevice/
104+
cp ../ecosystem/ffmpeg_plugin/mtl_*.h -rf libavdevice/
105+
./configure --enable-shared --disable-static --enable-nonfree --enable-pic --enable-gpl --enable-libopenh264 --enable-encoder=libopenh264 --enable-mtl
106+
make -j "$(nproc)"
107+
sudo make install
108+
sudo ldconfig
109+
- name: 'installation: Build GStreamer'
110+
working-directory: ecosystem/gstreamer_plugin
111+
run: |
112+
./build.sh
113+
- name: 'installation: Install pipenv environment'
114+
working-directory: tests/validation
115+
id: pipenv-install
116+
run: |
117+
python3 -m venv venv
118+
source venv/bin/activate
119+
pip install -r requirements.txt
120+
echo "VIRTUAL_ENV=$PWD/venv/bin/activate" >> "$GITHUB_ENV"
121+
validation-run-tests:
122+
needs: [validation-build-mtl]
123+
runs-on: [Linux, self-hosted, DPDK]
124+
timeout-minutes: 720
125+
env:
126+
PYTEST_RETRIES: '3'
127+
steps:
128+
- name: 'preparation: Harden Runner'
129+
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
130+
with:
131+
egress-policy: audit
132+
- name: 'preparation: Evaluate choosen validation-test-port-p and validation-test-port-r'
133+
run: |
134+
eval "export TEST_PORT_P=TEST_VF_PORT_P_0"
135+
eval "export TEST_PORT_R=TEST_VF_PORT_P_1"
136+
echo "TEST_PORT_P=${TEST_PORT_P}" >> "$GITHUB_ENV"
137+
echo "TEST_PORT_R=${TEST_PORT_R}" >> "$GITHUB_ENV"
138+
echo "TEST_PORT_P=${TEST_PORT_P}"
139+
echo "TEST_PORT_R=${TEST_PORT_R}"
140+
- name: 'preparation: Kill MtlManager and pytest routines'
141+
run: |
142+
sudo killall -SIGINT pipenv || true
143+
sudo killall -SIGINT pytest || true
144+
sudo killall -SIGINT MtlManager || true
145+
- name: 'preparation: Create VFs'
146+
run: |
147+
sudo rmmod irdma || true
148+
sudo ./script/nicctl.sh create_vf "${TEST_PF_PORT_P}" || true
149+
sudo ./script/nicctl.sh create_vf "${TEST_PF_PORT_R}" || true
150+
- name: 'preparation: Start MtlManager at background'
151+
run: |
152+
sudo MtlManager &
153+
- name: 'execution: Run nightly-bare-metal tests in virtual environment'
154+
run: |
155+
sudo tests/validation/venv/bin/python3 -m pytest --topology_config=tests/validation/configs/topology_config.yaml --test_config=tests/validation/configs/test_config.yaml -m nightly --template=html/index.html --report=report.html
156+
- name: "upload report"
157+
id: upload-report
158+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
159+
with:
160+
name: nightly-tests-report
161+
path: |
162+
report.html
163+
- name: "Add report to summary"
164+
if: always()
165+
run: |
166+
{
167+
echo "## Nightly Tests Report"
168+
echo ""
169+
# Check if JSON report exists
170+
if [ -f "report.json" ]; then
171+
# Parse JSON report
172+
PASSED=$(jq '.summary.passed // 0' report.json)
173+
FAILED=$(jq '.summary.failed // 0' report.json)
174+
SKIPPED=$(jq '.summary.skipped // 0' report.json)
175+
ERROR=$(jq '.summary.errors // 0' report.json)
176+
# Add summary stats
177+
echo "| Status | Count |"
178+
echo "| ------ | ----- |"
179+
echo "| ✅ Passed | ${PASSED:-0} |"
180+
echo "| ❌ Failed | ${FAILED:-0} |"
181+
echo "| ⚠️ Error | ${ERROR:-0} |"
182+
echo "| ⏭️ Skipped | ${SKIPPED:-0} |"
183+
echo ""
184+
# Add test result details if available
185+
TOTAL=$((${PASSED:-0} + ${FAILED:-0} + ${ERROR:-0} + ${SKIPPED:-0}))
186+
echo "**Total Tests:** $TOTAL"
187+
echo ""
188+
if [ "${FAILED:-0}" -gt 0 ] || [ "${ERROR:-0}" -gt 0 ]; then
189+
echo "❌ **Some tests failed!** Please check the detailed report."
190+
else
191+
echo "✅ **All tests passed!**"
192+
fi
193+
echo ""
194+
# Add link to full report artifact
195+
echo "📄 [Download Full HTML Report](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/artifacts/${{ steps.upload-report.outputs.artifact-id }})"
196+
else
197+
echo "❌ No report.json file was generated"
198+
fi
199+
} >> "$GITHUB_STEP_SUMMARY"

tests/validation/pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
log_file=./tests/validation/pytest.log
33
markers=
44
smoke: mark test as part of the smoke test suite
5+
nightly: mark test as part of the nightly test suite

tests/validation/tests/single/st20p/format/test_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pytest
77
from mtl_engine.media_files import yuv_files_422p10le, yuv_files_422rfc10
88

9-
9+
@pytest.mark.nightly
1010
@pytest.mark.parametrize("file", yuv_files_422p10le.keys())
1111
def test_422p10le(
1212
hosts,

tests/validation/tests/single/st20p/fps/test_fps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pytest
77
from mtl_engine.media_files import yuv_files_422rfc10
88

9-
9+
@pytest.mark.nightly
1010
@pytest.mark.parametrize(
1111
"fps",
1212
[

tests/validation/tests/single/st20p/integrity/test_integrity.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"st20p_file, fps",
2020
[
2121
(yuv_files_422rfc10["Penguin_720p"], "p25"),
22-
(yuv_files_422rfc10["Penguin_1080p"], "p25"),
23-
(yuv_files_422p10le["Penguin_720p"], "p25"),
22+
pytest.param(yuv_files_422rfc10["Penguin_1080p"], "p25", marks=pytest.mark.nightly),
23+
pytest.param(yuv_files_422p10le["Penguin_720p"], "p25", marks=pytest.mark.nightly),
2424
(yuv_files_422p10le["Penguin_1080p"], "p25"),
2525
],
2626
)

tests/validation/tests/single/st20p/pacing/test_pacing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pytest
77
from mtl_engine.media_files import yuv_files_422rfc10
88

9-
9+
@pytest.mark.nightly
1010
@pytest.mark.parametrize("pacing", ["narrow", "wide", "linear"])
1111
@pytest.mark.parametrize("file", ["Crosswalk_720p", "ParkJoy_1080p", "Pedestrian_4K"])
1212
def test_pacing(

tests/validation/tests/single/st20p/packing/test_packing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pytest
77
from mtl_engine.media_files import yuv_files_422rfc10
88

9-
9+
@pytest.mark.nightly
1010
@pytest.mark.parametrize("packing", ["GPM_SL", "GPM"])
1111
@pytest.mark.parametrize("file", ["Crosswalk_720p", "ParkJoy_1080p", "Pedestrian_4K"])
1212
def test_packing(

0 commit comments

Comments
 (0)