Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.
/ mozilla-cia-tools Public archive

Miscellaneous tools for Mozilla Continuous Integration Automation

License

Notifications You must be signed in to change notification settings

bclary/mozilla-cia-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mozilla-cia-tools

Installation

We require python3 to get new library features and things and to cut ties with 2.7 since we are going to have to do it anyway EOY.

pip3 install --user virtualenv
python3 -m virtualenv venv
. venv/bin/activate
pip install -r requirements.txt

Tools

activedata_compare_tests.py

$ ./activedata_compare_tests.py --help

usage: activedata_compare_tests.py [-h]
                                   [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
                                   [--repo {mozilla-central,autoland,mozilla-inbound,try,mozilla-beta,mozilla-release,mozilla-esr68}]
                                   [--push_id PUSH_ID] [--author AUTHOR]
                                   [--comments COMMENTS]
                                   [--date-range DATE_RANGE | --revision REVISION | --commit-revision COMMIT_REVISION | --revision-url REVISION_URL | --revision-range REVISION_RANGE]
                                   [--treeherder-url TREEHERDER_URL]
                                   [--activedata ACTIVEDATA]
                                   [--combine-chunks]
                                   [--output-push-differences-only]

ActiveData compare-tests

Push Related Arguments

If a push isn't selected, the most recent push will be returned.

optional arguments:
  -h, --help            show this help message and exit
  --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Logging level. (default: INFO)
  --repo {mozilla-central,autoland,mozilla-inbound,try,mozilla-beta,mozilla-release,mozilla-esr68}
                        repository name to query. (default: mozilla-central)
  --push_id PUSH_ID     Push id. (default: None)
  --author AUTHOR       Push author email. Should be specified if --repo is try and more
                        than one revision is selected. (default: None)
  --comments COMMENTS   Push comments pattern. (default: None)
  --date-range DATE_RANGE
                        Push date range startdate enddate CCYY-MM-DD CCYY-MM-DD. (default: None)
  --revision REVISION   Push Revision. (default: None)
  --commit-revision COMMIT_REVISION
                        Either Push Revision or any commit referenced in the push. (default: None)
  --revision-url REVISION_URL
                        Url to push revision which can be used in place of --repo and --revision. (default: None)
  --revision-range REVISION_RANGE
                        Push revision range fromchange-tochange. (default: None)
  --treeherder-url TREEHERDER_URL
                        Treeherder url. (default: https://treeherder.mozilla.org)
  --activedata ACTIVEDATA
                        ActiveData url. (default: https://activedata.allizom.org/query)
  --combine-chunks      Combine chunks (default: False)
  --output-push-differences-only
                        When loading multiple pushes, only output keys which have different
                                values for sub_keys across the
                                pushes. (default: False)

You can save a set of arguments to a file and specify them later
using the @argfile syntax. The arguments contained in the file will
replace @argfile in the command line. Multiple files can be loaded
into the command line through the use of the @ syntax. Each argument
and its value must be on separate lines in the file.

activedata_query.py

writes results of ActiveData query in json format to stdout.

$ ./activedata_query.py --help

usage: activedata_query.py [-h]
                           [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
                           [--activedata ACTIVEDATA] --file FILE [--raw]

Query ActiveData tests and write the result as json to stdout.

optional arguments:
  -h, --help            show this help message and exit
  --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Logging level. (default: INFO)
  --activedata ACTIVEDATA
                        ActiveData url. (default: https://activedata.allizom.org/query)
  --file FILE           File containing ActiveData query as json.. (default: None)
  --raw                 Do not reformat/indent json. (default: False)

You can save a set of arguments to a file and specify them later
using the @argfile syntax. The arguments contained in the file will
replace @argfile in the command line. Multiple files can be loaded
into the command line through the use of the @ syntax. Each argument
and its value must be on separate lines in the file.

activedata_query_tests.py

$ ./activedata_query_tests.py --help

usage: activedata_query_tests.py [-h]
                                 [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
                                 [--repo {mozilla-central,autoland,mozilla-inbound,try,mozilla-beta,mozilla-release,mozilla-esr68}]
                                 [--push_id PUSH_ID] [--author AUTHOR]
                                 [--comments COMMENTS]
                                 [--date-range DATE_RANGE | --revision REVISION | --commit-revision COMMIT_REVISION | --revision-url REVISION_URL | --revision-range REVISION_RANGE]
                                 [--treeherder-url TREEHERDER_URL]
                                 [--activedata ACTIVEDATA]
                                 [--include-passing-tests] [--raw]

ActiveData query tests.

Query ActiveData tests and write the result as json to stdout.

Errors will be written to stderr.

Push Related Arguments

If a push isn't selected, the most recent push will be returned.

optional arguments:
  -h, --help            show this help message and exit
  --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Logging level. (default: INFO)
  --repo {mozilla-central,autoland,mozilla-inbound,try,mozilla-beta,mozilla-release,mozilla-esr68}
                        repository name to query. (default: mozilla-central)
  --push_id PUSH_ID     Push id. (default: None)
  --author AUTHOR       Push author email. Should be specified if --repo is try and more
                        than one revision is selected. (default: None)
  --comments COMMENTS   Push comments pattern. (default: None)
  --date-range DATE_RANGE
                        Push date range startdate enddate CCYY-MM-DD CCYY-MM-DD. (default: None)
  --revision REVISION   Push Revision. (default: None)
  --commit-revision COMMIT_REVISION
                        Either Push Revision or any commit referenced in the push. (default: None)
  --revision-url REVISION_URL
                        Url to push revision which can be used in place of --repo and --revision. (default: None)
  --revision-range REVISION_RANGE
                        Push revision range fromchange-tochange. (default: None)
  --treeherder-url TREEHERDER_URL
                        Treeherder url. (default: https://treeherder.mozilla.org)
  --activedata ACTIVEDATA
                        ActiveData url. (default: https://activedata.allizom.org/query)
  --include-passing-tests
                        Query tests against ActiveData. (default: False)
  --raw                 Do not reformat/indent json. (default: False)

You can save a set of arguments to a file and specify them later
using the @argfile syntax. The arguments contained in the file will
replace @argfile in the command line. Multiple files can be loaded
into the command line through the use of the @ syntax. Each argument
and its value must be on separate lines in the file.

create_log_summaries.py

$ ./create_log_summaries.py --help

usage: create_log_summaries.py [-h]
                               [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
                               --path PATH [--filename FILENAME]
                               [--include-tests] [--dechunk] [--raw]

Analyze downloaded Test Log files producing json summaries..

optional arguments:
  -h, --help            show this help message and exit
  --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Logging level. (default: INFO)
  --path PATH           Log. (default: None)
  --filename FILENAME   Base log filename suffix. (default: live_backing.log)
  --include-tests       Include TEST- lines. (default: False)
  --dechunk             Combine chunks. (default: False)
  --raw                 Do not reformat/indent json. (default: False)

You can save a set of arguments to a file and specify them later using
the @argfile syntax. The arguments contained in the file will replace
@argfile in the command line. Multiple files can be loaded into the
command line through the use of the @ syntax.

Each argument and its value must be on separate lines in the file.

./combine_log_summaries.py

$ ./combine_log_summaries.py --help

usage: combine_log_summaries.py [-h]
                                [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
                                [--file FILES] [--alias ALIASES]
                                [--differences] [--ignore IGNORE]
                                [--munge-test-data]

Combine analyzed Test Log json files.

optional arguments:
  -h, --help            show this help message and exit
  --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Logging level. (default: INFO)
  --file FILES
  --alias ALIASES
  --differences         Output only differences in data. (default: False)
  --ignore IGNORE       Ignore keys matching regular expression when calculating differences. (default: None)
  --munge-test-data     Modify TEST- lines in output to improve comparibility. (default: False)

You can save a set of arguments to a file and specify them later
using the @argfile syntax. The arguments contained in the file will
replace @argfile in the command line. Multiple files can be loaded
into the command line through the use of the @ syntax. Each argument
and its value must be on separate lines in the file.

download_treeherder_jobdetails.py

$ ./download_treeherder_jobdetails.py --help

usage: download_treeherder_jobdetails.py [-h]
                                         [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
                                         [--repo {mozilla-central,autoland,mozilla-inbound,try,mozilla-beta,mozilla-release,mozilla-esr68}]
                                         [--push_id PUSH_ID] [--author AUTHOR]
                                         [--comments COMMENTS]
                                         [--date-range DATE_RANGE | --revision REVISION | --commit-revision COMMIT_REVISION | --revision-url REVISION_URL | --revision-range REVISION_RANGE]
                                         [--add-bugzilla-suggestions]
                                         [--test-failure-pattern TEST_FAILURE_PATTERN]
                                         [--build-platform BUILD_PLATFORM]
                                         [--job-group-name JOB_GROUP_NAME]
                                         [--job-group-symbol JOB_GROUP_SYMBOL]
                                         [--job-type-name JOB_TYPE_NAME]
                                         [--job-type-symbol JOB_TYPE_SYMBOL]
                                         [--machine-name MACHINE_NAME]
                                         [--platform PLATFORM]
                                         [--platform-option PLATFORM_OPTION]
                                         [--result RESULT] [--state STATE]
                                         [--tier TIER]
                                         [--treeherder-url TREEHERDER_URL]
                                         --download-job-details
                                         DOWNLOAD_JOB_DETAILS
                                         [--output OUTPUT] [--alias ALIAS]

Download Job Details files from Treeherder/Taskcluster.

--download-job-details specifies a regular expression which will be matched
against the base file name of the url to the file to select the files to be
downloaded. This is not a shell glob pattern, but a full regular expression.
Files will be saved to the output directory using the path to the job detail
and a file name encoded with meta data as:

output/revision/job_guid/job_guid_run/path/platform,buildtype,job_name,job_type_symbol,filename

if --alias is specified, a soft link will be created from
output/revision to output/alias.

Push Related Arguments

If a push isn't selected, the most recent push will be returned.

Job Related Arguments

Job related pattern objects are used to select the jobs which will be
returned. All specified patterns must match to return a job.

optional arguments:
  -h, --help            show this help message and exit
  --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Logging level. (default: INFO)
  --repo {mozilla-central,autoland,mozilla-inbound,try,mozilla-beta,mozilla-release,mozilla-esr68}
                        repository name to query. (default: mozilla-central)
  --push_id PUSH_ID     Push id. (default: None)
  --author AUTHOR       Push author email. Should be specified if --repo is try and more
                        than one revision is selected. (default: None)
  --comments COMMENTS   Push comments pattern. (default: None)
  --date-range DATE_RANGE
                        Push date range startdate enddate CCYY-MM-DD CCYY-MM-DD. (default: None)
  --revision REVISION   Push Revision. (default: None)
  --commit-revision COMMIT_REVISION
                        Either Push Revision or any commit referenced in the push. (default: None)
  --revision-url REVISION_URL
                        Url to push revision which can be used in place of --repo and --revision. (default: None)
  --revision-range REVISION_RANGE
                        Push revision range fromchange-tochange. (default: None)
  --add-bugzilla-suggestions
                        Add bugzilla suggestions to job objects. (default: False)
  --test-failure-pattern TEST_FAILURE_PATTERN
                        Include failures from bugzilla suggestions matching this regular expression. (default: None)
  --build-platform BUILD_PLATFORM
                        Match job build platform regular expression. (default: None)
  --job-group-name JOB_GROUP_NAME
                        Match job group name regular expression. (default: None)
  --job-group-symbol JOB_GROUP_SYMBOL
                        Match job group symbol regular expression (default: None)
  --job-type-name JOB_TYPE_NAME
                        Match job type name regular expression. (default: None)
  --job-type-symbol JOB_TYPE_SYMBOL
                        Match job type symbol regular expression. (default: None)
  --machine-name MACHINE_NAME
                        Match job machine name regular expression. (default: None)
  --platform PLATFORM   Match job platform regular expression. (default: None)
  --platform-option PLATFORM_OPTION
                        Match job platform option regular expression: opt, debug, pgo,... (default: None)
  --result RESULT       Match job result regular expression: unknown, success, testfailed, .... (default: None)
  --state STATE         Match job state regular expression: pending, running, completed. (default: None)
  --tier TIER           Match job tier regular expression. (default: None)
  --treeherder-url TREEHERDER_URL
                        Treeherder url. (default: https://treeherder.mozilla.org)
  --download-job-details DOWNLOAD_JOB_DETAILS
                        Regular expression matching Job details url basenames to be
                                downloaded.  Example:live_backing.log|logcat.*.log. Default
                                None. (default: None)
  --output OUTPUT       Directory where to save downloaded job details. (default: output)
  --alias ALIAS         Alias (soft link) to revision subdirectory where the downloaded job details were saved. (default: None)

You can save a set of arguments to a file and specify them later using
the @argfile syntax. The arguments contained in the file will replace
@argfile in the command line. Multiple files can be loaded into the
command line through the use of the @ syntax.

Each argument and its value must be on separate lines in the file.

duplicate-opt-pgo-tasks.py

Compare opt and pgo tasks and flag duplicates.

./mach taskgraph tasks --json | ./duplicate-opt-pgo-tasks.py
./duplicate-opt-pgo-tasks.py tasks.json

get_pushes_jobs_job_details_json.py

./get_pushes_jobs_job_details_json.py --help

usage: get_pushes_jobs_job_details_json.py [-h]
                                           [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
                                           [--repo {mozilla-central,autoland,mozilla-inbound,try,mozilla-beta,mozilla-release,mozilla-esr68}]
                                           [--push_id PUSH_ID]
                                           [--author AUTHOR]
                                           [--comments COMMENTS]
                                           [--date-range DATE_RANGE | --revision REVISION | --commit-revision COMMIT_REVISION | --revision-url REVISION_URL | --revision-range REVISION_RANGE]
                                           [--add-bugzilla-suggestions]
                                           [--test-failure-pattern TEST_FAILURE_PATTERN]
                                           [--build-platform BUILD_PLATFORM]
                                           [--job-group-name JOB_GROUP_NAME]
                                           [--job-group-symbol JOB_GROUP_SYMBOL]
                                           [--job-type-name JOB_TYPE_NAME]
                                           [--job-type-symbol JOB_TYPE_SYMBOL]
                                           [--machine-name MACHINE_NAME]
                                           [--platform PLATFORM]
                                           [--platform-option PLATFORM_OPTION]
                                           [--result RESULT] [--state STATE]
                                           [--tier TIER]
                                           [--treeherder-url TREEHERDER_URL]
                                           [--add-resource-usage] [--raw]

Downloads pushes, jobs and job details data from Treeherder, writing results as
nested json to stdout.

Push Related Arguments

If a push isn't selected, the most recent push will be returned.

Job Related Arguments

Job related pattern objects are used to select the jobs which will be
returned. All specified patterns must match to return a job.

optional arguments:
  -h, --help            show this help message and exit
  --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Logging level. (default: INFO)
  --repo {mozilla-central,autoland,mozilla-inbound,try,mozilla-beta,mozilla-release,mozilla-esr68}
                        repository name to query. (default: mozilla-central)
  --push_id PUSH_ID     Push id. (default: None)
  --author AUTHOR       Push author email. Should be specified if --repo is try and more
                        than one revision is selected. (default: None)
  --comments COMMENTS   Push comments pattern. (default: None)
  --date-range DATE_RANGE
                        Push date range startdate enddate CCYY-MM-DD CCYY-MM-DD. (default: None)
  --revision REVISION   Push Revision. (default: None)
  --commit-revision COMMIT_REVISION
                        Either Push Revision or any commit referenced in the push. (default: None)
  --revision-url REVISION_URL
                        Url to push revision which can be used in place of --repo and --revision. (default: None)
  --revision-range REVISION_RANGE
                        Push revision range fromchange-tochange. (default: None)
  --add-bugzilla-suggestions
                        Add bugzilla suggestions to job objects. (default: False)
  --test-failure-pattern TEST_FAILURE_PATTERN
                        Include failures from bugzilla suggestions matching this regular expression. (default: None)
  --build-platform BUILD_PLATFORM
                        Match job build platform regular expression. (default: None)
  --job-group-name JOB_GROUP_NAME
                        Match job group name regular expression. (default: None)
  --job-group-symbol JOB_GROUP_SYMBOL
                        Match job group symbol regular expression (default: None)
  --job-type-name JOB_TYPE_NAME
                        Match job type name regular expression. (default: None)
  --job-type-symbol JOB_TYPE_SYMBOL
                        Match job type symbol regular expression. (default: None)
  --machine-name MACHINE_NAME
                        Match job machine name regular expression. (default: None)
  --platform PLATFORM   Match job platform regular expression. (default: None)
  --platform-option PLATFORM_OPTION
                        Match job platform option regular expression: opt, debug, pgo,... (default: None)
  --result RESULT       Match job result regular expression: unknown, success, testfailed, .... (default: None)
  --state STATE         Match job state regular expression: pending, running, completed. (default: None)
  --tier TIER           Match job tier regular expression. (default: None)
  --treeherder-url TREEHERDER_URL
                        Treeherder url. (default: https://treeherder.mozilla.org)
  --add-resource-usage  Download resource-usage.json job detail and add to job object. (default: False)
  --raw                 Do not reformat/indent json. (default: False)

You can save a set of arguments to a file and specify them later using
the @argfile syntax. The arguments contained in the file will replace
@argfile in the command line. Multiple files can be loaded into the
command line through the use of the @ syntax.

Each argument and its value must be on separate lines in the file.

get_pushes_json.py

./get_pushes_json.py --help

usage: get_pushes_json.py [-h]
                          [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
                          [--repo {mozilla-central,autoland,mozilla-inbound,try,mozilla-beta,mozilla-release,mozilla-esr68}]
                          [--push_id PUSH_ID] [--author AUTHOR]
                          [--comments COMMENTS]
                          [--date-range DATE_RANGE | --revision REVISION | --commit-revision COMMIT_REVISION | --revision-url REVISION_URL | --revision-range REVISION_RANGE]
                          [--treeherder-url TREEHERDER_URL] [--raw]

Downloads pushes data from Treeherder, writing results as
json to stdout.

Push Related Arguments

If a push isn't selected, the most recent push will be returned.

optional arguments:
  -h, --help            show this help message and exit
  --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Logging level. (default: INFO)
  --repo {mozilla-central,autoland,mozilla-inbound,try,mozilla-beta,mozilla-release,mozilla-esr68}
                        repository name to query. (default: mozilla-central)
  --push_id PUSH_ID     Push id. (default: None)
  --author AUTHOR       Push author email. Should be specified if --repo is try and more
                        than one revision is selected. (default: None)
  --comments COMMENTS   Push comments pattern. (default: None)
  --date-range DATE_RANGE
                        Push date range startdate enddate CCYY-MM-DD CCYY-MM-DD. (default: None)
  --revision REVISION   Push Revision. (default: None)
  --commit-revision COMMIT_REVISION
                        Either Push Revision or any commit referenced in the push. (default: None)
  --revision-url REVISION_URL
                        Url to push revision which can be used in place of --repo and --revision. (default: None)
  --revision-range REVISION_RANGE
                        Push revision range fromchange-tochange. (default: None)
  --treeherder-url TREEHERDER_URL
                        Treeherder url. (default: https://treeherder.mozilla.org)
  --raw                 Do not reformat/indent json. (default: False)

You can save a set of arguments to a file and specify them later using
the @argfile syntax. The arguments contained in the file will replace
@argfile in the command line. Multiple files can be loaded into the
command line through the use of the @ syntax.

Each argument and its value must be on separate lines in the file.

get_pushes_jobs_json.py

./get_pushes_jobs_json.py --help

usage: get_pushes_jobs_json.py [-h]
                               [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
                               [--treeherder-url TREEHERDER_URL]
                               [--repo {mozilla-central,autoland,mozilla-inbound,try,mozilla-beta,mozilla-release,mozilla-esr68}]
                               [--push_id PUSH_ID] [--author AUTHOR]
                               [--comments COMMENTS]
                               [--date-range DATE_RANGE | --revision REVISION | --commit-revision COMMIT_REVISION | --revision-url REVISION_URL | --revision-range REVISION_RANGE]
                               [--add-bugzilla-suggestions]
                               [--test-failure-pattern TEST_FAILURE_PATTERN]
                               [--build-platform BUILD_PLATFORM]
                               [--job-group-name JOB_GROUP_NAME]
                               [--job-group-symbol JOB_GROUP_SYMBOL]
                               [--job-type-name JOB_TYPE_NAME]
                               [--job-type-symbol JOB_TYPE_SYMBOL]
                               [--machine-name MACHINE_NAME]
                               [--platform PLATFORM]
                               [--platform-option PLATFORM_OPTION]
                               [--result RESULT] [--state STATE] [--tier TIER]
                               [--raw]

Downloads pushes and jobs data from Treeherder, writing results as nested json to
stdout.

Push Related Arguments

If a push isn't selected, the most recent push will be returned.

Job Related Arguments

Job related pattern objects are used to select the jobs which will be
returned. All specified patterns must match to return a job.

optional arguments:
  -h, --help            show this help message and exit
  --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Logging level. (default: INFO)
  --treeherder-url TREEHERDER_URL
                        Treeherder url. (default: https://treeherder.mozilla.org)
  --repo {mozilla-central,autoland,mozilla-inbound,try,mozilla-beta,mozilla-release,mozilla-esr68}
                        repository name to query. (default: mozilla-central)
  --push_id PUSH_ID     Push id. (default: None)
  --author AUTHOR       Push author email. Should be specified if --repo is try and more
                        than one revision is selected. (default: None)
  --comments COMMENTS   Push comments pattern. (default: None)
  --date-range DATE_RANGE
                        Push date range startdate enddate CCYY-MM-DD CCYY-MM-DD. (default: None)
  --revision REVISION   Push Revision. (default: None)
  --commit-revision COMMIT_REVISION
                        Either Push Revision or any commit referenced in the push. (default: None)
  --revision-url REVISION_URL
                        Url to push revision which can be used in place of --repo and --revision. (default: None)
  --revision-range REVISION_RANGE
                        Push revision range fromchange-tochange. (default: None)
  --add-bugzilla-suggestions
                        Add bugzilla suggestions to job objects. (default: False)
  --test-failure-pattern TEST_FAILURE_PATTERN
                        Include failures from bugzilla suggestions matching this regular expression. (default: None)
  --build-platform BUILD_PLATFORM
                        Match job build platform regular expression. (default: None)
  --job-group-name JOB_GROUP_NAME
                        Match job group name regular expression. (default: None)
  --job-group-symbol JOB_GROUP_SYMBOL
                        Match job group symbol regular expression (default: None)
  --job-type-name JOB_TYPE_NAME
                        Match job type name regular expression. (default: None)
  --job-type-symbol JOB_TYPE_SYMBOL
                        Match job type symbol regular expression. (default: None)
  --machine-name MACHINE_NAME
                        Match job machine name regular expression. (default: None)
  --platform PLATFORM   Match job platform regular expression. (default: None)
  --platform-option PLATFORM_OPTION
                        Match job platform option regular expression: opt, debug, pgo,... (default: None)
  --result RESULT       Match job result regular expression: unknown, success, testfailed, .... (default: None)
  --state STATE         Match job state regular expression: pending, running, completed. (default: None)
  --tier TIER           Match job tier regular expression. (default: None)
  --raw                 Do not reformat/indent json. (default: False)

You can save a set of arguments to a file and specify them later using
the @argfile syntax. The arguments contained in the file will replace
@argfile in the command line. Multiple files can be loaded into the
command line through the use of the @ syntax.

Each argument and its value must be on separate lines in the file.

summarize_isolation_pushes_jobs_json.py

Summarize job json for Test Isolation

$ ./summarize_isolation_pushes_jobs_json.py  --help

usage: summarize_isolation_pushes_jobs_json.py [-h]
                                               [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
                                               [--treeherder-url TREEHERDER_URL]
                                               [--repo {mozilla-central,autoland,mozilla-inbound,try,mozilla-beta,mozilla-release,mozilla-esr68}]
                                               [--push_id PUSH_ID]
                                               [--author AUTHOR]
                                               [--comments COMMENTS]
                                               [--date-range DATE_RANGE | --revision REVISION | --commit-revision COMMIT_REVISION | --revision-url REVISION_URL | --revision-range REVISION_RANGE]
                                               [--add-bugzilla-suggestions]
                                               [--test-failure-pattern TEST_FAILURE_PATTERN]
                                               [--build-platform BUILD_PLATFORM]
                                               [--job-group-name JOB_GROUP_NAME]
                                               [--job-group-symbol JOB_GROUP_SYMBOL]
                                               [--job-type-name JOB_TYPE_NAME]
                                               [--job-type-symbol JOB_TYPE_SYMBOL]
                                               [--machine-name MACHINE_NAME]
                                               [--platform PLATFORM]
                                               [--platform-option PLATFORM_OPTION]
                                               [--result RESULT]
                                               [--state STATE] [--tier TIER]
                                               [--whiteboard WHITEBOARD]
                                               [--override-bug-summary OVERRIDE_BUG_SUMMARY]
                                               [--cache CACHE]
                                               [--update-cache]
                                               [--dump-cache-stats]
                                               [--bug-creation-time BUG_CREATION_TIME]
                                               [--bugs-after BUGS_AFTER]
                                               [--bug BUGS] [--raw]
                                               [--csv-summary] [--csv-results]
                                               [--include-failures]
                                               [--include-tests]

Analyze pushes from bugs marked with whiteboard [test isolation] or a
value specified from the command options.

Queries Bugzilla for bugs marked with [test isolation] in the whiteboard,
determines the bug number, bug summary and revision from the bug then reads
push and job data from Treeherder and produces a summary of runtimes and
test failures, writing results as either csv text or json to stdout. By
default, output is writtenas formatted json.

Intermediate results are stored in a cache directory to re-used on subsequent
runs. When changing options, it is safest to delete the cache directory and
start over.

Push Related Arguments

If a push isn't selected, the most recent push will be returned.

Job Related Arguments

Job related pattern objects are used to select the jobs which will be
returned. All specified patterns must match to return a job.

optional arguments:
  -h, --help            show this help message and exit
  --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        Logging level. (default: INFO)
  --treeherder-url TREEHERDER_URL
                        Treeherder url. (default: https://treeherder.mozilla.org)
  --repo {mozilla-central,autoland,mozilla-inbound,try,mozilla-beta,mozilla-release,mozilla-esr68}
                        repository name to query. (default: mozilla-central)
  --push_id PUSH_ID     Push id. (default: None)
  --author AUTHOR       Push author email. Should be specified if --repo is try and more
                        than one revision is selected. (default: None)
  --comments COMMENTS   Push comments pattern. (default: None)
  --date-range DATE_RANGE
                        Push date range startdate enddate CCYY-MM-DD CCYY-MM-DD. (default: None)
  --revision REVISION   Push Revision. (default: None)
  --commit-revision COMMIT_REVISION
                        Either Push Revision or any commit referenced in the push. (default: None)
  --revision-url REVISION_URL
                        Url to push revision which can be used in place of --repo and --revision. (default: None)
  --revision-range REVISION_RANGE
                        Push revision range fromchange-tochange. (default: None)
  --add-bugzilla-suggestions
                        Add bugzilla suggestions to job objects. (default: False)
  --test-failure-pattern TEST_FAILURE_PATTERN
                        Include failures from bugzilla suggestions matching this regular expression. (default: None)
  --build-platform BUILD_PLATFORM
                        Match job build platform regular expression. (default: None)
  --job-group-name JOB_GROUP_NAME
                        Match job group name regular expression. (default: None)
  --job-group-symbol JOB_GROUP_SYMBOL
                        Match job group symbol regular expression (default: None)
  --job-type-name JOB_TYPE_NAME
                        Match job type name regular expression. (default: None)
  --job-type-symbol JOB_TYPE_SYMBOL
                        Match job type symbol regular expression. (default: None)
  --machine-name MACHINE_NAME
                        Match job machine name regular expression. (default: None)
  --platform PLATFORM   Match job platform regular expression. (default: None)
  --platform-option PLATFORM_OPTION
                        Match job platform option regular expression: opt, debug, pgo,... (default: None)
  --result RESULT       Match job result regular expression: unknown, success, testfailed, .... (default: None)
  --state STATE         Match job state regular expression: pending, running, completed. (default: None)
  --tier TIER           Match job tier regular expression. (default: None)
  --whiteboard WHITEBOARD
                        Bugzilla whiteboard value used to select the appropriate bugs. Should only be used with --bug. (default: [test isolation])
  --override-bug-summary OVERRIDE_BUG_SUMMARY
                        When reprocessing a bug with a problematic bug summary or when using --whiteboard to select a bug not filed by intermittent-bug-filer, specify an override bug summary to mimic an intermittent bug summary to be used to determine if a failure or test is reproduced. Otherwise the original bug summary will be used. Should only be used with --bug. (default: None)
  --cache CACHE         Directory used to store cached objects retrieved from Bugzilla and Treeherder. (default: ~/cia_tools_cache/)
  --update-cache        Recreate cached files with fresh data. (default: False)
  --dump-cache-stats    Dump cache statistics to stderr. (default: False)
  --bug-creation-time BUG_CREATION_TIME
                        Starting creation time in YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSTZ format. Example 2019-07-27T17:28:00PDT or 2019-07-28T00:28:00Z (default: 2019-06-14)
  --bugs-after BUGS_AFTER
                        Only returns bugs whose id is greater than this integer. (default: None)
  --bug BUGS            Only returns results for bug the specified bug. (default: [])
  --raw                 Do not reformat/indent json. (default: False)
  --csv-summary         Output summary data in csv format. Does not include individual failures or tests. (default: False)
  --csv-results         Output test data in csv format. Does not include individual failures. (default: False)
  --include-failures    Include individual failures in output. (default: False)
  --include-tests       Include individual tests in output. (default: False)

You can save a set of arguments to a file and specify them later using
the @argfile syntax. The arguments contained in the file will replace
@argfile in the command line. Multiple files can be loaded into the
command line through the use of the @ syntax.

Each argument and its value must be on separate lines in the file.

tasks_costs.py

$ ./tasks_costs.py --help
usage: tasks_costs.py [-h] --costs COSTS --tasks TASKS [--project PROJECTS]
                      [--tier TIERS] [--json] [--verbose]

Associate Task Labels to Task costs.

optional arguments:
  -h, --help          show this help message and exit
  --costs COSTS       Path to json file containing costs.
  --tasks TASKS       Path to json file containing tasks.
  --project PROJECTS  One or more of mozilla-central, autoland, ... If not
                      specified, returns all projects.
  --tier TIERS        One or more of 1, 2, 3. If not specified, returns all
                      projects.
  --json              Output results in json format.
  --verbose           Output no cost warnings.

This script matches a costs json file to a tasks json file to
associate a task label to costs and writes a new costs file with the
attached task label.

To obtain the costs file execute a BigQuery containing an sql query of
the form

select w.provisionerId, w.workerType, s.project, s.tier,
       s.suite, s.groupSymbol, s.symbol, s.collection,
       sum(s.execution*1000.0*w.cost_per_ms) as cost
from taskclusteretl.derived_task_summary as s,
     taskclusteretl.derived_daily_cost_per_workertype as w
where s.workerType = w.workerType
and s.provisionerid = w.provisionerid
and s.date = w.date
and s.date between '2019-12-02' and '2020-01-06'
and s.project in ('autoland', 'try')
and s.tier in (2, 3)
group by provisionerId, workerType, project, tier, suite, groupSymbol, symbol, collection
order by provisionerId, workerType, project, tier, suite, groupSymbol, symbol, collection;

and save the results locally to a costs.json file.

Using a source checkout, obtain a tasks json file via

./mach taskgraph tasks --json  > /tmp/tasks.json

Then execute

python tasks_costs.py --costs=costs.json --tasks=tasks.json 2> costs.err > costs-annotated.csv

or

python tasks_costs.py --costs=costs.json --tasks=tasks.json --json 2> costs.err > costs-annotated.json

About

Miscellaneous tools for Mozilla Continuous Integration Automation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages