Bug 1847775 - update taskgraph for toml manifests. r=jmaher,taskgraph-reviewers,releng-reviewers,gbrown

Differential Revision: https://phabricator.services.mozilla.com/D185819
This commit is contained in:
Tom Marble 2023-08-09 20:13:44 +00:00
parent f0965f177b
commit a640c1e16d
9 changed files with 51 additions and 34 deletions

View File

@ -73,7 +73,11 @@ def get_failures(task_id, task_definition):
test_path = test_path.split(":")[-1]
# edge case where a crash on shutdown has a "test" name == group name
if test_path.endswith(".ini") or test_path.endswith(".list"):
if (
test_path.endswith(".toml")
or test_path.endswith(".ini")
or test_path.endswith(".list")
):
continue
# edge cases with missing test names
@ -102,7 +106,11 @@ def get_failures(task_id, task_definition):
test_path = test_path.split(" ")[0]
# edge case where a crash on shutdown has a "test" name == group name
if test_path.endswith(".ini") or test_path.endswith(".list"):
if (
test_path.endswith(".toml")
or test_path.endswith(".ini")
or test_path.endswith(".list")
):
continue
# edge cases with missing test names

View File

@ -354,9 +354,11 @@ def test_get_manifests(suite, platform, mock_mozinfo):
items = manifests["active"]
if suite == "xpcshell":
assert all([re.search(r"xpcshell(.*)?.ini", m) for m in items])
assert all([re.search(r"xpcshell(.*)?.(ini|toml)", m) for m in items])
if "mochitest" in suite:
assert all([re.search(r"(mochitest|chrome|browser).*.ini", m) for m in items])
assert all(
[re.search(r"(mochitest|chrome|browser).*.(ini|toml)", m) for m in items]
)
if "web-platform" in suite:
assert all([m.startswith("/") and m.count("/") <= 4 for m in items])

View File

@ -299,9 +299,13 @@ def guess_suite(abs_test):
filename = os.path.basename(abs_test)
has_browser_ini = os.path.isfile(os.path.join(parent, "browser.ini"))
has_browser_toml = os.path.isfile(os.path.join(parent, "browser.toml"))
has_chrome_ini = os.path.isfile(os.path.join(parent, "chrome.ini"))
has_chrome_toml = os.path.isfile(os.path.join(parent, "chrome.toml"))
has_plain_ini = os.path.isfile(os.path.join(parent, "mochitest.ini"))
has_plain_toml = os.path.isfile(os.path.join(parent, "mochitest.toml"))
has_xpcshell_ini = os.path.isfile(os.path.join(parent, "xpcshell.ini"))
has_xpcshell_toml = os.path.isfile(os.path.join(parent, "xpcshell.toml"))
in_wpt_folder = abs_test.startswith(
os.path.abspath(os.path.join("testing", "web-platform"))
@ -313,22 +317,24 @@ def guess_suite(abs_test):
guessed_suite = "web-platform-tests-reftest"
elif (
filename.startswith("test_")
and has_xpcshell_ini
and (has_xpcshell_ini or has_xpcshell_toml)
and guess_doc(abs_test) == "js"
):
guessed_suite = "xpcshell"
else:
if filename.startswith("browser_") and has_browser_ini:
if filename.startswith("browser_") and (has_browser_ini or has_browser_toml):
guessed_suite = "mochitest-browser-chrome"
elif filename.startswith("test_"):
if has_chrome_ini and has_plain_ini:
if (has_chrome_ini or has_chrome_toml) and (
has_plain_ini or has_plain_toml
):
err = (
"Error: directory contains both a chrome.ini and mochitest.ini. "
"Error: directory contains both a chrome.{ini|toml} and mochitest.{ini|toml}. "
"Please set --suite=mochitest-chrome or --suite=mochitest-plain."
)
elif has_chrome_ini:
elif has_chrome_ini or has_chrome_toml:
guessed_suite = "mochitest-chrome"
elif has_plain_ini:
elif has_plain_ini or has_plain_toml:
guessed_suite = "mochitest-plain"
return guessed_suite, err

View File

@ -1944,9 +1944,13 @@ toolbar#nav-bar {
assert manifestFileAbs.startswith(SCRIPT_DIR)
manifest = TestManifest([manifestFileAbs], strict=False)
else:
masterName = self.normflavor(options.flavor) + ".ini"
masterName = self.normflavor(options.flavor) + ".toml"
masterPath = os.path.join(SCRIPT_DIR, self.testRoot, masterName)
if not os.path.exists(masterPath):
masterName = self.normflavor(options.flavor) + ".ini"
masterPath = os.path.join(SCRIPT_DIR, self.testRoot, masterName)
if os.path.exists(masterPath):
manifest = TestManifest([masterPath], strict=False)
else:

View File

@ -1,13 +0,0 @@
[DEFAULT]
subsuite = mozbase
[test_expressionparser.py]
[test_manifestparser.py]
[test_testmanifest.py]
[test_read_ini.py]
[test_convert_directory.py]
[test_filters.py]
[test_chunking.py]
[test_convert_symlinks.py]
disabled = https://bugzilla.mozilla.org/show_bug.cgi?id=920938
[test_default_overrides.py]
[test_util.py]

View File

@ -1,13 +1,23 @@
[DEFAULT]
subsuite = "mozbase"
['test_expressionparser.py']
['test_manifestparser.py']
['test_testmanifest.py']
['test_read_ini.py']
['test_convert_directory.py']
['test_filters.py']
['test_chunking.py']
['test_convert_directory.py']
['test_convert_symlinks.py']
disabled = 'https://bugzilla.mozilla.org/show_bug.cgi?id=920938'
['test_default_overrides.py']
['test_expressionparser.py']
['test_filters.py']
['test_manifestparser.py']
['test_read_ini.py']
['test_testmanifest.py']
['test_util.py']

View File

@ -5,7 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
PYTHON_UNITTEST_MANIFESTS += [
"manifestparser/tests/manifest.ini",
"manifestparser/tests/manifest.toml",
"mozcrash/tests/manifest.ini",
"mozdebug/tests/manifest.ini",
"mozdevice/tests/manifest.ini",

View File

@ -752,7 +752,7 @@ class TestResolver(MozbuildObject):
continue
# If the path is a manifest, add all tests defined in that manifest.
if any(path.endswith(e) for e in (".ini", ".list")):
if any(path.endswith(e) for e in (".toml", ".ini", ".list")):
key = "manifest" if os.path.isabs(path) else "manifest_relpath"
candidate_paths |= {
t["file_relpath"]

View File

@ -292,8 +292,8 @@ class TestInfoReport(TestInfo):
return os.path.join("js", "src", "jit-test", "tests", path)
def path_mod_xpcshell(self, path):
# <manifest>.ini:<path> -> "<path>"
path = path.split(".ini:")[-1]
# <manifest>.{ini|toml}:<path> -> "<path>"
path = path.split(":")[-1]
return path
def description(