This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Bug 1545730 - Enable raptor tests on Fenix #1774
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# 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/. | ||
|
||
from __future__ import print_function | ||
import json | ||
import subprocess | ||
|
||
|
||
def get_build_variants(): | ||
print("Fetching build variants from gradle") | ||
output = _run_gradle_process('printBuildVariants') | ||
content = _extract_content_from_command_output(output, prefix='variants: ') | ||
variants = json.loads(content) | ||
|
||
if len(variants) == 0: | ||
raise ValueError("Could not get build variants from gradle") | ||
|
||
print("Got variants: {}".format(' '.join(variants))) | ||
|
||
return variants | ||
|
||
|
||
def get_geckoview_versions(): | ||
print("Fetching geckoview version from gradle") | ||
output = _run_gradle_process('printGeckoviewVersions') | ||
|
||
versions = {} | ||
for version_type in ('nightly',): | ||
version = _extract_content_from_command_output(output, prefix='{}: '.format(version_type)) | ||
version = version.strip('"') | ||
versions[version_type] = version | ||
print('Got {} version: "{}"'.format(version_type, version)) | ||
|
||
return versions | ||
|
||
|
||
def _run_gradle_process(gradle_command): | ||
process = subprocess.Popen(["./gradlew", "--no-daemon", "--quiet", gradle_command], stdout=subprocess.PIPE) | ||
output, err = process.communicate() | ||
exit_code = process.wait() | ||
|
||
if exit_code is not 0: | ||
print("Gradle command returned error: {}".format(exit_code)) | ||
|
||
return output | ||
|
||
|
||
def _extract_content_from_command_output(output, prefix): | ||
variants_line = [line for line in output.split('\n') if line.startswith(prefix)][0] | ||
return variants_line.split(' ', 1)[1] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need both
is_master_push
andSHORT_HEAD_BRANCH == 'master'
? Aren't they confirming the same underlying fact?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
is_master_push
is misleading. I just renamed it intois_push