Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variant #8433

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Variant #8433

Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 42 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,48 @@ def _fetch_test_variants(self):
)


@pytest.fixture
def mock_test_manifests_firefoxci_request(monkeypatch):
"""
Mock fetch_test_manifests() used to retreive test manifests from firefox-ci
"""

def _fetch_test_manifests(self):
tests_folder = os.path.dirname(__file__)
file_name = "test-info-all-tests.json"
data_path = os.path.join(tests_folder, "sample_data", file_name)
with open(data_path) as f:
data = json.load(f)
return data

monkeypatch.setattr(
treeherder.intermittents_commenter.commenter.Commenter,
"fetch_test_manifests",
_fetch_test_manifests,
)


@pytest.fixture
def mock_testrun_matrix_firefoxci_request(monkeypatch):
"""
Mock fetch_testrun_matrix() used to retreive testrun matrix from firefox-ci
"""

def _fetch_testrun_matrix(self):
tests_folder = os.path.dirname(__file__)
file_name = "test-info-testrun-matrix.json"
data_path = os.path.join(tests_folder, "sample_data", file_name)
with open(data_path) as f:
data = json.load(f)
return data

monkeypatch.setattr(
treeherder.intermittents_commenter.commenter.Commenter,
"fetch_testrun_matrix",
_fetch_testrun_matrix,
)


class MockResponse:
def __init__(self):
self.status_code = 200
Expand Down
2 changes: 1 addition & 1 deletion tests/etl/test_job_ingestion.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_ingest_single_sample_job(
job = Job.objects.get(id=1)
# Ensure we don't inadvertently change the way we generate job-related hashes.
assert job.option_collection_hash == "32faaecac742100f7753f0c1d0aa0add01b4046b"
assert job.signature.signature == "d900aca1e93a9ef2d9e00c1877c838ea920abca1"
assert job.signature.signature == "6549359f93a4e477e3248fae08eeab3ebefcf7fb"


def test_ingest_all_sample_jobs(
Expand Down
6 changes: 3 additions & 3 deletions tests/intermittents_commenter/expected_comment.text
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ This is the #1 most frequent failure this week.
* debug: 1

## Table
| |**no_variant**|
|---|:-:|
|**linux1804-x86/debug**|1|
| |**asan**|**debug**|**no_variant**|**opt**|**tsan**|
|---|:-:|:-:|:-:|:-:|:-:|
|**linux1804-x86_64/debug**| | |1| | |

## For more details, see:
https://treeherder.mozilla.org/intermittent-failures/bugdetails?bug=1&startday=2012-05-09&endday=2018-05-10&tree=all
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ This is the #1 most frequent failure this week.
* debug: 1

## Table
| |**headless**|**no_variant**|
|---|:-:|:-:|
|**linux1804-x86/debug**| |1|
|**linux1804-x86/opt**| |1|
|**mac1015-x86_64/debug**| |1|
|**mac1120-x86_64/debug**|1| |
|**windows7-32-x86/debug**|1| |
| |**asan**|**debug**|**headless**|**no_variant**|**opt**|**tsan**|
|---|:-:|:-:|:-:|:-:|:-:|:-:|
|**linux1804-x86_64/debug**| | | |1| | |
|**linux1804-x86_64/opt**| | | |1| | |
|**mac1015-x86_64/debug**| | | |1| | |
|**mac1120-aarch64/debug**| | |1| | | |
|**windows7-32-x86/debug**| | |1| | | |

## For more details, see:
https://treeherder.mozilla.org/intermittent-failures/bugdetails?bug=1&startday=2012-05-09&endday=2018-05-10&tree=all
12 changes: 10 additions & 2 deletions tests/intermittents_commenter/test_commenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@


@responses.activate
def test_intermittents_commenter(bug_data, mock_test_variants_firefoxci_request):
def test_intermittents_commenter(
bug_data,
mock_test_variants_firefoxci_request,
mock_test_manifests_firefoxci_request,
mock_testrun_matrix_firefoxci_request,
):
startday = "2012-05-09"
endday = "2018-05-10"
alt_startday = startday
Expand Down Expand Up @@ -44,7 +49,10 @@ def test_intermittents_commenter(bug_data, mock_test_variants_firefoxci_request)

@responses.activate
def test_intermittents_commenter_with_failures(
bug_data_with_5_failures, mock_test_variants_firefoxci_request
bug_data_with_5_failures,
mock_test_variants_firefoxci_request,
mock_test_manifests_firefoxci_request,
mock_testrun_matrix_firefoxci_request,
):
startday = "2012-05-09"
endday = "2018-05-10"
Expand Down
2 changes: 1 addition & 1 deletion tests/sample_data/bug_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
{
"status": "NEW",
"id": 1,
"summary": "This bug should not be matched",
"summary": "Intermittent browser/components/sessionstore/test/browser_sessionHistory.js | single tracking bug",
"dupe_of": null,
"duplicates": [],
"cf_crash_signature": "",
Expand Down
8 changes: 4 additions & 4 deletions tests/sample_data/job_data.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{"project": "mozilla-central", "job": {"build_platform": {"platform": "linux1804", "os_name": "linux", "architecture": "x86"}, "submit_timestamp": 1384353546, "start_timestamp": 1384353553, "job_guid": "f1c75261017c7c5ce3000931dce4c442fe0a1297", "name": "Linux x64 Tsan Build", "reference_data_name": "mozilla-release_linux-debug_dep", "log_references": [{"url": "http://ftp.mozilla.org/pub/mozilla.org/tinderbox-builds/mozilla-release-emulator-jb-debug/1384353546/mozilla-release_linux-debug_dep-bm62-build1-build17.txt.gz", "name": "live_backing_log"}], "option_collection": {"debug": true}, "who": "mozilla-release", "group_symbol": "?", "state": "completed", "artifact": {"log_urls": [], "type": "", "name": "", "blob": ""}, "machine_platform": {"platform": "linux1804", "os_name": "linux", "architecture": "x86"}, "machine": "bld-linux64-ec2-132", "reason": "scheduler", "result": "success", "job_symbol": "B", "group_name": null, "product_name": "firefox", "end_timestamp": 1384364989}, "resultset_id": 1, "revision": "45f8637cb9f78f19cb8463ff174e81756805d8cf"}
{"project": "mozilla-central", "job": {"build_platform": {"platform": "linux1804", "os_name": "linux", "architecture": "x86"}, "submit_timestamp": 1384353546, "start_timestamp": 1384353555, "job_guid": "9abb6f7d54a49d763c584926377f09835c5e1a32", "name": "Linux x64 Tsan Build", "reference_data_name": "mozilla-release_emulator-jb_dep", "log_references": [{"url": "http://ftp.mozilla.org/pub/mozilla.org/tinderbox-builds/mozilla-release-emulator-jb/1384353546/mozilla-release_emulator-jb_dep-bm58-build1-build29.txt.gz", "name": "live_backing_log"}], "option_collection": {"opt": true}, "who": "mozilla-release", "group_symbol": "?", "state": "completed", "artifact": {"log_urls": [], "type": "", "name": "", "blob": ""}, "machine_platform": {"platform": "linux1804", "os_name": "linux", "architecture": "x86"}, "machine": "bld-linux64-ec2-462", "reason": "scheduler", "result": "success", "job_symbol": "B", "group_name": null, "product_name": "firefox", "end_timestamp": 1384364662}, "resultset_id": 1, "revision": "45f8637cb9f78f19cb8463ff174e81756805d8cf"}
{"project": "mozilla-central", "job": {"build_platform": {"platform": "mac1015", "os_name": "mac", "architecture": "x86_64"}, "submit_timestamp": 1384356854, "start_timestamp": 1384356876, "job_guid": "d9cb3668f75f8f1b0b4ef503778ad0b90595a693", "name": "Mochitest Browser Chrome", "reference_data_name": "Rev4 MacOSX Snow Leopard 10.6 mozilla-release debug test mochitest-browser-chrome", "log_references": [{"url": "http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/mozilla-release-macosx64-debug/1384353545/mozilla-release_snowleopard-debug_test-mochitest-browser-chrome-bm76-tests1-macosx-build14.txt.gz", "name": "live_backing_log"}], "option_collection": {"debug": true}, "who": "tests-mozilla-release-snowleopard-debug-unittest", "group_symbol": "M", "state": "completed", "artifact": {"log_urls": [], "type": "", "name": "", "blob": ""}, "machine_platform": {"platform": "mac1015", "os_name": "mac", "architecture": "x86_64"}, "machine": "talos-r4-snow-007", "reason": "scheduler", "result": "success", "job_symbol": "bc", "group_name": "Mochitest", "product_name": "firefox", "end_timestamp": 1384363994}, "resultset_id": 1, "revision": "45f8637cb9f78f19cb8463ff174e81756805d8cf"}
{"project": "mozilla-central", "job": {"build_platform": {"platform": "mac1120", "os_name": "mac", "architecture": "x86_64"}, "submit_timestamp": 1384356854, "start_timestamp": 1384356880, "job_guid": "ab952a4bbbc74f1d9fb3cf536073b371029dbd02", "name": "Mochitest Browser Chrome", "reference_data_name": "Rev4 MacOSX Lion 10.7 mozilla-release debug test mochitest-browser-chrome", "log_references": [{"url": "http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/mozilla-release-macosx64-debug/1384353545/mozilla-release_lion-debug_test-mochitest-browser-chrome-bm76-tests1-macosx-build12.txt.gz", "name": "live_backing_log"}], "option_collection": {"debug": true}, "who": "tests-mozilla-release-lion-debug-unittest", "group_symbol": "M", "state": "completed", "artifact": {"log_urls": [], "type": "", "name": "", "blob": ""}, "machine_platform": {"platform": "mac1120", "os_name": "mac", "architecture": "x86_64"}, "machine": "talos-r4-lion-011", "reason": "scheduler", "result": "success", "job_symbol": "bc", "group_name": "Mochitest", "product_name": "firefox", "end_timestamp": 1384364849}, "resultset_id": 1, "revision": "45f8637cb9f78f19cb8463ff174e81756805d8cf"}
{"project": "mozilla-central", "job": {"build_platform": {"platform": "linux1804", "os_name": "linux", "architecture": "x86"}, "submit_timestamp": 1384353546, "start_timestamp": 1384353553, "job_guid": "f1c75261017c7c5ce3000931dce4c442fe0a1297", "name": "Linux x64 Tsan Build", "reference_data_name": "mozilla-release_linux-debug_dep", "log_references": [{"url": "http://ftp.mozilla.org/pub/mozilla.org/tinderbox-builds/mozilla-release-emulator-jb-debug/1384353546/mozilla-release_linux-debug_dep-bm62-build1-build17.txt.gz", "name": "live_backing_log"}], "option_collection": {"debug": true}, "who": "mozilla-release", "group_symbol": "?", "state": "completed", "artifact": {"log_urls": [], "type": "", "name": "", "blob": ""}, "machine_platform": {"platform": "linux1804", "os_name": "linux", "architecture": "x86_64"}, "machine": "bld-linux64-ec2-132", "reason": "scheduler", "result": "success", "job_symbol": "B", "group_name": null, "product_name": "firefox", "end_timestamp": 1384364989}, "resultset_id": 1, "revision": "45f8637cb9f78f19cb8463ff174e81756805d8cf"}
{"project": "mozilla-central", "job": {"build_platform": {"platform": "linux1804", "os_name": "linux", "architecture": "x86"}, "submit_timestamp": 1384353546, "start_timestamp": 1384353555, "job_guid": "9abb6f7d54a49d763c584926377f09835c5e1a32", "name": "Linux x64 Tsan Build", "reference_data_name": "mozilla-release_emulator-jb_dep", "log_references": [{"url": "http://ftp.mozilla.org/pub/mozilla.org/tinderbox-builds/mozilla-release-emulator-jb/1384353546/mozilla-release_emulator-jb_dep-bm58-build1-build29.txt.gz", "name": "live_backing_log"}], "option_collection": {"opt": true}, "who": "mozilla-release", "group_symbol": "?", "state": "completed", "artifact": {"log_urls": [], "type": "", "name": "", "blob": ""}, "machine_platform": {"platform": "linux1804", "os_name": "linux", "architecture": "x86_64"}, "machine": "bld-linux64-ec2-462", "reason": "scheduler", "result": "success", "job_symbol": "B", "group_name": null, "product_name": "firefox", "end_timestamp": 1384364662}, "resultset_id": 1, "revision": "45f8637cb9f78f19cb8463ff174e81756805d8cf"}
{"project": "mozilla-central", "job": {"build_platform": {"platform": "mac1015", "os_name": "mac", "architecture": "ax86_64"}, "submit_timestamp": 1384356854, "start_timestamp": 1384356876, "job_guid": "d9cb3668f75f8f1b0b4ef503778ad0b90595a693", "name": "Mochitest Browser Chrome", "reference_data_name": "Rev4 MacOSX Snow Leopard 10.6 mozilla-release debug test mochitest-browser-chrome", "log_references": [{"url": "http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/mozilla-release-macosx64-debug/1384353545/mozilla-release_snowleopard-debug_test-mochitest-browser-chrome-bm76-tests1-macosx-build14.txt.gz", "name": "live_backing_log"}], "option_collection": {"debug": true}, "who": "tests-mozilla-release-snowleopard-debug-unittest", "group_symbol": "M", "state": "completed", "artifact": {"log_urls": [], "type": "", "name": "", "blob": ""}, "machine_platform": {"platform": "mac1015", "os_name": "mac", "architecture": "x86_64"}, "machine": "talos-r4-snow-007", "reason": "scheduler", "result": "success", "job_symbol": "bc", "group_name": "Mochitest", "product_name": "firefox", "end_timestamp": 1384363994}, "resultset_id": 1, "revision": "45f8637cb9f78f19cb8463ff174e81756805d8cf"}
{"project": "mozilla-central", "job": {"build_platform": {"platform": "mac1120", "os_name": "mac", "architecture": "cx86_64"}, "submit_timestamp": 1384356854, "start_timestamp": 1384356880, "job_guid": "ab952a4bbbc74f1d9fb3cf536073b371029dbd02", "name": "Mochitest Browser Chrome", "reference_data_name": "Rev4 MacOSX Lion 10.7 mozilla-release debug test mochitest-browser-chrome", "log_references": [{"url": "http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/mozilla-release-macosx64-debug/1384353545/mozilla-release_lion-debug_test-mochitest-browser-chrome-bm76-tests1-macosx-build12.txt.gz", "name": "live_backing_log"}], "option_collection": {"debug": true}, "who": "tests-mozilla-release-lion-debug-unittest", "group_symbol": "M", "state": "completed", "artifact": {"log_urls": [], "type": "", "name": "", "blob": ""}, "machine_platform": {"platform": "mac1120", "os_name": "mac", "architecture": "aarch64"}, "machine": "talos-r4-lion-011", "reason": "scheduler", "result": "success", "job_symbol": "bc", "group_name": "Mochitest", "product_name": "firefox", "end_timestamp": 1384364849}, "resultset_id": 1, "revision": "45f8637cb9f78f19cb8463ff174e81756805d8cf"}
{"resultset_id": 1, "superseded": ["f1c75261017c7c5ce3000931dce4c442fe0a1297", "9abb6f7d54a49d763c584926377f09835c5e1a32", "ab952a4bbbc74f1d9fb3cf536073b371029dbd02"], "project": "mozilla-central", "job": {"build_platform": {"platform": "windows7-32", "os_name": "win", "architecture": "x86"}, "submit_timestamp": 1384358654, "start_timestamp": 1384358660, "job_guid": "5da36fb825bc52d13fed5b805d44015b0f2f2f16", "name": "Mochitest Browser Chrome", "reference_data_name": "Windows 7 32-bit mozilla-release debug test mochitest-browser-chrome", "log_references": [{"url": "http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/mozilla-release-win32-debug/1384353545/mozilla-release_win7-ix-debug_test-mochitest-browser-chrome-bm74-tests1-windows-build2.txt.gz", "name": "live_backing_log"}], "option_collection": {"debug": true}, "who": "tests-mozilla-release-win7-ix-debug-unittest", "group_symbol": "M", "state": "completed", "artifact": {"log_urls": [], "type": "", "name": "", "blob": ""}, "machine_platform": {"platform": "windows7-32", "os_name": "win", "architecture": "x86"}, "machine": "t-w732-ix-117", "reason": "scheduler", "result": "success", "job_symbol": "bc", "group_name": "Mochitest", "product_name": "firefox", "end_timestamp": 1384363533}, "revision": "45f8637cb9f78f19cb8463ff174e81756805d8cf"}
{"project": "mozilla-central", "job": {"build_platform": {"platform": "windows8-32", "os_name": "win", "architecture": "x86"}, "submit_timestamp": 1384358653, "start_timestamp": 1384358664, "job_guid": "cf393ee59ed4d7302fe0bfbbe8988511b46b3379", "name": "Mochitest Browser Chrome", "reference_data_name": "WINNT 6.2 mozilla-release debug test mochitest-browser-chrome", "log_references": [{"url": "http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/mozilla-release-win32-debug/1384353545/mozilla-release_win8-debug_test-mochitest-browser-chrome-bm69-tests1-windows-build11.txt.gz", "name": "live_backing_log"}], "option_collection": {"debug": true}, "who": "tests-mozilla-release-win8-debug-unittest", "group_symbol": "M", "state": "completed", "artifact": {"log_urls": [], "type": "", "name": "", "blob": ""}, "machine_platform": {"platform": "windows8-32", "os_name": "win", "architecture": "x86"}, "machine": "t-w864-ix-043", "reason": "scheduler", "result": "success", "job_symbol": "bc", "group_name": "Mochitest", "product_name": "firefox", "end_timestamp": 1384363625}, "resultset_id": 1, "revision": "45f8637cb9f78f19cb8463ff174e81756805d8cf"}
{"project": "mozilla-central", "job": {"build_platform": {"platform": "windowsxp", "os_name": "win", "architecture": "x86"}, "submit_timestamp": 1384358653, "start_timestamp": 1384358665, "job_guid": "2914b818e425ad17dfe1a06cd7d0edd7cca4717a", "name": "Mochitest Browser Chrome", "reference_data_name": "Windows XP 32-bit mozilla-release debug test mochitest-browser-chrome", "log_references": [{"url": "http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/mozilla-release-win32-debug/1384353545/mozilla-release_xp-ix-debug_test-mochitest-browser-chrome-bm69-tests1-windows-build13.txt.gz", "name": "live_backing_log"}], "option_collection": {"debug": true}, "who": "tests-mozilla-release-xp-ix-debug-unittest", "group_symbol": "M", "state": "completed", "artifact": {"log_urls": [], "type": "", "name": "", "blob": ""}, "machine_platform": {"platform": "windowsxp", "os_name": "win", "architecture": "x86"}, "machine": "t-xp32-ix-081", "reason": "scheduler", "result": "success", "job_symbol": "bc", "group_name": "Mochitest", "product_name": "firefox", "end_timestamp": 1384363103}, "resultset_id": 1, "revision": "45f8637cb9f78f19cb8463ff174e81756805d8cf"}
Expand Down
Loading