Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
46ade39
Add -J-XX:MaxRAMPercentage=90.0 on graalpy native / libpythonvm builds
Ariouz Nov 25, 2025
0c67bfa
Fix PATH error on Linux/MacOS
Ariouz Nov 20, 2025
46d820e
Fix runner.os to Linux
Ariouz Nov 20, 2025
15af50b
Rm Unix Path for Windows runners
Ariouz Nov 20, 2025
58e48bf
Set GITHUB_CI in all envs
Ariouz Nov 24, 2025
622003e
Started to implement report merger
Ariouz Nov 25, 2025
79d28b4
add require(GPY_NATIVE_STANDALONE) to retagger to avoid compiling gra…
Ariouz Nov 25, 2025
5edf10e
Added MX_REPORT_SUFFIX as reports suffix
Ariouz Nov 25, 2025
e60ae1c
Init retagger-merger-gate
Ariouz Nov 26, 2025
aa2e15b
Merge reports into a mx compliant JSON file
Ariouz Nov 26, 2025
28ff20c
Wip: Run report merger and mx merge-tags-from-report
Ariouz Nov 26, 2025
071eb37
Add default platform value to merge-tags-from-report cmd
Ariouz Nov 27, 2025
40259a3
Fix merge gate run steps and artifact upload pattern
Ariouz Nov 27, 2025
9cfdf6d
Clean code
Ariouz Nov 27, 2025
3c166e5
test: python 3.12.8 on linux aarch64
Ariouz Dec 1, 2025
48b9175
Setup Weekly Retagger + PR jobs
Ariouz Dec 1, 2025
3984fdb
Test: aarch64 retagger jobs
Ariouz Dec 1, 2025
3c24e65
aarch64 not allowed in tier2: utils.jsonnet
Ariouz Dec 1, 2025
e33c8c3
tmp: retagger linux aarch64 on tier3, manually retag
Ariouz Dec 1, 2025
82eb9aa
Rm platforms loop for retagger merge job
Ariouz Dec 1, 2025
7965406
Applied retagger diff for linux aarch64 tests
Ariouz Dec 2, 2025
2f36c16
Merge branch 'master' into retag_reports_merging
Ariouz Dec 2, 2025
0082761
Applied remained retags from retagger
Ariouz Dec 2, 2025
752360a
Rm debugs
Ariouz Dec 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/scripts/extract_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"GITHUB_CI": "true"
}

PR_JOBS='^(?=.*python)(?!.*(retagger|dsl)).*$'

# If any of these terms are in the job json, they do not run in public
# infrastructure
Expand Down Expand Up @@ -208,6 +209,7 @@ def download_artifact(self) -> Artifact | None:
pattern = self.common_glob([a["name"] for a in artifacts])
return Artifact(pattern, os.path.normpath(artifacts[0].get("dir", ".")))
return None


@staticmethod
def flatten_command(args: list[str | list[str]]) -> list[str]:
Expand Down Expand Up @@ -293,6 +295,8 @@ def get_tagged_jobs(buildspec, target, filter=None):


def main(jsonnet_bin, ci_jsonnet, target, filter=None, indent=False):
if not filter: filter = PR_JOBS

result = subprocess.check_output([jsonnet_bin, ci_jsonnet], text=True)
buildspec = json.loads(result)
tagged_jobs = get_tagged_jobs(buildspec, target, filter=filter)
Expand Down
73 changes: 73 additions & 0 deletions .github/scripts/merge_retagger_results.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# ================================
#
# This script is used by ci to merge several retagger report JSON files, which is then used
# by running python3 runner.py merge-tags-from-reports reports-merged.json
#
# ================================

import os
import sys
import json
import glob
import argparse
from dataclasses import dataclass

# status we want to focus on
EXPORT_STATUS = ["FAILED"]

@dataclass
class Test:
name: str
status: str
duration: str


def read_report(path: str) -> list[Test]:
tests = []
with open(path) as f:
data = json.load(f)
for result in data:
name, status, duration = result.values()
if status in EXPORT_STATUS: tests.append(Test(f"{name}", status, duration))

return tests

def merge_tests(report: list[Test], merged: dict[str, dict]):
for test in report:
if test.name not in merged:
merged[test.name] = test.__dict__

def export_reports(merged: dict[str, dict], outfile: str):
with open(outfile, "w") as f:
json.dump(list(merged.values()), f)
print(f"=== Exported {len(merged)} ({EXPORT_STATUS}) tests to {f.name} ===")

def merge_reports(reports: list[str], outfile: str):
merged_reports = {}
for report in reports:
report_tests = read_report(report)
merge_tests(report_tests, merged_reports)

export_reports(merged_reports, outfile)

def main(outfile: str, source_dir: str, pattern: str):
path = f"{source_dir}/{pattern}"
files = glob.glob(path)
if len(files) == 0: raise FileNotFoundError("No report file found")

files = [file for file in files if file.endswith(".json")]
merge_reports(files, outfile)


if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Merge unittest retagger report JSON files")
parser.add_argument("--outfile", help="Output file name (optional)", default="reports-merged.json")
parser.add_argument("--dir", help="Reports files directory (optional)", default=".")
parser.add_argument("--pattern", default="*", help="Pattern matching for input files (optional)")

args = parser.parse_args()
main(
outfile=args.outfile,
source_dir=args.dir,
pattern=args.pattern
)
10 changes: 7 additions & 3 deletions .github/workflows/ci-matrix-gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
type: string
description: Job selection (Python regex)
required: false
pull_request:
schedule:
- cron: '0 0 * * 1'

jobs:
generate-tier1:
Expand All @@ -15,7 +18,7 @@ jobs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
env:
TARGET: tier1
JOBS: ${{ inputs.jobs_to_run }}
JOBS: ${{ inputs.jobs_to_run || (github.event_name == 'schedule' && 'python-svm-build-gate-linux|python-unittest-retagger|python-unittest-retagger-merge') || ''}}
steps: &generate_matrix
- uses: actions/checkout@v4
- name: Download sjsonnet
Expand Down Expand Up @@ -153,9 +156,10 @@ jobs:
uses: actions/download-artifact@v5
if: ${{ matrix.require_artifact }}
with:
name: ${{ matrix.require_artifact[0] }}
pattern: ${{ matrix.require_artifact[0] }}
merge-multiple: true
continue-on-error: true

- name: Export artifact paths Linux
if: ${{ matrix.require_artifact }}
run: |
Expand Down Expand Up @@ -203,8 +207,8 @@ jobs:
shell: bash
working-directory: main
run: |
tar cf ${{ matrix.provide_artifact[0] }}.tar ${{ matrix.provide_artifact[1] }}
ls && pwd
tar cf ${{ matrix.provide_artifact[0] }}.tar ${{ matrix.provide_artifact[1] }}
- name: Upload artifacts
if: ${{ matrix.provide_artifact }}
uses: actions/upload-artifact@v5
Expand Down
37 changes: 34 additions & 3 deletions ci.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
local GRAAL_JDK_LATEST = "graal-jdk-latest",
local TAGGED_UNITTESTS_SPLIT = 8,
local COVERAGE_SPLIT = 3,
local RETAGGER_SPLIT = 8,
local RETAGGER_SPLIT = 12,

// -----------------------------------------------------------------------------------------------------------------
// gates
Expand Down Expand Up @@ -242,8 +242,8 @@
"linux:amd64:jdk-latest" : tier1,
}),
"python-unittest-retagger": ut_retagger + platform_spec(no_jobs) + batches(RETAGGER_SPLIT) + platform_spec({
"linux:amd64:jdk-latest" : tier3,
"linux:aarch64:jdk-latest" : weekly + t("20:00:00"),
"linux:amd64:jdk-latest" : tier2 + require(GPY_NATIVE_STANDALONE),
"linux:aarch64:jdk-latest" : tier3 + require(GPY_NATIVE_STANDALONE),
"darwin:aarch64:jdk-latest" : weekly + t("20:00:00"),
"windows:amd64:jdk-latest" : weekly + t("20:00:00"),
}),
Expand Down Expand Up @@ -548,6 +548,37 @@
["git", "push", "--force", "origin", "published"],
]
},
{
name: "python-unittest-retagger-merge",
targets: ["tier3"],
capabilities: ["linux", "amd64"],
packages: {
mx: "7.34.1",
python3: "==3.12.8",
},
requireArtifacts: [
{
name: "python-unittest-retagger*",
dir: ".",
}
],
publishArtifacts: [
{
name: "retagger.diff",
dir: ".",
patterns: ["diff_reports"]
}
],
run: [
["mkdir", "-p", "../retagger-reports"],
["sh", "-c", "mv retagger-report*.json ../retagger-reports"],
["cd", "../retagger-reports"],
["python3", "../main/.github/scripts/merge_retagger_results.py"],
["cd", "../main"],
["python3", "./graalpython/com.oracle.graal.python.test/src/runner.py", "merge-tags-from-report", "../retagger-reports/reports-merged.json"],
["sh", "-c", "git diff >> diff_reports"],
]
},
],
}

Expand Down
6 changes: 4 additions & 2 deletions ci/python-gate.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@
task_spec({
environment+: {
TAGGED_UNITTEST_PARTIAL: "%d/%d" % [i, num],
RETAGGER_BATCH_NO: i,
MX_REPORT_SUFFIX: "_batch_%d" % [i],
},
variations+::["batch" + i]
}),
Expand Down Expand Up @@ -510,11 +512,11 @@
# The default timeout is very generous to allow for infrastructure flakiness,
# but we don't want to auto tag tests that take a long time
"--timeout-factor", "0.3",
"--mx-report", "report.json",
"--mx-report", "retagger-report.json",
"--exit-success-on-failures",
],
],
logs+: ["*/*/report.json"],
logs+: ["main/retagger-report*.json"],
}),

coverage_gate:: $.graalpy_gate + task_spec({
Expand Down
11 changes: 9 additions & 2 deletions graalpython/com.oracle.graal.python.test/src/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,12 @@ def run_tests(self, tests: list['TestSuite']):
self.display_summary()

def generate_mx_report(self, path: str):
# Some reports may be split when ran on github, this sets different file names
report_suffix = os.environ.get("MX_REPORT_SUFFIX")
if report_suffix:
tmppath, ext = os.path.splitext(path)
path = f"{tmppath}{report_suffix}{ext}"

report_data = []
for result in self.results:
# Skip synthetic results for failed class setups and such
Expand Down Expand Up @@ -496,6 +502,7 @@ def update_tags(test_file: 'TestFile', results: list[TestResult], tag_platform:
tag_by_id[tag.test_id] = tag

for test_id, status in status_by_id.items():

if tag := tag_by_id.get(test_id):
if status == TestStatus.SUCCESS:
tag_by_id[test_id] = tag.with_key(tag_platform)
Expand Down Expand Up @@ -1349,7 +1356,7 @@ def main_merge_tags(args):
test_file,
results,
tag_platform=args.platform,
untag_failed=False,
untag_failed= os.environ.get("GITHUB_CI") is not None,
untag_skipped=True,
untag_missing=True,
)
Expand Down Expand Up @@ -1509,7 +1516,7 @@ def main():
# merge-tags-from-report command declaration
merge_tags_parser = subparsers.add_parser('merge-tags-from-report', help="Merge tags from automated retagger")
merge_tags_parser.set_defaults(main=main_merge_tags)
merge_tags_parser.add_argument('platform')
merge_tags_parser.add_argument('--platform', default=CURRENT_PLATFORM)
merge_tags_parser.add_argument('report_path')

# run the appropriate command
Expand Down
Loading
Loading