@@ -139,7 +139,6 @@ runs:
139
139
if [ "${{ inputs.device }}" = "cpu" ]; then
140
140
DEVICE_ARGS="--markers='not gpu'"
141
141
else
142
- # For GPU runners, no need to skip GPU tests
143
142
DEVICE_ARGS=""
144
143
fi
145
144
@@ -149,33 +148,33 @@ runs:
149
148
--durations=10 \
150
149
--durations-min=1.0 \
151
150
--timeout=${{ inputs.max-test-time }} \
152
- --json-report --json-report-file=pytest.json \
151
+ --verbosity=0 \
152
+ --durations-only \
153
153
$DEVICE_ARGS
154
154
155
- # Store test result
156
- echo "success=$?" >> $GITHUB_OUTPUT
155
+ # Store test result and duration
156
+ exit_code=$?
157
+ echo "success=$exit_code" >> $GITHUB_OUTPUT
157
158
158
- # Calculate duration
159
159
end_time=$(date +%s)
160
- echo "duration=$((end_time - start_time))" >> $GITHUB_OUTPUT
160
+ duration=$((end_time - start_time))
161
+ echo "duration=$duration" >> $GITHUB_OUTPUT
162
+
163
+ exit $exit_code
161
164
162
165
# Fail the workflow if tests failed
163
166
- name : Check test results
164
167
if : steps.test-execution.outputs.success != '0'
165
168
shell : bash
166
169
run : exit 1
167
170
168
- # Analyze and report test performance
169
- - name : Analyze test performance
170
- if : always() # Run even if tests fail
171
+ # Analyze test performance
172
+ - name : Check test duration
173
+ if : always()
171
174
shell : bash
172
175
run : |
173
176
echo "Test Duration: ${{ steps.test-execution.outputs.duration }} seconds"
174
177
175
- # Report slowest tests for optimization
176
- echo "Top 10 slowest tests:"
177
- cat pytest.json | jq -r '.tests[] | select(.duration >= 1) | "\(.duration)s \(.name)"' | sort -rn | head -n 10
178
-
179
178
# Warn if tests exceed time limit
180
179
if [ "${{ steps.test-execution.outputs.duration }}" -gt "${{ inputs.max-test-time }}" ]; then
181
180
echo "::warning::Test suite exceeded recommended duration of ${{ inputs.max-test-time }} seconds"
0 commit comments