Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
e4faec9f
Unverified
Commit
e4faec9f
authored
Oct 31, 2025
by
Nate Mailhot
Committed by
GitHub
Oct 31, 2025
Browse files
fix: test uploading to not overwrite itself for pytest trtllm, sglang, and vllm jobs (#3859)
parent
677e9b7f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
9 deletions
+68
-9
.github/actions/pytest/action.yml
.github/actions/pytest/action.yml
+20
-6
.github/workflows/upload_complete_workflow_metrics.py
.github/workflows/upload_complete_workflow_metrics.py
+48
-3
No files found.
.github/actions/pytest/action.yml
View file @
e4faec9f
...
@@ -73,6 +73,11 @@ runs:
...
@@ -73,6 +73,11 @@ runs:
shell
:
bash
shell
:
bash
run
:
|
run
:
|
# Sanitize test_type for filenames (always set this for artifact upload)
# Remove commas and spaces from test_type for use in filenames
STR_TEST_TYPE=$(echo "${{ inputs.test_type }}" | tr ', ' '_')
echo "STR_TEST_TYPE=${STR_TEST_TYPE}" >> $GITHUB_ENV
# Check for JUnit XML file and determine test status
# Check for JUnit XML file and determine test status
JUNIT_FILE="test-results/pytest_test_report.xml"
JUNIT_FILE="test-results/pytest_test_report.xml"
...
@@ -84,17 +89,24 @@ runs:
...
@@ -84,17 +89,24 @@ runs:
ERROR_TESTS=$(grep -o 'errors="[0-9]*"' "$JUNIT_FILE" | grep -o '[0-9]*' | head -1 || echo "0")
ERROR_TESTS=$(grep -o 'errors="[0-9]*"' "$JUNIT_FILE" | grep -o '[0-9]*' | head -1 || echo "0")
echo "📊 ${TOTAL_TESTS} tests completed (${FAILED_TESTS} failed, ${ERROR_TESTS} errors)"
echo "📊 ${TOTAL_TESTS} tests completed (${FAILED_TESTS} failed, ${ERROR_TESTS} errors)"
# Create metadata file with step context information
# Create uniquely named metadata file with step context information
METADATA_FILE="test-results/test_metadata.json"
# Use framework-testtype-arch to make it unique per test run
METADATA_FILE="test-results/test_metadata_${{ inputs.framework }}_${STR_TEST_TYPE}_${{ inputs.platform_arch }}.json"
JUNIT_NAME="pytest_test_report_${{ inputs.framework }}_${STR_TEST_TYPE}_${{ inputs.platform_arch }}.xml"
# Rename XML file to unique name
mv "$JUNIT_FILE" "test-results/$JUNIT_NAME"
echo '{' > "$METADATA_FILE"
echo '{' > "$METADATA_FILE"
echo ' "job_name": "${{ github.job }}",' >> "$METADATA_FILE"
echo ' "job_name": "${{ github.job }}",' >> "$METADATA_FILE"
echo ' "framework": "${{ inputs.framework }}",' >> "$METADATA_FILE"
echo ' "framework": "${{ inputs.framework }}",' >> "$METADATA_FILE"
echo ' "test_type": "${{ inputs.test_type }}",' >> "$METADATA_FILE"
echo ' "test_type": "${{ inputs.test_type }}",' >> "$METADATA_FILE"
echo ' "platform_arch": "${{ inputs.platform_arch }}",' >> "$METADATA_FILE"
echo ' "platform_arch": "${{ inputs.platform_arch }}",' >> "$METADATA_FILE"
echo ' "junit_xml_file": "
pytest_test_report.xml
",' >> "$METADATA_FILE"
echo ' "junit_xml_file": "
'"$JUNIT_NAME"'
",' >> "$METADATA_FILE"
echo ' "step_name": "Run ${{ inputs.test_type }} tests"' >> "$METADATA_FILE"
echo ' "step_name": "Run ${{ inputs.test_type }} tests"' >> "$METADATA_FILE"
echo '}' >> "$METADATA_FILE"
echo '}' >> "$METADATA_FILE"
echo "📝 Created test metadata file"
echo "📝 Created test metadata file: $METADATA_FILE"
echo "📝 Renamed XML file to: $JUNIT_NAME"
else
else
echo "⚠️ JUnit XML file not found - test results may not be available for upload"
echo "⚠️ JUnit XML file not found - test results may not be available for upload"
TOTAL_TESTS=0
TOTAL_TESTS=0
...
@@ -109,6 +121,8 @@ runs:
...
@@ -109,6 +121,8 @@ runs:
uses
:
actions/upload-artifact@v4
uses
:
actions/upload-artifact@v4
if
:
always()
# Always upload test results, even if tests failed
if
:
always()
# Always upload test results, even if tests failed
with
:
with
:
name
:
test-results-${{ inputs.framework }}-${{ inputs.test_type }}-${{ env.PLATFORM_ARCH }}
name
:
test-results-${{ inputs.framework }}-${{ env.STR_TEST_TYPE }}-${{ env.PLATFORM_ARCH }}
path
:
test-results/${{ env.PYTEST_XML_FILE }}
path
:
|
test-results/pytest_test_report_${{ inputs.framework }}_${{ env.STR_TEST_TYPE }}_${{ inputs.platform_arch }}.xml
test-results/test_metadata_${{ inputs.framework }}_${{ env.STR_TEST_TYPE }}_${{ inputs.platform_arch }}.json
retention-days
:
7
retention-days
:
7
\ No newline at end of file
.github/workflows/upload_complete_workflow_metrics.py
View file @
e4faec9f
...
@@ -825,8 +825,45 @@ class WorkflowMetricsUploader:
...
@@ -825,8 +825,45 @@ class WorkflowMetricsUploader:
job_name
=
job_data
.
get
(
"name"
,
""
)
job_name
=
job_data
.
get
(
"name"
,
""
)
job_id
=
str
(
job_data
[
"id"
])
job_id
=
str
(
job_data
[
"id"
])
# Skip deployment test jobs (No pytest metadata files are created)
if
job_name
.
lower
().
startswith
(
"deploy"
):
print
(
f
"⏭️ Skipping test metrics for deployment job '
{
job_name
}
'"
)
return
print
(
f
"🧪 Looking for test results for job '
{
job_name
}
'"
)
print
(
f
"🧪 Looking for test results for job '
{
job_name
}
'"
)
# Determine framework from job name to filter metadata files
framework
=
None
job_name_lower
=
job_name
.
lower
()
if
"vllm"
in
job_name_lower
:
framework
=
"vllm"
elif
"sglang"
in
job_name_lower
:
framework
=
"sglang"
elif
"trtllm"
in
job_name_lower
:
framework
=
"trtllm"
if
not
framework
:
print
(
f
"⚠️ Could not determine framework from job name:
{
job_name
}
"
)
return
# Determine platform architecture from job name
# Job names typically look like: "vllm (amd64)" or "sglang (arm64)"
platform_arch
=
None
if
"(amd64)"
in
job_name_lower
or
"amd64"
in
job_name_lower
:
platform_arch
=
"amd64"
elif
"(arm64)"
in
job_name_lower
or
"arm64"
in
job_name_lower
:
platform_arch
=
"arm64"
if
not
platform_arch
:
print
(
f
"⚠️ Could not determine platform architecture from job name:
{
job_name
}
"
)
# Default to amd64 if not specified
platform_arch
=
"amd64"
print
(
f
" Defaulting to platform_arch:
{
platform_arch
}
"
)
print
(
f
"📦 Job framework:
{
framework
}
, platform_arch:
{
platform_arch
}
"
)
# Look for test results directory
# Look for test results directory
test_results_dir
=
"test-results"
test_results_dir
=
"test-results"
if
not
os
.
path
.
exists
(
test_results_dir
):
if
not
os
.
path
.
exists
(
test_results_dir
):
...
@@ -834,13 +871,21 @@ class WorkflowMetricsUploader:
...
@@ -834,13 +871,21 @@ class WorkflowMetricsUploader:
return
return
# Look for metadata files to get accurate step and framework info
# Look for metadata files to get accurate step and framework info
metadata_files
=
glob
.
glob
(
f
"
{
test_results_dir
}
/test_metadata.json"
)
# Updated pattern to match new unique naming: test_metadata_<framework>_<test_type>_<arch>.json
# Filter by both framework AND architecture to only process this job's tests
metadata_files
=
glob
.
glob
(
f
"
{
test_results_dir
}
/test_metadata_
{
framework
}
_*_
{
platform_arch
}
.json"
)
if
not
metadata_files
:
if
not
metadata_files
:
print
(
f
"⚠️ No test metadata files found in
{
test_results_dir
}
"
)
print
(
f
"⚠️ No test metadata files found for framework '
{
framework
}
' with arch '
{
platform_arch
}
' in
{
test_results_dir
}
"
)
return
return
print
(
f
"📄 Found
{
len
(
metadata_files
)
}
test metadata files"
)
print
(
f
"📄 Found
{
len
(
metadata_files
)
}
test metadata files for
{
framework
}
(
{
platform_arch
}
)"
)
total_tests_processed
=
0
total_tests_processed
=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment