-
Notifications
You must be signed in to change notification settings - Fork 109
Expand file tree
/
Copy pathindustrial-edge-insights-time-series-tests.yml
More file actions
189 lines (169 loc) · 7.72 KB
/
industrial-edge-insights-time-series-tests.yml
File metadata and controls
189 lines (169 loc) · 7.72 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
---
# SPDX-FileCopyrightText: (C) 2026 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: "[Industrial Edge Insights Multimodal and Time Series] Functional Tests"
run-name: "[Industrial Edge Insights Multimodal and Time Series] Functional Tests workflow (by @${{ github.actor }} via ${{ github.event_name }})"
on:
schedule:
- cron: '0 14 * * *' # 14:00 UTC daily
workflow_dispatch:
inputs:
tag:
description: 'Branch or tag to checkout (default: main)'
required: false
type: string
default: 'main'
build:
description: 'Build Docker images before running tests (yes/no)'
required: false
type: string
default: 'yes'
tests:
description: 'Which tests to run'
type: choice
options:
- all-tests
- timeseries-all
- multimodal-all
- test_docker_deployment_stability
- test_docker_deployment_weld_anomaly
- test_docker_deployment_wind_turbine
- test_docker_helm_deployment_security
- test_docker_influxdb_retention
- test_helm_deployment_weld_anomaly
- test_helm_deployment_wind_turbine
- test_helm_influxdb_retention
- test_docker_deployment_multimodal
- test_helm_deployment_multimodal
default: all-tests
workflow_call:
inputs:
tag:
description: 'Branch or tag to checkout (default: main)'
required: false
type: string
default: 'main'
build:
description: 'Build Docker images before running tests (yes/no)'
required: false
type: string
default: 'yes'
tests:
description: 'Which tests to run (all-tests, timeseries-all, multimodal-all, or specific test file name)'
required: false
type: string
default: 'all-tests'
permissions: {}
jobs:
functional-tests:
name: Functional Tests for Multimodal and TimeSeries
runs-on: ubuntu-24.04
permissions:
contents: read
packages: read
steps:
- name: Checkout current repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ inputs.tag || 'main' }}
persist-credentials: false
- name: Checkout Time Series Analytics microservice (edge-ai-libraries)
if: ${{ inputs.build != 'no' || inputs.tag == 'main' }}
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: open-edge-platform/edge-ai-libraries
ref: ${{ inputs.tag || 'main' }}
path: edge-ai-libraries
persist-credentials: false
- name: Building Time Series Analytics microservices
if: ${{ inputs.build != 'no' || inputs.tag == 'main' }}
run: |
cd ./edge-ai-libraries/microservices/time-series-analytics/docker
docker compose down -v
docker compose build
- name: Building Multimodal Sample App images
if: ${{ inputs.build != 'no' || inputs.tag == 'main' }}
run: |
cd "${{ github.workspace }}/manufacturing-ai-suite/industrial-edge-insights-multimodal/"
make down
make build
- name: Building Time Series Sample App images
if: ${{ inputs.build != 'no' || inputs.tag == 'main' }}
run: |
cd "${{ github.workspace }}/manufacturing-ai-suite/industrial-edge-insights-time-series/"
make down
make build
- name: Install k3s
run: |
curl -sfL https://get.k3s.io | INSTALL_K3S_SELINUX_WARN=true INSTALL_K3S_VERSION=${K3S_VERSION} \
sh -s - --disable=traefik --write-kubeconfig-mode=644
echo "KUBECONFIG=/etc/rancher/k3s/k3s.yaml" >> "$GITHUB_ENV"
- name: Load images into k3s
if: ${{ inputs.build != 'no' || inputs.tag == 'main' }}
run: |
echo "Loading docker images into k3s..."
docker images --format "{{.Repository}}:{{.Tag}}" | grep "^intel/ia-" | grep -v "<none>" | while read image; do
echo "Importing image: $image"
docker save "$image" | sudo k3s ctr images import -
done
- name: Run Time Series Sample Apps functional tests
env:
TESTS: ${{ inputs.tests || 'all-tests' }}
run: |
# Timeseries-specific test files
TIMESERIES_TESTS="test_docker_deployment_stability test_docker_deployment_weld_anomaly \
test_docker_deployment_wind_turbine test_docker_helm_deployment_security \
test_docker_influxdb_retention test_helm_deployment_weld_anomaly \
test_helm_deployment_wind_turbine test_helm_influxdb_retention"
# Skip if only multimodal tests are selected
if [[ "$TESTS" == "multimodal-all" || "$TESTS" == "test_docker_deployment_multimodal" || "$TESTS" == "test_helm_deployment_multimodal" ]]; then
echo "Skipping time-series tests (only multimodal tests selected)"
exit 0
fi
cd "${{ github.workspace }}/manufacturing-ai-suite/industrial-edge-insights-time-series/tests/functional"
echo "Running Time Series Sample Apps functional tests"
python3 -m venv env
source env/bin/activate
pip3 install -r ../requirements.txt
rm -rf /tmp/test_timeseries_report/report.html
# Run specific test file if selected, otherwise run all tests
if echo "$TIMESERIES_TESTS" | grep -qw "$TESTS"; then
pytest -q -vv --self-contained-html --html=/tmp/test_timeseries_report/report.html "${TESTS}.py"
else
pytest -q -vv --self-contained-html --html=/tmp/test_timeseries_report/report.html
fi
deactivate
- name: Upload Time Series Sample Apps HTML test report to GitHub
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: timeseries-test-report
path: /tmp/test_timeseries_report
- name: Run Multimodal Weld Defect Detection Sample Apps functional tests
env:
TESTS: ${{ inputs.tests || 'all-tests' }}
run: |
# Multimodal-specific test files
MULTIMODAL_TESTS="test_docker_deployment_multimodal test_helm_deployment_multimodal"
# Skip if only timeseries tests are selected
if [[ "$TESTS" == "timeseries-all" ]] || echo "$TESTS" | grep -qw "test_docker_deployment_stability\|test_docker_deployment_weld_anomaly\|test_docker_deployment_wind_turbine\|test_docker_helm_deployment_security\|test_docker_influxdb_retention\|test_helm_deployment_weld_anomaly\|test_helm_deployment_wind_turbine\|test_helm_influxdb_retention"; then
echo "Skipping multimodal tests (only time-series tests selected)"
exit 0
fi
cd "${{ github.workspace }}/manufacturing-ai-suite/industrial-edge-insights-multimodal/tests/functional"
echo "Running Multimodal Weld Defect Detection Sample Apps functional tests"
python3 -m venv env
source env/bin/activate
pip3 install -r ../requirements.txt
rm -rf /tmp/test_multimodal_report/report.html
# Run specific test file if selected, otherwise run all tests
if echo "$MULTIMODAL_TESTS" | grep -qw "$TESTS"; then
pytest -q -vv --self-contained-html --html=/tmp/test_multimodal_report/report.html "${TESTS}.py"
else
pytest -q -vv --self-contained-html --html=/tmp/test_multimodal_report/report.html
fi
deactivate
- name: Upload Multimodal Weld Defect Detection Sample Apps HTML test report to GitHub
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: multimodal-test-report
path: /tmp/test_multimodal_report