feat(jenkins): parse test_metadata from build description#1012
Open
fruch wants to merge 3 commits into
Open
Conversation
Add parse_test_metadata_from_description() that extracts SCT pipeline metadata (tier, test_type, duration_class, supported_backends) from the HTML block written to Jenkins build descriptions by SCT's createArgusTestRun.groovy (scylladb/scylla-cluster-tests#14818). Also adds JenkinsService.get_build_test_metadata() to fetch and parse metadata for a given job/build. NOTE: This PR only adds reading and parsing. Storage/persistence of the metadata on ArgusTest or SCTTestRun is left for a follow-up design discussion with the team.
Collaborator
Author
|
This is the suggested "interface" for the test metadata, it's gonna be available on the job description this PR is just ref to see where it should handled, it's not saving or doing anything with the metadata yet |
…ata parsing Add _JOB_METADATA_RE regex to parse ### TestMetadata blocks from Jenkins job descriptions (set during job creation by SCT). The job description format uses key: value lines instead of the HTML pipe-separated format. Both formats are now supported with job description taking priority. Added real-world test using longevity-10gb-3h pipeline output.
soyacz
reviewed
May 29, 2026
| _METADATA_RE = re.compile( | ||
| r"<b>Metadata:</b>\s*" | ||
| r"tier=(?P<tier>[^\s|]+)\s*\|\s*" | ||
| r"type=(?P<test_type>[^\s|]+)\s*\|\s*" |
Collaborator
There was a problem hiding this comment.
looks very fragile.
Why not using yaml/json/xml?
Add parse_test_metadata_from_config_xml() that reads the <testMetadata> XML element from Jenkins job config.xml. This is the primary source of truth — set at job creation, not editable via UI. The description parser remains as fallback for older jobs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
parse_test_metadata_from_description()utility that extracts SCT pipeline metadata (tier, test_type, duration_class, supported_backends) from Jenkins job descriptions### TestMetadatablock) and build description (HTML<b>Metadata:</b>block)JenkinsService.get_build_test_metadata()method to fetch and parse metadata for a given job/buildContext
SCT PR scylladb/scylla-cluster-tests#14818 adds
test_metadatato test-case YAML files and writes it to the Jenkins job description during job creation. The format in the job description is:The parser extracts the
### TestMetadatablock (key: value lines) from this description.A secondary HTML format is also supported for backward compatibility with
currentBuild.description:Scope
This PR only adds reading and parsing. Storage/persistence of the metadata (on
ArgusTest,SCTTestRun, or elsewhere) is intentionally left for a design discussion with the team.Discussion Points
ArgusTest(job-level, updated duringscan-jenkins)SCTTestRun(per-run, extracted fromsct_config)JenkinsMonitor.collect()callget_build_test_metadata()and store it during scans?