Skip to content

Commit

Permalink
[GR-45199] Reset tag list after computing the partial list of task na…
Browse files Browse the repository at this point in the history
…mes.

PullRequest: mx/1582
  • Loading branch information
ansalond committed May 5, 2023
2 parents 0280b22 + 17d0f07 commit f2f98f7
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 16 deletions.
4 changes: 2 additions & 2 deletions ci/common.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ local common_json = import "../common.json";
for name in ["oraclejdk20"] + variants("labsjdk-ce-20") + variants("labsjdk-ee-20")
} + {
[name]: common_json.jdks[name] + { jdk_version:: 21 }
for name in ["oraclejdk21"]
for name in ["oraclejdk21"] + variants("labsjdk-ce-21") + variants("labsjdk-ee-21")
},
assert std.assertEqual(std.objectFields(common_json.jdks), std.objectFields(jdks_data)),

Expand Down Expand Up @@ -58,7 +58,7 @@ local common_json = import "../common.json";
"windows-jdk19": { packages+: { "devkit:VS2022-17.1.0+1": "==0" }},
"windows-jdk20": { packages+: { "devkit:VS2022-17.1.0+1": "==0" }},
"windows-jdk21": { packages+: { "devkit:VS2022-17.1.0+1": "==1" }},
"linux-jdk17": { packages+: { "devkit:gcc10.3.0-OL6.4+1": "==0" }},
"linux-jdk17": { packages+: { "devkit:gcc11.2.0-OL6.4+1": "==0" }},
"linux-jdk19": { packages+: { "devkit:gcc11.2.0-OL6.4+1": "==0" }},
"linux-jdk20": { packages+: { "devkit:gcc11.2.0-OL6.4+1": "==0" }},
},
Expand Down
23 changes: 15 additions & 8 deletions common.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Jsonnet files should not include this file directly but use ci/common.jsonnet instead."
],

"mx_version": "6.19.3",
"mx_version": "6.20.3",

"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
"jdks": {
Expand All @@ -14,9 +14,9 @@
"labsjdk-ce-17": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.0-b10", "platformspecific": true },
"labsjdk-ce-17Debug": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.0-b10-debug", "platformspecific": true },
"labsjdk-ce-17-llvm": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.0-b10-sulong", "platformspecific": true },
"labsjdk-ee-17": {"name": "labsjdk", "version": "ee-17.0.7+8-jvmci-23.0-b10", "platformspecific": true },
"labsjdk-ee-17Debug": {"name": "labsjdk", "version": "ee-17.0.7+8-jvmci-23.0-b10-debug", "platformspecific": true },
"labsjdk-ee-17-llvm": {"name": "labsjdk", "version": "ee-17.0.7+8-jvmci-23.0-b10-sulong", "platformspecific": true },
"labsjdk-ee-17": {"name": "labsjdk", "version": "ee-17.0.8+2-jvmci-23.1-b01", "platformspecific": true },
"labsjdk-ee-17Debug": {"name": "labsjdk", "version": "ee-17.0.8+2-jvmci-23.1-b01-debug", "platformspecific": true },
"labsjdk-ee-17-llvm": {"name": "labsjdk", "version": "ee-17.0.8+2-jvmci-23.1-b01-sulong", "platformspecific": true },

"oraclejdk19": {"name": "jpg-jdk", "version": "19", "build_id": "26", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-19": {"name": "labsjdk", "version": "ce-19.0.1+10-jvmci-23.0-b04", "platformspecific": true },
Expand All @@ -30,11 +30,18 @@
"labsjdk-ce-20": {"name": "labsjdk", "version": "ce-20+34-jvmci-23.0-b10", "platformspecific": true },
"labsjdk-ce-20Debug": {"name": "labsjdk", "version": "ce-20+34-jvmci-23.0-b10-debug", "platformspecific": true },
"labsjdk-ce-20-llvm": {"name": "labsjdk", "version": "ce-20+34-jvmci-23.0-b10-sulong", "platformspecific": true },
"labsjdk-ee-20": {"name": "labsjdk", "version": "ee-20.0.1+9-jvmci-23.0-b10", "platformspecific": true },
"labsjdk-ee-20Debug": {"name": "labsjdk", "version": "ee-20.0.1+9-jvmci-23.0-b10-debug", "platformspecific": true },
"labsjdk-ee-20-llvm": {"name": "labsjdk", "version": "ee-20.0.1+9-jvmci-23.0-b10-sulong", "platformspecific": true },
"labsjdk-ee-20": {"name": "labsjdk", "version": "ee-20.0.2+2-jvmci-23.1-b01", "platformspecific": true },
"labsjdk-ee-20Debug": {"name": "labsjdk", "version": "ee-20.0.2+2-jvmci-23.1-b01-debug", "platformspecific": true },
"labsjdk-ee-20-llvm": {"name": "labsjdk", "version": "ee-20.0.2+2-jvmci-23.1-b01-sulong", "platformspecific": true },

"oraclejdk21": {"name": "jpg-jdk", "version": "21", "build_id": "15", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-21": {"name": "labsjdk", "version": "ce-21+19-jvmci-23.1-b01", "platformspecific": true },
"labsjdk-ce-21Debug": {"name": "labsjdk", "version": "ce-21+19-jvmci-23.1-b01-debug", "platformspecific": true },
"labsjdk-ce-21-llvm": {"name": "labsjdk", "version": "ce-21+19-jvmci-23.1-b01-sulong", "platformspecific": true },
"labsjdk-ee-21": {"name": "labsjdk", "version": "ee-21+19-jvmci-23.1-b01", "platformspecific": true },
"labsjdk-ee-21Debug": {"name": "labsjdk", "version": "ee-21+19-jvmci-23.1-b01-debug", "platformspecific": true },
"labsjdk-ee-21-llvm": {"name": "labsjdk", "version": "ee-21+19-jvmci-23.1-b01-sulong", "platformspecific": true }

"oraclejdk21": {"name": "jpg-jdk", "version": "21", "build_id": "15", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]}
},

"eclipse": {
Expand Down
2 changes: 1 addition & 1 deletion mx.py
Original file line number Diff line number Diff line change
Expand Up @@ -18396,7 +18396,7 @@ def alarm_handler(signum, frame):
abort(1, killsig=signal.SIGINT)

# The version must be updated for every PR (checked in CI) and the comment should reflect the PR's issue
version = VersionSpec("6.20.3") # strenghten the extraction of VM info
version = VersionSpec("6.20.4") # GR-45199: mx gate --tags ... --partial ...

currentUmask = None
_mx_start_datetime = datetime.utcnow()
Expand Down
27 changes: 22 additions & 5 deletions mx_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class Task:
# a non-None value from __enter__. The body of a 'with Task(...) as t'
# statement should check 't' and exit immediately if it is None.
filters = []
log = True # whether to log task messages
strict_filters = [] # Like `filters`, but the entire title must match
log = True # whether to log task messages
dryRun = False
startAtFilter = None
filtersExclude = False
Expand Down Expand Up @@ -139,11 +140,19 @@ def __init__(self, title,
else:
self.skipped = True
elif len(Task.filters) > 0:
assert len(Task.strict_filters) == 0, "A Task cannot have both `filters` and `strict_filters`"
titles = [self.title] + self.legacyTitles
if Task.filtersExclude:
self.skipped = any([f in t for t in titles for f in Task.filters])
else:
self.skipped = not any([f in t for t in titles for f in Task.filters])
elif len(Task.strict_filters) > 0:
assert len(Task.filters) == 0, "A Task cannot have both `filters` and `strict_filters`"
titles = [self.title] + self.legacyTitles
if Task.filtersExclude:
self.skipped = any([f == t for t in titles for f in Task.strict_filters])
else:
self.skipped = not any([f == t for t in titles for f in Task.strict_filters])
if Task.tags is not None:
if Task.tagsExclude:
self.skipped = all([t in Task.tags for t in self.tags]) if tags else False # pylint: disable=unsupported-membership-test
Expand Down Expand Up @@ -320,7 +329,7 @@ def gate(args):
add_omit_clean_args(parser)
parser.add_argument('--all-suites', action='store_true', help='run gate tasks for all suites, not just the primary suite')
parser.add_argument('--dry-run', action='store_true', help='just show the tasks that will be run without running them')
parser.add_argument('-x', action='store_true', help='makes --task-filter or --tags an exclusion instead of inclusion filter')
parser.add_argument('-x', action='store_true', help='makes --task-filter, --strict-task-filter, or --tags an exclusion instead of inclusion filter')
jacoco = parser.add_mutually_exclusive_group()
jacoco.add_argument('--jacocout', help='specify the output directory for jacoco report')
jacoco.add_argument('--jacoco-zip', help='specify the output zip file for jacoco report')
Expand All @@ -337,6 +346,7 @@ def gate(args):
summary.add_argument('--summary-format', dest='summary', action='store', default=None, help='--summary with a comma separated list of entries. Possible values ' + str(default_summary))
filtering = parser.add_mutually_exclusive_group()
filtering.add_argument('-t', '--task-filter', help='comma separated list of substrings to select subset of tasks to be run')
filtering.add_argument('-T', '--strict-task-filter', help='comma separated list of strings to select subset of tasks to be run. The entire task name must match.')
filtering.add_argument('-s', '--start-at', help='substring to select starting task')
filtering.add_argument('--tags', help='comma separated list of tags to select subset of tasks to be run. Tags can have a range specifier `name[:from:[to]]`.'
'If present only the [from,to) tasks are executed. If `to` is omitted all tasks starting with `from` are executed.')
Expand All @@ -353,14 +363,17 @@ def gate(args):
elif args.task_filter:
Task.filters = args.task_filter.split(',')
Task.filtersExclude = args.x
elif args.strict_task_filter:
Task.strict_filters = args.strict_task_filter.split(',')
Task.filtersExclude = args.x
elif args.tags:
parse_tags_argument(args.tags, args.x)
Task.tagsExclude = args.x
if not Task.tagsExclude:
# implicitly include 'always'
Task.tags += [Tags.always]
elif args.x:
mx.abort('-x option cannot be used without --task-filter or the --tags option')
mx.abort('-x option cannot be used without --task-filter, --strict-task-filter, or the --tags option')

if args.jacoco_zip:
args.jacocout = 'html'
Expand Down Expand Up @@ -388,10 +401,14 @@ def gate(args):
partialTasks = nonBuildTasks[selected::total]
runTaskNames = [task.title for task in buildTasks + partialTasks]

# we have already ran the filters in the dry run when collecting
# We have already ran the filters in the dry run when collecting
# so we can safely overwrite other filter settings.
Task.filters = runTaskNames
# We set `strict_filters` rather than `filters` because we want
# exact matches, not matches by substring.
Task.strict_filters = runTaskNames
Task.filters = []
Task.filtersExclude = False
Task.tags = None

mx.log('Running gate with partial tasks ' + args.partial + ". " + str(len(partialTasks)) + " out of " + str(len(nonBuildTasks)) + " non-build tasks selected.")
if len(partialTasks) == 0:
Expand Down

0 comments on commit f2f98f7

Please sign in to comment.