Skip to content

Commit 358591e

Browse files
authored
added helm tests for metro and ird apps PR jobs
1 parent daf7fe3 commit 358591e

File tree

3 files changed

+150
-1
lines changed

3 files changed

+150
-1
lines changed

.github/workflows/metro_vision_ai_app_recipe_pull_request.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,12 @@ jobs:
146146
uses: actions/upload-artifact@v4
147147
with:
148148
name: Trivy Report - Config scan for Helm
149-
path: metro-ai-suite/metro-vision-ai-app-recipe/trivy-helm.txt
149+
path: metro-ai-suite/metro-vision-ai-app-recipe/trivy-helm.txt
150+
sanity:
151+
uses: ./.github/workflows/metro_vision_ai_app_recipe_sanity.yaml
152+
with:
153+
branch: ${{ github.head_ref }}
154+
secrets: inherit
155+
permissions:
156+
contents: read
157+
packages: write
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: "[metro-vision-ai-app-recipe] Sanity Workflow"
2+
3+
on:
4+
workflow_dispatch: # allows manual trigger
5+
inputs:
6+
branch:
7+
description: "Branch to run job on"
8+
required: false
9+
default: "main"
10+
11+
workflow_call: # allows being called from another workflow
12+
inputs:
13+
branch:
14+
description: "Branch to run job on"
15+
required: false
16+
type: string
17+
18+
jobs:
19+
sanity:
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
packages: write
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
include:
28+
- ubuntu_version: ubuntu22
29+
steps:
30+
- name: Determine branch
31+
id: get_branch
32+
run: |
33+
if [ -n "${{ inputs.branch }}" ]; then
34+
echo "branch=${{ inputs.branch }}" >> $GITHUB_OUTPUT
35+
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
36+
echo "branch=${{ github.event.inputs.branch }}" >> $GITHUB_OUTPUT
37+
else
38+
echo "branch=${{ github.ref_name }}" >> $GITHUB_OUTPUT
39+
fi
40+
- name: Check out edge-ai-suites repository
41+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #4.2.2
42+
with:
43+
persist-credentials: false
44+
path: edge-ai-suites-repo
45+
ref: ${{ steps.get_branch.outputs.branch }}
46+
- name: Set up Python
47+
uses: actions/setup-python@v5
48+
with:
49+
python-version: '3.10'
50+
- name: Log in to GitHub Container Registry
51+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 #3.4.0
52+
with:
53+
registry: ghcr.io
54+
username: ${{ github.actor }}
55+
password: ${{ secrets.GITHUB_TOKEN }}
56+
- name: Sanity Test
57+
run: |
58+
sudo apt-get update
59+
sudo pip install robotframework
60+
lspci | grep -i vga
61+
sudo apt install -y python3-nose libxml2-utils vlc
62+
sudo pip install selenium
63+
cd edge-ai-suites-repo/metro-ai-suite/metro-vision-ai-app-recipe/test-suite/robot_files
64+
robot test.robot || true &
65+
sleep 480
66+
docker logs dlstreamer-pipeline-server >> dlsps_logs.txt &
67+
wait
68+
mkdir -p /tmp/test_results
69+
cp -r report.html log.html output.xml dlsps_logs.txt /tmp/test_results/
70+
passed=$(xmllint --xpath "//return/status[@status='PASS']" ./output.xml | wc -l) || true
71+
failed=$(xmllint --xpath "//return/status[@status='FAIL']" ./output.xml | wc -l) || true
72+
not_run=$(xmllint --xpath "//return/status[@status='NOT RUN']" ./output.xml | wc -l) || true
73+
total=$((passed + failed + not_run))
74+
echo "### Sanity Test Summary" >> $GITHUB_STEP_SUMMARY
75+
echo "- Total: $total" >> $GITHUB_STEP_SUMMARY
76+
echo "- ✅ Passed: $passed" >> $GITHUB_STEP_SUMMARY
77+
echo "- ❌ Failed: $failed" >> $GITHUB_STEP_SUMMARY
78+
echo "- ⏭️ Not Run: $not_run" >> $GITHUB_STEP_SUMMARY
79+
echo "- 📄 [Full Report](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY
80+
- name: Helm Sanity Test
81+
run: |
82+
sudo apt-get update
83+
sudo pip install robotframework
84+
lspci | grep -i vga
85+
sudo apt install -y python3-nose libxml2-utils vlc
86+
cd edge-ai-suites-repo/metro-ai-suite/metro-vision-ai-app-recipe/test-suite/robot_files
87+
robot test_helm.robot || true &
88+
sleep 480
89+
docker logs dlstreamer-pipeline-server >> dlsps_logs.txt &
90+
wait
91+
mkdir -p /tmp/test_results/Helm
92+
cp -r report.html log.html output.xml dlsps_logs.txt /tmp/test_results/Helm
93+
passed=$(xmllint --xpath "//return/status[@status='PASS']" ./output.xml | wc -l) || true
94+
failed=$(xmllint --xpath "//return/status[@status='FAIL']" ./output.xml | wc -l) || true
95+
not_run=$(xmllint --xpath "//return/status[@status='NOT RUN']" ./output.xml | wc -l) || true
96+
total=$((passed + failed + not_run))
97+
echo "### Sanity Test Summary" >> $GITHUB_STEP_SUMMARY
98+
echo "- Total: $total" >> $GITHUB_STEP_SUMMARY
99+
echo "- ✅ Passed: $passed" >> $GITHUB_STEP_SUMMARY
100+
echo "- ❌ Failed: $failed" >> $GITHUB_STEP_SUMMARY
101+
echo "- ⏭️ Not Run: $not_run" >> $GITHUB_STEP_SUMMARY
102+
echo "- 📄 [Full Report](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY
103+
- name: Upload Scan artifact to Github
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: Sanity_Reports
107+
path: /tmp/test_results/*
108+
- name: Clean up
109+
if: always()
110+
run: |
111+
sudo rm -rf edge-ai-suites-repo
112+
if [ -n "$(docker images -aq)" ]; then
113+
docker rmi -f $(docker images -aq) || true
114+
fi
115+
sudo rm -rf /tmp/test_results/*
116+
117+
118+

.github/workflows/spineapp_sanity.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,29 @@ jobs:
7676
echo "- ❌ Failed: $failed" >> $GITHUB_STEP_SUMMARY
7777
echo "- ⏭️ Not Run: $not_run" >> $GITHUB_STEP_SUMMARY
7878
echo "- 📄 [Full Report](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY
79+
- name: Helm Sanity Test
80+
run: |
81+
sudo apt-get update
82+
sudo pip install robotframework
83+
lspci | grep -i vga
84+
sudo apt install -y python3-nose libxml2-utils vlc
85+
cd edge-ai-suites-repo/manufacturing-ai-suite/industrial-edge-insights-vision/tests/robot_files
86+
robot test_helm.robot || true &
87+
sleep 480
88+
docker logs dlstreamer-pipeline-server >> dlsps_logs.txt &
89+
wait
90+
mkdir -p /tmp/test_results
91+
cp -r report.html log.html output.xml dlsps_logs.txt /tmp/test_results/
92+
passed=$(xmllint --xpath "//return/status[@status='PASS']" ./output.xml | wc -l) || true
93+
failed=$(xmllint --xpath "//return/status[@status='FAIL']" ./output.xml | wc -l) || true
94+
not_run=$(xmllint --xpath "//return/status[@status='NOT RUN']" ./output.xml | wc -l) || true
95+
total=$((passed + failed + not_run))
96+
echo "### Sanity Test Summary" >> $GITHUB_STEP_SUMMARY
97+
echo "- Total: $total" >> $GITHUB_STEP_SUMMARY
98+
echo "- ✅ Passed: $passed" >> $GITHUB_STEP_SUMMARY
99+
echo "- ❌ Failed: $failed" >> $GITHUB_STEP_SUMMARY
100+
echo "- ⏭️ Not Run: $not_run" >> $GITHUB_STEP_SUMMARY
101+
echo "- 📄 [Full Report](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY
79102
- name: Upload Scan artifact to Github
80103
uses: actions/upload-artifact@v4
81104
with:

0 commit comments

Comments
 (0)