diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /comm/taskcluster/comm_taskgraph/test | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'comm/taskcluster/comm_taskgraph/test')
7 files changed, 865 insertions, 0 deletions
diff --git a/comm/taskcluster/comm_taskgraph/test/cc_automationrelevance.json b/comm/taskcluster/comm_taskgraph/test/cc_automationrelevance.json new file mode 100644 index 0000000000..19751bad92 --- /dev/null +++ b/comm/taskcluster/comm_taskgraph/test/cc_automationrelevance.json @@ -0,0 +1,154 @@ +{ + "changesets": [ + { + "author": "Magnus Melin <mkmelin+mozilla@iki.fi>", + "backsoutnodes": [], + "bugs": [ + { + "no": "1829065", + "url": "https://bugzilla.mozilla.org/show_bug.cgi?id=1829065" + } + ], + "date": [1681974919, 0], + "desc": "Bug 1829065 - re-enable browser_messageFilters.js. r=leftmostcat\n\n\nReenable the test.\nRemove the customizaton sub test since the button it's about is now different + it's using the old customization which is on its way out.\n\nDifferential Revision: https://phabricator.services.mozilla.com/D175988", + "extra": { + "branch": "default" + }, + "files": [ + "mail/test/browser/folder-widget/browser.ini", + "mail/test/browser/folder-widget/browser_messageFilters.js" + ], + "node": "e6e51c25cd7162180080914b6bc46cb0620c4a87", + "parents": ["87bed05abb8f99147cf83ecb3bc0cec6ada7f39d"], + "perfherderurl": "https://treeherder.mozilla.org/perf.html#/compare?originalProject=comm-central&originalRevision=d0c328a2cc3340ab6f6458442ea89e366e33bd8e&newProject=comm-central&newRevision=e6e51c25cd7162180080914b6bc46cb0620c4a87", + "phase": "public", + "pushdate": [1681986116, 0], + "pushhead": "d0c328a2cc3340ab6f6458442ea89e366e33bd8e", + "pushid": 20934, + "pushuser": "geoff@darktrojan.net", + "rev": 38727, + "reviewers": [ + { + "name": "leftmostcat", + "revset": "reviewer(leftmostcat)" + } + ], + "treeherderrepo": "comm-central", + "treeherderrepourl": "https://treeherder.mozilla.org/jobs?repo=comm-central" + }, + { + "author": "John Bieling <john@thunderbird.net>", + "backsoutnodes": [], + "bugs": [ + { + "no": "1828924", + "url": "https://bugzilla.mozilla.org/show_bug.cgi?id=1828924" + } + ], + "date": [1681911897, 0], + "desc": "Bug 1828924 - Fix imports of FileReader in the WebExtension API implementation files. r=mkmelin\n\nDifferential Revision: https://phabricator.services.mozilla.com/D175899", + "extra": { + "amend_source": "83d21c8094985f1c8024d5966de1effa93b09b40", + "branch": "default" + }, + "files": [ + "mail/components/extensions/parent/ext-compose.js", + "mail/components/extensions/parent/ext-mail.js", + "mail/components/extensions/parent/ext-messages.js" + ], + "node": "04906b08eddb74d55b2fb4868290e4759a459158", + "parents": ["e6e51c25cd7162180080914b6bc46cb0620c4a87"], + "perfherderurl": "https://treeherder.mozilla.org/perf.html#/compare?originalProject=comm-central&originalRevision=d0c328a2cc3340ab6f6458442ea89e366e33bd8e&newProject=comm-central&newRevision=e6e51c25cd7162180080914b6bc46cb0620c4a87", + "phase": "public", + "pushdate": [1681986116, 0], + "pushhead": "d0c328a2cc3340ab6f6458442ea89e366e33bd8e", + "pushid": 20934, + "pushuser": "geoff@darktrojan.net", + "rev": 38728, + "reviewers": [ + { + "name": "mkmelin", + "revset": "reviewer(mkmelin)" + } + ], + "treeherderrepo": "comm-central", + "treeherderrepourl": "https://treeherder.mozilla.org/jobs?repo=comm-central" + }, + { + "author": "Magnus Melin <mkmelin+mozilla@iki.fi>", + "backsoutnodes": [], + "bugs": [ + { + "no": "1826744", + "url": "https://bugzilla.mozilla.org/show_bug.cgi?id=1826744" + } + ], + "date": [1681879233, 0], + "desc": "Bug 1826744 - \"Copy to Folder\" should be enabled for .eml files opened from file - was broken again. r=john.bieling\n\nDifferential Revision: https://phabricator.services.mozilla.com/D175841", + "extra": { + "amend_source": "9b3f446beaa7132a9bfcd5542df376adb2af1337", + "branch": "default" + }, + "files": ["mail/base/content/mailWindowOverlay.js"], + "node": "b72ae83322b6a8d878ad710cbe1f4d59201404e1", + "parents": ["04906b08eddb74d55b2fb4868290e4759a459158"], + "perfherderurl": "https://treeherder.mozilla.org/perf.html#/compare?originalProject=comm-central&originalRevision=d0c328a2cc3340ab6f6458442ea89e366e33bd8e&newProject=comm-central&newRevision=e6e51c25cd7162180080914b6bc46cb0620c4a87", + "phase": "public", + "pushdate": [1681986116, 0], + "pushhead": "d0c328a2cc3340ab6f6458442ea89e366e33bd8e", + "pushid": 20934, + "pushuser": "geoff@darktrojan.net", + "rev": 38729, + "reviewers": [ + { + "name": "john.bieling", + "revset": "reviewer(john.bieling)" + } + ], + "treeherderrepo": "comm-central", + "treeherderrepourl": "https://treeherder.mozilla.org/jobs?repo=comm-central" + }, + { + "author": "Geoff Lankow <geoff@darktrojan.net>", + "backsoutnodes": [], + "bugs": [ + { + "no": "1817367", + "url": "https://bugzilla.mozilla.org/show_bug.cgi?id=1817367" + } + ], + "date": [1681948136, -43200], + "desc": "Bug 1817367 - Wrap loading of virtual folder views in batch notifications. r=leftmostcat\nThis functionality was added to the base `nsMsgDBView`, but not these subclasses.\n\nDifferential Revision: https://phabricator.services.mozilla.com/D175974", + "extra": { + "amend_source": "8722f310135f7c5f58cb1dcd4573189b3e225e6e", + "branch": "default", + "rebase_source": "4ca3cf372be8029d76bbfeecfcb406d197f0dbb6" + }, + "files": [ + "mailnews/base/src/nsMsgGroupView.cpp", + "mailnews/base/src/nsMsgQuickSearchDBView.cpp", + "mailnews/base/src/nsMsgSearchDBView.cpp", + "mailnews/base/src/nsMsgThreadedDBView.cpp", + "mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp" + ], + "node": "d0c328a2cc3340ab6f6458442ea89e366e33bd8e", + "parents": ["b72ae83322b6a8d878ad710cbe1f4d59201404e1"], + "perfherderurl": "https://treeherder.mozilla.org/perf.html#/compare?originalProject=comm-central&originalRevision=d0c328a2cc3340ab6f6458442ea89e366e33bd8e&newProject=comm-central&newRevision=e6e51c25cd7162180080914b6bc46cb0620c4a87", + "phase": "public", + "pushdate": [1681986116, 0], + "pushhead": "d0c328a2cc3340ab6f6458442ea89e366e33bd8e", + "pushid": 20934, + "pushuser": "geoff@darktrojan.net", + "rev": 38730, + "reviewers": [ + { + "name": "leftmostcat", + "revset": "reviewer(leftmostcat)" + } + ], + "treeherderrepo": "comm-central", + "treeherderrepourl": "https://treeherder.mozilla.org/jobs?repo=comm-central" + } + ], + "visible": true +} diff --git a/comm/taskcluster/comm_taskgraph/test/conftest.py b/comm/taskcluster/comm_taskgraph/test/conftest.py new file mode 100644 index 0000000000..83ed5343f4 --- /dev/null +++ b/comm/taskcluster/comm_taskgraph/test/conftest.py @@ -0,0 +1,7 @@ +import os +import sys + +HERE = os.path.dirname(__file__) +EXT_PATH = os.path.abspath(os.path.join(HERE, "..", "..")) + +sys.path.insert(0, EXT_PATH) diff --git a/comm/taskcluster/comm_taskgraph/test/mc_automationrelevance.json b/comm/taskcluster/comm_taskgraph/test/mc_automationrelevance.json new file mode 100644 index 0000000000..8e90731d92 --- /dev/null +++ b/comm/taskcluster/comm_taskgraph/test/mc_automationrelevance.json @@ -0,0 +1,309 @@ +{ + "changesets": [ + { + "author": "Noah <osuolale49@gmail.com>", + "backsoutnodes": [], + "bugs": [ + { + "no": "1825749", + "url": "https://bugzilla.mozilla.org/show_bug.cgi?id=1825749" + } + ], + "date": [1681922538, 0], + "desc": "Bug 1825749 - Only run IdentityCredentialStorageCleaner if FedCM is enabled. r=hpeuckmann\n\nDifferential Revision: https://phabricator.services.mozilla.com/D174757", + "extra": { + "branch": "default", + "moz-landing-system": "lando" + }, + "files": [ + "toolkit/components/cleardata/ClearDataService.sys.mjs", + "toolkit/components/cleardata/tests/unit/test_identity_credential_storage.js" + ], + "landingsystem": "lando", + "node": "e35b8568fd3f9d49b77e791b44159589b6bcb309", + "parents": ["680421823d4d4a444a0045996d16299691565aa7"], + "perfherderurl": "https://treeherder.mozilla.org/perf.html#/compare?originalProject=mozilla-central&originalRevision=6ca54f5a4a1b2a12530001ea3f092c29810e803c&newProject=mozilla-central&newRevision=11fec803ea08a3e440016a5cdc9686937fd94041", + "phase": "public", + "pushdate": [1681982536, 0], + "pushhead": "6ca54f5a4a1b2a12530001ea3f092c29810e803c", + "pushid": 40795, + "pushuser": "nfay@mozilla.com", + "rev": 661160, + "reviewers": [ + { + "name": "hpeuckmann", + "revset": "reviewer(hpeuckmann)" + } + ], + "treeherderrepo": "mozilla-central", + "treeherderrepourl": "https://treeherder.mozilla.org/jobs?repo=mozilla-central" + }, + { + "author": "Denis Palmeiro <dpalmeiro@mozilla.com>", + "backsoutnodes": [], + "bugs": [ + { + "no": "1824772", + "url": "https://bugzilla.mozilla.org/show_bug.cgi?id=1824772" + } + ], + "date": [1681925585, 0], + "desc": "Bug 1824772: part 1 - Add jit option and static pref to toggle eager baseline hints. r=iain\n\nAdd a pref, javascript.options.jitHints, to toggle eager baseline hints.\n\nDepends on D175520\n\nDifferential Revision: https://phabricator.services.mozilla.com/D175521", + "extra": { + "branch": "default", + "moz-landing-system": "lando" + }, + "files": ["modules/libpref/init/StaticPrefList.yaml"], + "landingsystem": "lando", + "node": "3740c123c6b87c6712dda72f53b0a2a8feac5110", + "parents": ["e35b8568fd3f9d49b77e791b44159589b6bcb309"], + "perfherderurl": "https://treeherder.mozilla.org/perf.html#/compare?originalProject=mozilla-central&originalRevision=6ca54f5a4a1b2a12530001ea3f092c29810e803c&newProject=mozilla-central&newRevision=11fec803ea08a3e440016a5cdc9686937fd94041", + "phase": "public", + "pushdate": [1681982536, 0], + "pushhead": "6ca54f5a4a1b2a12530001ea3f092c29810e803c", + "pushid": 40795, + "pushuser": "nfay@mozilla.com", + "rev": 661161, + "reviewers": [ + { + "name": "iain", + "revset": "reviewer(iain)" + } + ], + "treeherderrepo": "mozilla-central", + "treeherderrepourl": "https://treeherder.mozilla.org/jobs?repo=mozilla-central" + }, + { + "author": "Tim Huang <tihuang@mozilla.com>", + "backsoutnodes": [], + "bugs": [ + { + "no": "1817463", + "url": "https://bugzilla.mozilla.org/show_bug.cgi?id=1817463" + } + ], + "date": [1681925941, 0], + "desc": "Bug 1817463 - Deferring SafeBrowsing updates if the browser is in idle mode. r=dimi\n\nThis patch implements the behavior for deferring SafeBrowsing updates\nwhen the browser is in idle mode. The update will be deferred until the\nnext user interaction active.\n\nDifferential Revision: https://phabricator.services.mozilla.com/D175763", + "extra": { + "branch": "default", + "moz-landing-system": "lando" + }, + "files": [ + "toolkit/components/url-classifier/UrlClassifierListManager.jsm" + ], + "landingsystem": "lando", + "node": "80b29d7af43145cdd678d4ea51e770271f0c56ce", + "parents": ["6895dba1dca74eee9f56b4ce8656b4696f7c386d"], + "perfherderurl": "https://treeherder.mozilla.org/perf.html#/compare?originalProject=mozilla-central&originalRevision=6ca54f5a4a1b2a12530001ea3f092c29810e803c&newProject=mozilla-central&newRevision=11fec803ea08a3e440016a5cdc9686937fd94041", + "phase": "public", + "pushdate": [1681982536, 0], + "pushhead": "6ca54f5a4a1b2a12530001ea3f092c29810e803c", + "pushid": 40795, + "pushuser": "nfay@mozilla.com", + "rev": 661165, + "reviewers": [ + { + "name": "dimi", + "revset": "reviewer(dimi)" + } + ], + "treeherderrepo": "mozilla-central", + "treeherderrepourl": "https://treeherder.mozilla.org/jobs?repo=mozilla-central" + }, + { + "author": "Sergey Galich <sgalich@mozilla.com>", + "backsoutnodes": [], + "bugs": [ + { + "no": "1828524", + "url": "https://bugzilla.mozilla.org/show_bug.cgi?id=1828524" + } + ], + "date": [1681926293, 0], + "desc": "Bug 1828524 - [Relay] Manage masks button leads to SUMO instead of relay.firefox.com r=credential-management-reviewers,dimi\n\nDifferential Revision: https://phabricator.services.mozilla.com/D175705", + "extra": { + "branch": "default", + "moz-landing-system": "lando" + }, + "files": [ + "modules/libpref/init/all.js", + "toolkit/components/passwordmgr/FirefoxRelay.sys.mjs" + ], + "landingsystem": "lando", + "node": "091fb26cb5df9e5a61d9a43883b33bdf1736ea6e", + "parents": ["ea52cdb6d093a5eb233b10a207b64d02b7489c23"], + "perfherderurl": "https://treeherder.mozilla.org/perf.html#/compare?originalProject=mozilla-central&originalRevision=6ca54f5a4a1b2a12530001ea3f092c29810e803c&newProject=mozilla-central&newRevision=11fec803ea08a3e440016a5cdc9686937fd94041", + "phase": "public", + "pushdate": [1681982536, 0], + "pushhead": "6ca54f5a4a1b2a12530001ea3f092c29810e803c", + "pushid": 40795, + "pushuser": "nfay@mozilla.com", + "rev": 661167, + "reviewers": [ + { + "name": "credential-management-reviewers", + "revset": "reviewer(credential-management-reviewers)" + }, + { + "name": "dimi", + "revset": "reviewer(dimi)" + } + ], + "treeherderrepo": "mozilla-central", + "treeherderrepourl": "https://treeherder.mozilla.org/jobs?repo=mozilla-central" + }, + { + "author": "Randell Jesup <rjesup@mozilla.com>", + "backsoutnodes": [], + "bugs": [ + { + "no": "1828973", + "url": "https://bugzilla.mozilla.org/show_bug.cgi?id=1828973" + } + ], + "date": [1681928684, 0], + "desc": "Bug 1828973: Disable OCSP for web-platform tests r=jgraham\n\nDifferential Revision: https://phabricator.services.mozilla.com/D175936", + "extra": { + "branch": "default", + "moz-landing-system": "lando" + }, + "files": [ + "testing/profiles/web-platform/user.js", + "testing/web-platform/meta/webtransport/__dir__.ini" + ], + "landingsystem": "lando", + "node": "ef5c4d384d2819bb857e1812ddca469fb0b87b86", + "parents": ["ccc54cebee26a52410f7c0cbd8ff8693078a620f"], + "perfherderurl": "https://treeherder.mozilla.org/perf.html#/compare?originalProject=mozilla-central&originalRevision=6ca54f5a4a1b2a12530001ea3f092c29810e803c&newProject=mozilla-central&newRevision=11fec803ea08a3e440016a5cdc9686937fd94041", + "phase": "public", + "pushdate": [1681982536, 0], + "pushhead": "6ca54f5a4a1b2a12530001ea3f092c29810e803c", + "pushid": 40795, + "pushuser": "nfay@mozilla.com", + "rev": 661170, + "reviewers": [ + { + "name": "jgraham", + "revset": "reviewer(jgraham)" + } + ], + "treeherderrepo": "mozilla-central", + "treeherderrepourl": "https://treeherder.mozilla.org/jobs?repo=mozilla-central" + }, + { + "author": "Stanca Serban <sstanca@mozilla.com>", + "backsoutnodes": [ + { + "node": "80b29d7af43145cdd678d4ea51e770271f0c56ce" + } + ], + "bugs": [ + { + "no": "1817463", + "url": "https://bugzilla.mozilla.org/show_bug.cgi?id=1817463" + } + ], + "date": [1681930381, -10800], + "desc": "Backed out changeset 80b29d7af431 (bug 1817463) for failures in toolkit/components/url-classifier/tests.", + "extra": { + "branch": "default", + "rebase_source": "9fc0fd23fdbaa4c30568ca895af3e1c9e3c08aea" + }, + "files": [ + "toolkit/components/url-classifier/UrlClassifierListManager.jsm" + ], + "node": "ae17e25d0f24bd1b6dee872c77c9770ad0ec7d87", + "parents": ["6ec708eb48569fcfb9bf708d91a8876383865a65"], + "perfherderurl": "https://treeherder.mozilla.org/perf.html#/compare?originalProject=mozilla-central&originalRevision=6ca54f5a4a1b2a12530001ea3f092c29810e803c&newProject=mozilla-central&newRevision=11fec803ea08a3e440016a5cdc9686937fd94041", + "phase": "public", + "pushdate": [1681982536, 0], + "pushhead": "6ca54f5a4a1b2a12530001ea3f092c29810e803c", + "pushid": 40795, + "pushuser": "nfay@mozilla.com", + "rev": 661172, + "reviewers": [], + "treeherderrepo": "mozilla-central", + "treeherderrepourl": "https://treeherder.mozilla.org/jobs?repo=mozilla-central" + }, + { + "author": "Bilal <bnasar@mozilla.com>", + "backsoutnodes": [], + "bugs": [ + { + "no": "1817002", + "url": "https://bugzilla.mozilla.org/show_bug.cgi?id=1817002" + } + ], + "date": [1681931937, 0], + "desc": "Bug 1817002 - ESMified browser/components/pocket/content. r=kpatenio\n\nDifferential Revision: https://phabricator.services.mozilla.com/D175700", + "extra": { + "branch": "default", + "moz-landing-system": "lando" + }, + "files": [ + "toolkit/components/normandy/content/AboutPages.sys.mjs", + "toolkit/modules/NewTabUtils.sys.mjs" + ], + "landingsystem": "lando", + "node": "eff25b124b5e2c29c10442e902e9c4a9c488672c", + "parents": ["dcb12f0cfb12a4d3ae666f1660276b9cea2419ba"], + "perfherderurl": "https://treeherder.mozilla.org/perf.html#/compare?originalProject=mozilla-central&originalRevision=6ca54f5a4a1b2a12530001ea3f092c29810e803c&newProject=mozilla-central&newRevision=11fec803ea08a3e440016a5cdc9686937fd94041", + "phase": "public", + "pushdate": [1681982536, 0], + "pushhead": "6ca54f5a4a1b2a12530001ea3f092c29810e803c", + "pushid": 40795, + "pushuser": "nfay@mozilla.com", + "rev": 661174, + "reviewers": [ + { + "name": "kpatenio", + "revset": "reviewer(kpatenio)" + } + ], + "treeherderrepo": "mozilla-central", + "treeherderrepourl": "https://treeherder.mozilla.org/jobs?repo=mozilla-central" + }, + { + "author": "Sammy Khamis <skhamis@mozilla.com>", + "backsoutnodes": [], + "bugs": [ + { + "no": "1825905", + "url": "https://bugzilla.mozilla.org/show_bug.cgi?id=1825905" + } + ], + "date": [1681937295, 0], + "desc": "Bug 1825905: Autofill sync engine should roundtrip data it doesn't know about r=sgalich,lina\n\nDifferential Revision: https://phabricator.services.mozilla.com/D174834", + "extra": { + "branch": "default", + "moz-landing-system": "lando" + }, + "files": [ + "toolkit/components/formautofill/FormAutofillStorageBase.sys.mjs" + ], + "landingsystem": "lando", + "node": "2d1f87aeb76249a22f8db78ac031305816544514", + "parents": ["5f3904256e0d38a7cffed5ef443b7b259d43ad49"], + "perfherderurl": "https://treeherder.mozilla.org/perf.html#/compare?originalProject=mozilla-central&originalRevision=6ca54f5a4a1b2a12530001ea3f092c29810e803c&newProject=mozilla-central&newRevision=11fec803ea08a3e440016a5cdc9686937fd94041", + "phase": "public", + "pushdate": [1681982536, 0], + "pushhead": "6ca54f5a4a1b2a12530001ea3f092c29810e803c", + "pushid": 40795, + "pushuser": "nfay@mozilla.com", + "rev": 661182, + "reviewers": [ + { + "name": "sgalich", + "revset": "reviewer(sgalich)" + }, + { + "name": "lina", + "revset": "reviewer(lina)" + } + ], + "treeherderrepo": "mozilla-central", + "treeherderrepourl": "https://treeherder.mozilla.org/jobs?repo=mozilla-central" + } + ], + "visible": true +} diff --git a/comm/taskcluster/comm_taskgraph/test/python.ini b/comm/taskcluster/comm_taskgraph/test/python.ini new file mode 100644 index 0000000000..84548afeb0 --- /dev/null +++ b/comm/taskcluster/comm_taskgraph/test/python.ini @@ -0,0 +1,6 @@ +[DEFAULT] +subsuite = comm_taskgraph + +[test_files_changed.py] +[test_optimization_strategies.py] +[test_parameters.py] diff --git a/comm/taskcluster/comm_taskgraph/test/test_files_changed.py b/comm/taskcluster/comm_taskgraph/test/test_files_changed.py new file mode 100644 index 0000000000..5759520de6 --- /dev/null +++ b/comm/taskcluster/comm_taskgraph/test/test_files_changed.py @@ -0,0 +1,144 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + +import json +import os +import unittest + +import conftest # noqa: F401 +from mozunit import main + +from gecko_taskgraph.util import hg + +from comm_taskgraph import files_changed + +PARAMS = { + "comm_head_repository": "https://hg.mozilla.org/comm-central", + "comm_head_rev": "d0c328a2cc33", + "head_repository": "https://hg.mozilla.org/mozilla-central", + "head_rev": "6ca54f5a4a1b", + "comm_src_path": "comm/", +} + +FILES_CHANGED_CC = [ + "mail/base/content/mailWindowOverlay.js", + "mail/components/extensions/parent/ext-compose.js", + "mail/components/extensions/parent/ext-mail.js", + "mail/components/extensions/parent/ext-messages.js", + "mail/test/browser/folder-widget/browser.ini", + "mail/test/browser/folder-widget/browser_messageFilters.js", + "mailnews/base/src/nsMsgGroupView.cpp", + "mailnews/base/src/nsMsgQuickSearchDBView.cpp", + "mailnews/base/src/nsMsgSearchDBView.cpp", + "mailnews/base/src/nsMsgThreadedDBView.cpp", + "mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp", +] + +FILES_CHANGED_MC = [ + "modules/libpref/init/StaticPrefList.yaml", + "modules/libpref/init/all.js", + "testing/profiles/web-platform/user.js", + "testing/web-platform/meta/webtransport/__dir__.ini", + "toolkit/components/cleardata/ClearDataService.sys.mjs", + "toolkit/components/cleardata/tests/unit/test_identity_credential_storage.js", + "toolkit/components/formautofill/FormAutofillStorageBase.sys.mjs", + "toolkit/components/normandy/content/AboutPages.sys.mjs", + "toolkit/components/passwordmgr/FirefoxRelay.sys.mjs", + "toolkit/components/url-classifier/UrlClassifierListManager.jsm", + "toolkit/modules/NewTabUtils.sys.mjs", +] + +FILES_CHANGED = sorted( + FILES_CHANGED_MC + [os.path.join("comm", file) for file in FILES_CHANGED_CC] +) + + +class FakeResponse: + def __init__(self, url, **kwargs): + if "comm-central" in url: + self.filename = "cc_automationrelevance.json" + elif "mozilla-central" in url: + self.filename = "mc_automationrelevance.json" + else: + raise Exception(f"Invalid automation URL: {url}") + + def json(self): + with open(os.path.join(os.path.dirname(__file__), self.filename)) as f: + return json.load(f) + + +class TestGetChangedFiles(unittest.TestCase): + def setUp(self): + files_changed.get_changed_files.clear() + self.old_get = hg.requests.get + + def fake_get(url, **kwargs): + return FakeResponse(url) + + hg.requests.get = fake_get + + def tearDown(self): + hg.requests.get = self.old_get + files_changed.get_changed_files.clear() + + def test_get_changed_files_mc(self): + """Get_changed_files correctly gets the list of changed files in a push. + This tests against the production hg.mozilla.org so that it will detect + any changes in the format of the returned data.""" + self.assertEqual( + sorted(files_changed.get_changed_files(PARAMS["head_repository"], PARAMS["head_rev"])), + FILES_CHANGED_MC, + ) + + def test_get_changed_files_cc(self): + """Get_changed_files correctly gets the list of changed files in a push. + This tests against the production hg.mozilla.org so that it will detect + any changes in the format of the returned data.""" + self.assertEqual( + sorted( + files_changed.get_changed_files( + PARAMS["comm_head_repository"], PARAMS["comm_head_rev"] + ) + ), + FILES_CHANGED_CC, + ) + + def test_get_changed_files_extended(self): + """Get_changed_files_extended correctly gets the list of changed files in a push. + This tests against the production hg.mozilla.org so that it will detect + any changes in the format of the returned data.""" + self.assertEqual( + sorted(files_changed.get_files_changed_extended(PARAMS)), + FILES_CHANGED, + ) + + +class TestCheck(unittest.TestCase): + def setUp(self): + files_changed.get_changed_files[PARAMS["head_repository"], PARAMS["head_rev"]] = set( + FILES_CHANGED_MC + ) + files_changed.get_changed_files[ + PARAMS["comm_head_repository"], PARAMS["comm_head_rev"] + ] = set(FILES_CHANGED_CC) + + def tearDown(self): + files_changed.get_changed_files.clear() + + def test_check_no_params(self): + self.assertTrue(files_changed.check({}, ["ignored"])) + + def test_check_no_match(self): + self.assertFalse(files_changed.check(PARAMS, ["nosuch/**"])) + self.assertFalse(files_changed.check(PARAMS, ["comm/nosuch/**"])) + + def test_check_match_mc(self): + self.assertTrue(files_changed.check(PARAMS, ["toolkit/**"])) + + def test_check_match_cc(self): + self.assertTrue(files_changed.check(PARAMS, ["comm/mail/**"])) + + +if __name__ == "__main__": + main() diff --git a/comm/taskcluster/comm_taskgraph/test/test_optimization_strategies.py b/comm/taskcluster/comm_taskgraph/test/test_optimization_strategies.py new file mode 100644 index 0000000000..8e43760714 --- /dev/null +++ b/comm/taskcluster/comm_taskgraph/test/test_optimization_strategies.py @@ -0,0 +1,143 @@ +# Any copyright is dedicated to the public domain. +# http://creativecommons.org/publicdomain/zero/1.0/ + +import hashlib +from datetime import datetime +from time import mktime + +import conftest # noqa: F401 +import pytest +import responses +from mozunit import main +from taskgraph.task import Task + +from gecko_taskgraph.optimize import registry + +from comm_taskgraph.optimize import SkipSuiteOnly + + +def generate_task(): + task = {} + task.setdefault("label", "task-label") + task.setdefault("kind", "build") + task.setdefault("task", {}) + task.setdefault("attributes", {}) + + for attr in ( + "dependencies", + "optimization", + "soft_dependencies", + "release_artifacts", + ): + task.setdefault(attr, None) + + task["task"].setdefault("label", task["label"]) + return Task.from_json(task) + + +def idfn(param): + if isinstance(param, tuple): + return param[0].__name__ + return None + + +def generate_json_push_data(files_changed): + return {"changesets": [{"desc": "commit comment", "files": files_changed, "node": "cdefgh"}]} + + +@pytest.fixture +def params(): + return { + "branch": "comm-central", + "head_repository": "https://hg.mozilla.org/mozilla-central", + "head_rev": "zyxwvu", + "comm_head_repository": "https://hg.mozilla.org/comm-central", + "comm_head_rev": "abcdef", + "comm_src_path": "comm/", + "project": "comm-central", + "pushlog_id": 1, + "pushdate": mktime(datetime.now().timetuple()), + } + + +def mk_rev(strings): + data = "".join(strings).encode("utf-8") + h = hashlib.new("sha1") + h.update(data) + return h.hexdigest() + + +@responses.activate +@pytest.mark.parametrize( + "pushed_files,expected", + [ + # suite-only push + pytest.param(["suite/a/b/c.txt", "suite/b/c/d.txt"], True), + # non-suite push + pytest.param(["mail/a/b/c.txt", "mailnews/b/c/d.txt"], False), + # mixed push + pytest.param(["suite/a/b/c.txt", "calendar/b/c/d.txt"], False), + ], + ids=idfn, +) +def test_suite_only_strategy(params, pushed_files, expected): + rev = mk_rev(pushed_files) + params["comm_head_rev"] = rev + + responses.add( + responses.GET, + "https://hg.mozilla.org/comm-central/json-automationrelevance/{}".format(rev), + json=generate_json_push_data(pushed_files), + status=200, + ) + task = generate_task() + + opt = SkipSuiteOnly() + remove = opt.should_remove_task(task, params, None) + + assert remove == expected + + +@responses.activate +@pytest.mark.parametrize( + "file_patterns,pushed_files,expected", + [ + # suite-only push, matches files-changed + pytest.param(["comm/**/*.txt"], ["suite/a/b/c.txt", "suite/b/c/d.js"], True), + # suite-only push, does not match files-changed + pytest.param(["comm/**/*.cpp"], ["suite/a/b/c.txt", "suite/b/c/d.js"], True), + # non-suite push, matches files changed + pytest.param(["comm/**/*.txt"], ["mail/a/b/c.txt", "mailnews/b/c/d.js"], False), + # non-suite push, does not match files changed + pytest.param(["comm/**/*.cpp"], ["mail/a/b/c.txt", "mailnews/b/c/d.js"], True), + ], + ids=idfn, +) +def test_suite_files_changed_strategy(params, file_patterns, pushed_files, expected): + rev = mk_rev(pushed_files) + params["comm_head_rev"] = rev + + # Fake the m-c json data + responses.add( + responses.GET, + "https://hg.mozilla.org/mozilla-central/json-automationrelevance/zyxwvu", + json=generate_json_push_data([]), + status=200, + ) + + responses.add( + responses.GET, + "https://hg.mozilla.org/comm-central/json-automationrelevance/{}".format(rev), + json=generate_json_push_data(pushed_files), + status=200, + ) + task = generate_task() + + opt = registry["skip-unless-changed-no-suite"] + remove = opt.should_remove_task(task, params, file_patterns) + + assert remove == expected + + +if __name__ == "__main__": + main() diff --git a/comm/taskcluster/comm_taskgraph/test/test_parameters.py b/comm/taskcluster/comm_taskgraph/test/test_parameters.py new file mode 100644 index 0000000000..8a9d78701b --- /dev/null +++ b/comm/taskcluster/comm_taskgraph/test/test_parameters.py @@ -0,0 +1,102 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +import unittest + +import conftest # noqa: F401 +from mozunit import main +from taskgraph.parameters import Parameters + +from comm_taskgraph.parameters import register_parameters + + +class TestCommParameters(unittest.TestCase): + + vals = { + "app_version": "app_version", + "backstop": False, + "base_repository": "base_repository", + "base_ref": "base_ref", + "base_rev": "base_rev", + "build_date": 0, + "build_number": 0, + "comm_base_repository": "comm_base_repository", + "comm_base_ref": "comm_base_ref", + "comm_base_rev": "comm_base_rev", + "comm_head_ref": "comm_head_ref", + "comm_head_repository": "comm_head_repository", + "comm_head_rev": "comm_head_rev", + "comm_src_path": "comm/", + "do_not_optimize": [], + "enable_always_target": False, + "existing_tasks": {}, + "filters": [], + "head_ref": "head_ref", + "head_repository": "head_repository", + "head_rev": "head_rev", + "head_tag": "", + "hg_branch": "hg_branch", + "level": "level", + "message": "message", + "moz_build_date": "moz_build_date", + "next_version": "next_version", + "optimize_strategies": None, + "optimize_target_tasks": False, + "owner": "owner", + "phabricator_diff": "phabricator_diff", + "project": "project", + "pushdate": 0, + "pushlog_id": "pushlog_id", + "release_enable_emefree": False, + "release_enable_partner_repack": False, + "release_enable_partner_attribution": False, + "release_eta": None, + "release_history": {}, + "release_partners": [], + "release_partner_config": None, + "release_partner_build_number": 1, + "release_type": "release_type", + "release_product": None, + "repository_type": "hg", + "required_signoffs": [], + "signoff_urls": {}, + "target_tasks_method": "target_tasks_method", + "test_manifest_loader": "default", + "tasks_for": "tasks_for", + "try_mode": "try_mode", + "try_options": None, + "try_task_config": {}, + "version": "version", + } + + def setUp(self): + register_parameters() + + def test_Parameters_check(self): + """ + Specifying all of the gecko and comm parameters doesn't result in an error. + """ + p = Parameters(**self.vals) + p.check() # should not raise + + def test_Parameters_check_missing(self): + """ + If any of the comm parameters are specified, all of them must be specified. + """ + vals = self.vals.copy() + del vals["comm_base_repository"] + p = Parameters(**vals) + self.assertRaises(Exception, p.check) + + def test_Parameters_check_extra(self): + """ + If parameters other than the global and comm parameters are specified, + an error is reported. + """ + p = Parameters(extra="data", **self.vals) + self.assertRaises(Exception, p.check) + + +if __name__ == "__main__": + main() |