Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
334b582
Revert to oracle/master tagged unittests
Ariouz Dec 11, 2025
9349e72
Fix windows python install (#17)
Ariouz Dec 11, 2025
7766e10
Rm debug message
Ariouz Dec 11, 2025
3770d23
Skip mx/python in install system packages step
Ariouz Dec 11, 2025
18e9a22
Set retagger base branch to the workflow base one
Ariouz Dec 12, 2025
e33df65
Add logs/artifacts rentention days inputs
Ariouz Dec 12, 2025
771ccb8
Fix and optimize retagger
Ariouz Dec 16, 2025
72d9dc4
Merge branch 'vcalvez/github_ci' into retags_all
Ariouz Dec 16, 2025
2bc3ffd
WIP: {platform}-github tags
Ariouz Dec 15, 2025
5ea4904
WIP: github tag
Ariouz Dec 16, 2025
f9dc278
WIP: tag + debug
Ariouz Dec 16, 2025
e350386
fix lgo errr
Ariouz Dec 16, 2025
ea7ab1b
Fix git diff on wrong branch
Ariouz Dec 16, 2025
aa26c4e
WIP: github platform
Ariouz Dec 17, 2025
0267019
WIP: Add -github to all tags => run retagger
Ariouz Dec 17, 2025
1f27fed
Ignore logs upload warning
Ariouz Dec 17, 2025
e5edd0d
FIx if-no-files-found
Ariouz Dec 17, 2025
c6bdf47
Apply -github retags
Ariouz Dec 17, 2025
203c128
Don't save artifacts produced in retagger jobs
Ariouz Dec 17, 2025
4186b25
Set artifact_retention_days to 0
Ariouz Dec 17, 2025
d5d2cef
debug runner
Ariouz Dec 17, 2025
915dec1
fix some retags
Ariouz Dec 17, 2025
0f875fd
Rm debugs causing CI fail
Ariouz Dec 17, 2025
3f1131f
Revert unwanted bytecode retags changes
Ariouz Dec 18, 2025
1652485
Revert unwanted retags
Ariouz Dec 18, 2025
59ef1f9
Move test_patched_pip to tagged tests
Ariouz Dec 18, 2025
e4777b3
Disable test_wheel on github_ci
Ariouz Dec 18, 2025
6412436
Retagger set continue-on-error to true
Ariouz Dec 18, 2025
cc79ea6
Fix typo
Ariouz Dec 18, 2025
163cde2
Fix
Ariouz Dec 18, 2025
7da6970
Set git clone timeout
Ariouz Dec 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 13 additions & 5 deletions .github/workflows/ci-matrix-gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ on:
jobs_to_run:
required: true
type: string
logs_retention_days:
required: false
type: number
default: 15
artifacts_retention_days:
required: false
type: number
default: 7

jobs:
generate-tier1:
Expand Down Expand Up @@ -55,7 +63,6 @@ jobs:
tier1:
needs: generate-tier1
runs-on: ${{ matrix.os }}
#env: ${{ matrix.env }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -150,6 +157,7 @@ jobs:
if: ${{ matrix.mx_version }}
shell: bash
run: |
git config --global http.timeout 600
git clone https://github.com/graalvm/mx
if [[ "${RUNNER_OS}" == "Windows" ]]; then
./mx/mx.cmd fetch-jdk -A --jdk-id labsjdk-ce-latest
Expand Down Expand Up @@ -255,22 +263,23 @@ jobs:
with:
name: ${{ matrix.provide_artifact[0] }}
path: main/${{ matrix.provide_artifact[0] }}.tar
retention-days: 1
retention-days: ${{ inputs.artifacts_retention_days || 7 }}

- name: Upload logs
if: ${{ matrix.logs }}
uses: actions/upload-artifact@v5
continue-on-error: true
with:
name: ${{ format('{0}_logs', matrix.name) }}
path: |
${{ matrix.logs }}
retention-days: 15
retention-days: ${{ inputs.logs_retention_days || 15 }}
if-no-files-found: ignore

tier2:
if: ${{ success() || inputs.jobs_to_run }}
needs: [generate-tier2, tier1]
runs-on: ${{ matrix.os }}
#env: ${{ matrix.env }}
strategy:
fail-fast: false
matrix:
Expand All @@ -281,7 +290,6 @@ jobs:
if: ${{ success() || inputs.jobs_to_run }}
needs: [generate-tier3, tier2]
runs-on: ${{ matrix.os }}
#env: ${{ matrix.env }}
strategy:
fail-fast: false
matrix:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/ci-unittest-retagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
uses: ./.github/workflows/ci-matrix-gen.yml
with:
jobs_to_run: ^(?=.*python-svm-build).*$
artifacts_retention_days: 0

run-retagger:
if: success()
Expand All @@ -27,9 +28,12 @@ jobs:
name: Run retagger on ${{ matrix.target }}
with:
jobs_to_run: ${{ github.event.inputs.jobs_to_run || format('^python-unittest-retagger.*{0}.*', matrix.target) }}
logs_retention_days: 7
artifacts_retention_days: 0

merge_all_reports:
runs-on: ubuntu-latest
if: always()
needs: run-retagger
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -55,7 +59,7 @@ jobs:
git config --global user.name "Retagger Workflow"
git config --global user.email "Retagger_Workflow@oracle.com"
git fetch origin
git checkout -b weekly_retagger_${{ github.run_id }} origin/master
git checkout -b weekly_retagger_${{ github.run_id }} origin/${{ github.head_ref || github.ref_name }}

- name: Merge retagger reports
env:
Expand All @@ -69,14 +73,14 @@ jobs:
for os in "${os_list[@]}"; do
echo "Merging tags for $os"
python3 .github/scripts/merge_retagger_results.py --dir ../retagger-reports --outfile "../retagger-reports/reports-merged-$os.json" --pattern "*$os*" || true
python3 graalpython/com.oracle.graal.python.test/src/runner.py merge-tags-from-report "../retagger-reports/reports-merged-$os.json" --platform "$os" || true
python3 graalpython/com.oracle.graal.python.test/src/runner.py merge-tags-from-report "../retagger-reports/reports-merged-$os.json" --platform "$os-github" || true
git add -A
git commit -m "Apply retags for $os" || true
done

- name: Push updates to a new PR
working-directory: main
run: |
[ "$(git diff origin/master...HEAD | wc -l)" -eq 0 ] && echo 'Nothing to push' || git push --set-upstream origin weekly_retagger_${{ github.run_id }}
[ "$(git diff origin/${{ github.head_ref || github.ref_name }}...HEAD | wc -l)" -eq 0 ] && echo 'Nothing to push' || git push --set-upstream origin weekly_retagger_${{ github.run_id }}
gh label create "weekly-retagger" --color "BDDFDF" -d "[DO NOT ADD] Automatically set to weekly retagger PR" || echo "Label 'weekly-retagger' already exists"
gh pr create -B master --title "[WORKFLOW] Weekly Retagger: Update tags" --body "Applied weekly retags on $os_list" -l "weekly-retagger" || echo "Nothing to push"
2 changes: 2 additions & 0 deletions .github/workflows/ci-unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
uses: ./.github/workflows/ci-matrix-gen.yml
with:
jobs_to_run: ^(?=.*python-svm-build).*$
logs_retention_days: 0
artifacts_retention_days: 0

run-tests:
if: github.event.pull_request.draft == false && success()
Expand Down
10 changes: 5 additions & 5 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 = 12,
local RETAGGER_SPLIT = 16,

// -----------------------------------------------------------------------------------------------------------------
// gates
Expand Down Expand Up @@ -242,10 +242,10 @@
"linux:amd64:jdk-latest" : tier1,
}),
"python-unittest-retagger": ut_retagger + platform_spec(no_jobs) + batches(RETAGGER_SPLIT) + platform_spec({
"linux:amd64:jdk-latest" : weekly + t("20:00:00"),
"linux:aarch64:jdk-latest" : weekly + t("20:00:00"),
"darwin:aarch64:jdk-latest" : weekly + t("20:00:00"),
"windows:amd64:jdk-latest" : weekly + t("20:00:00"),
"linux:amd64:jdk-latest" : weekly + t("20:00:00") + require(GPY_NATIVE_STANDALONE),
"linux:aarch64:jdk-latest" : weekly + t("20:00:00") + require(GPY_NATIVE_STANDALONE),
"darwin:aarch64:jdk-latest" : weekly + t("20:00:00") + require(GPY_NATIVE_STANDALONE),
"windows:amd64:jdk-latest" : weekly + t("20:00:00") + require(GPY_NATIVE_STANDALONE),
}),
"python-coverage-jacoco-tagged": cov_jacoco_tagged + batches(COVERAGE_SPLIT) + platform_spec(no_jobs) + platform_spec({
"linux:amd64:jdk21" : weekly + t("20:00:00"),
Expand Down
6 changes: 3 additions & 3 deletions ci/python-gate.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@
darwin: {
common: ENV_POSIX + {
LC_CTYPE: "en_US.UTF-8",
PATH: utils.path_combine(ENVIRONMENT.common.PATH, "$PATH:$PYTHON3_HOME:$MUSL_TOOLCHAIN/bin"),
PATH: utils.path_combine(ENVIRONMENT.common.PATH, "$PYTHON3_HOME:$PATH:$MUSL_TOOLCHAIN/bin"),
},
amd64: {},
aarch64: {},
},
windows: {
common: {
PATH: "%MAVEN_HOME%;%PATH%",
PATH: "%MAVEN_HOME%\\bin;%PATH%",
},
amd64: {},
aarch64: {},
Expand Down Expand Up @@ -509,7 +509,7 @@
"mx", "graalpytest", "--svm",
"--tagged", "--all", "--continue-on-collection-errors", ".",
# More workers doesn't help, the job is bottlenecked on all the timeouts in test_asyncio
"-n", "6",
"-n", "4",
# 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",
Expand Down
49 changes: 18 additions & 31 deletions graalpython/com.oracle.graal.python.test/src/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
DISABLE_JIT_ENV = {'GRAAL_PYTHON_VM_ARGS': '--experimental-options --engine.Compilation=false'}

GITHUB_CI = os.environ.get("GITHUB_CI", None)
if GITHUB_CI:
PLATFORM_KEYS.add("github")
CURRENT_PLATFORM += "-github"

# We leave the JIT enabled for the tests themselves, but disable it for subprocesses
# noinspection PyUnresolvedReferences
Expand Down Expand Up @@ -907,7 +910,13 @@ def run_in_subprocess_and_watch(self):


def platform_keys_match(items: typing.Iterable[str]):
return any(all(key in PLATFORM_KEYS for key in item.split('-')) for item in items)
matches = []
for item in items:
if GITHUB_CI:
if not "github" in item.split('-'):
continue
matches.append(all(key in PLATFORM_KEYS for key in item.split('-')))
return any(matches)


@dataclass
Expand Down Expand Up @@ -1132,7 +1141,7 @@ def collect_module(test_file: TestFile, specifiers: list[TestSpecifier], use_tag
loader = TopLevelFunctionLoader() if config.run_top_level_functions else unittest.TestLoader()
tagged_ids = None
if use_tags and config.tags_dir:
tagged_ids = [tag.test_id for tag in read_tags(test_file) if platform_keys_match(tag.keys) and not tag.is_platform_excluded(CURRENT_PLATFORM)]
tagged_ids = [tag.test_id for tag in read_tags(test_file) if platform_keys_match(tag.keys)]
if not tagged_ids:
return None
test_module = test_path_to_module(test_file)
Expand Down Expand Up @@ -1208,52 +1217,36 @@ def collect(all_specifiers: list[TestSpecifier], *, use_tags=False, ignore=None,
class Tag:
test_id: TestId
keys: frozenset[str]
excluded_keys: frozenset[str]
is_exclusion: bool
comment: str | None = False

@classmethod
def for_key(cls, test_id, key) -> 'Tag':
return Tag(test_id, frozenset({key}), excluded_keys=frozenset(), is_exclusion=False)
return Tag(test_id, frozenset({key}), is_exclusion=False)

def with_key(self, key: str) -> 'Tag':
if GITHUB_CI:
return Tag(self.test_id, self.keys, self.excluded_keys - {key}, is_exclusion=self.is_exclusion)

return Tag(self.test_id, self.keys | {key}, self.excluded_keys, is_exclusion=self.is_exclusion)
return Tag(self.test_id, self.keys | {key}, is_exclusion=self.is_exclusion)

def without_key(self, key: str) -> 'Tag | None':
return self.without_keys({key})

def without_keys(self, keys: set[str]) -> 'Tag | None':
# disable test/platform only for github, not completely for internal ci
if GITHUB_CI:
exclusions = frozenset(list(self.excluded_keys) + list(keys))
return Tag(self.test_id, self.keys, exclusions, is_exclusion=self.is_exclusion)

keys = self.keys - keys
if keys:
if keys == self.keys:
return self
return Tag(self.test_id, keys, self.excluded_keys, is_exclusion=self.is_exclusion)
return Tag(self.test_id, keys, is_exclusion=self.is_exclusion)

def is_platform_excluded(self, key: str) -> bool:
return key in self.excluded_keys
return key not in self.keys

def get_keys_as_str(self) -> list[str]:
keys = []
for key in sorted(self.keys):
if "$" in key: print(f"[WARNING]: Invalid key with $ found in tag keys: {key}, {self.keys}, {self.excluded_keys}")
keys.append(key if key not in self.excluded_keys else f"${key}")
return keys

def __str__(self):
s = ''
if self.is_exclusion:
s += '!'
s += self.test_id.test_name
if self.keys:
s += f' @ {",".join(self.get_keys_as_str())}'
s += f' @ {",".join(sorted(self.keys))}'
if self.comment:
s = f'{self.comment}{s}'
return s
Expand Down Expand Up @@ -1282,19 +1275,13 @@ def read_tags(test_file: TestFile, allow_exclusions=False) -> list[Tag]:
is_exclusion = True
test = test.removeprefix('!')


if not keys and not is_exclusion:
log(f'WARNING: invalid tag {test}: missing platform keys')

keys = keys.split(',') if keys else []
excluded_keys = []
for key in keys:
if key.startswith('$'):
excluded_keys.append(key.removeprefix('$'))

tag = Tag(
TestId(test_path, test),
frozenset(keys),
excluded_keys=frozenset(excluded_keys),
frozenset(keys.split(',')) if keys else frozenset(keys),
is_exclusion=is_exclusion,
comment=comment,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@

from tests.testlib_helper import build_testlib


# cannot be moved to tagged as it uses testlib_helper
@unittest.skipIf(os.environ.get("GITHUB_CI"), "Skip on Github CI")
class TestWheelBuildAndRun(unittest.TestCase):
def test_build_install_and_run(self):
# Build a C library and a wheel that depends on it. Then run it through repair_wheel to vendor the library in and verify that it can be imported
Expand Down
Loading
Loading