Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View davehunt's full-sized avatar

Dave Hunt davehunt

View GitHub Profile
@davehunt
davehunt / requirements.txt
Created February 20, 2021 16:21
office door
blinkt; sys_platform == "linux"
google-api-python-client
google-auth-httplib2
google-auth-oauthlib
python-dateutil
@davehunt
davehunt / raptorpy3.diff
Created January 25, 2021 10:00
raptorpy3.diff
diff --git a/mach b/mach
--- a/mach
+++ b/mach
@@ -17,9 +17,6 @@ py2commands="
jsshell-bench
marionette-test
jstests
- mozharness
- raptor
- raptor-test
@davehunt
davehunt / console.log
Last active November 7, 2019 18:37
mach browsertime --setup
mach browsertime --setup
0:01.27 Downloading artifact to local cache: /Users/dhunt/.mozbuild/cache/browsertime/8745c3584f51f06e-ImageMagick-x86_64-apple-darwin18.7.0.tar.gz
0:02.00 Downloading... 0.0 %
0:02.47 Downloading... 5.0 %
0:02.61 Downloading... 10.0 %
0:02.73 Downloading... 15.1 %
0:02.82 Downloading... 20.0 %
0:02.91 Downloading... 25.1 %
0:02.99 Downloading... 30.0 %
0:03.08 Downloading... 35.1 %
from pathlib import Path
import json
import statistics
pathlist = Path(Path.cwd()).glob("*.json")
for path in sorted(pathlist):
print(f"\n{path}")
print("=" * len(str(path)))
with open(path) as f:
data = json.load(f)
from dataclasses import asdict, dataclass
import json
import os
import sys
from jsonschema import validate
# import requests
@dataclass
@davehunt
davehunt / wpt_user_agent.py
Created November 8, 2018 09:48
Show location and user agents from WebPageTest results
import json
with open("/Users/dhunt/Desktop/wpt.json") as f:
data = json.load(f)
for test in data:
location = test["data"]["location"]
request_headers = test["data"]["runs"]["1"]["firstView"]["requests"][0]["headers"]["request"]
user_agent = next(filter(lambda x: x.startswith("User-Agent:"), request_headers))
print(f"location: {location}")
print(f"- user-agent: {user_agent}")
diff --git a/build/virtualenv_packages.txt b/build/virtualenv_packages.txt
--- a/build/virtualenv_packages.txt
+++ b/build/virtualenv_packages.txt
@@ -77,4 +77,5 @@ mozilla.pth:third_party/python/pyasn1
mozilla.pth:third_party/python/pyasn1-modules
mozilla.pth:third_party/python/rsa
mozilla.pth:third_party/python/PyECC
+mozilla.pth:toolkit/components/telemetry/tests/marionette/harness
optional:packages.txt:comm/build/virtualenv_packages.txt
diff --git a/testing/marionette/mach_commands.py b/testing/marionette/mach_commands.py
failure {
script {
if (env.BRANCH_NAME == 'master') {
slackSend(
color: 'danger',
message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
}
}
}
}
mach python-test mozbase
Build configuration changed. Regenerating backend.
No build detected, test metadata may be incomplete.
No handlers could be found for logger "mozbuild.frontend.reader"
0:09.78 /Users/dhunt/workspace/firefox/testing/mozbase/manifestparser/tests/test_chunking.py
0:10.39 Traceback (most recent call last):
0:10.39 File "/Users/dhunt/workspace/firefox/testing/mozbase/manifestparser/tests/test_chunking.py", line 310, in <module>
0:10.39 mozunit.main()
0:10.39 File "/Users/dhunt/workspace/firefox/config/mozunit/mozunit/mozunit.py", line 240, in main
0:10.39 sys.exit(pytest.main(args))
@pytest.fixture
def test_job(eleven_job_blobs, create_jobs):
eleven_job_blobs[0]['job']['result'] = 'testfailed'
return create_jobs(eleven_job_blobs[0:1])[0]
@pytest.fixture(name='log')
def fixture_log(test_job):
JobLog.objects.create(
job=test_job,