Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
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
4 changes: 2 additions & 2 deletions ci/builders/linux_android_debug_engine.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"tests": [
{
"language": "python",
"language": "python3",
"name": "Host Tests for android_jit_release_x86",
"parameters": [
"--variant",
Expand Down Expand Up @@ -115,7 +115,7 @@
},
"tests": [
{
"language": "python",
"language": "python3",
"name": "Host Tests for android_debug",
"parameters": [
"--variant",
Expand Down
6 changes: 3 additions & 3 deletions ci/builders/linux_host_engine.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"tests": [
{
"language": "python",
"language": "python3",
"name": "Host Tests for host_debug_impeller_vulkan",
"parameters": [
"--variant",
Expand Down Expand Up @@ -148,7 +148,7 @@
},
"tests": [
{
"language": "python",
"language": "python3",
"name": "Host Tests for host_profile",
"parameters": [
"--variant",
Expand Down Expand Up @@ -198,7 +198,7 @@
},
"tests": [
{
"language": "python",
"language": "python3",
"name": "Host Tests for host_release",
"parameters": [
"--variant",
Expand Down
2 changes: 1 addition & 1 deletion ci/builders/mac_host_engine.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
},
"tests": [
{
"language": "python",
"language": "python3",
"name": "Host Tests for host_profile",
"parameters": [
"--variant",
Expand Down
2 changes: 1 addition & 1 deletion ci/builders/mac_ios_engine.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"out/ios_debug_sim_arm64"
],
"script": "flutter/sky/tools/create_full_ios_framework.py",
"language": "python"
"language": "python3"
},
{
"name": "obj-c-doc",
Expand Down
2 changes: 1 addition & 1 deletion ci/builders/mac_ios_engine_profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"out/ios_debug_sim_arm64"
],
"script": "flutter/sky/tools/create_full_ios_framework.py",
"language": "python"
"language": "python3"
}
]
},
Expand Down
6 changes: 3 additions & 3 deletions ci/builders/mac_ios_engine_release.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"--strip"
],
"script": "flutter/sky/tools/create_full_ios_framework.py",
"language": "python"
"language": "python3"
},
{
"name": "release-nobitcode-FlutterMacOS.framework",
Expand All @@ -102,7 +102,7 @@
"--strip"
],
"script": "flutter/sky/tools/create_full_ios_framework.py",
"language": "python"
"language": "python3"
},
{
"name": "Release-macos-gen-snapshots",
Expand All @@ -113,7 +113,7 @@
"out/ios_release"
],
"script": "flutter/sky/tools/create_macos_gen_snapshots.py",
"language": "python"
"language": "python3"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion ci/builders/windows_host_engine.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"tests": [
{
"language": "python",
"language": "python3",
"name": "Host Tests for host_debug",
"parameters": [
"--variant",
Expand Down
25 changes: 25 additions & 0 deletions ci/compatibility_helper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env python3
#
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# This script contains helper function(s) for supporting both
# python 2 and python 3 infrastructure code.

ENCODING = 'UTF-8'


def byte_str_decode(str_or_bytes):
"""Returns a string if given either a string or bytes.

TODO: This function should be removed when the supported python
version is only python 3.

Args:
str_or_bytes (string or bytes) we want to convert or return as
the possible value changes depending on the version of python
used.
"""
return str_or_bytes if isinstance(str_or_bytes,
str) else str_or_bytes.decode(ENCODING)
11 changes: 8 additions & 3 deletions ci/firebase_testlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import os
import subprocess
import sys
from compatibility_helper import byte_str_decode

if 'STORAGE_BUCKET' not in os.environ:
print('The GCP storage bucket must be provided as an environment variable.')
Expand Down Expand Up @@ -67,6 +68,7 @@ def check_logcat(results_dir):
'gsutil', 'cat',
'%s/%s/*/logcat' % (BUCKET, results_dir)
])
logcat = byte_str_decode(logcat)
if not logcat:
sys.exit(1)

Expand All @@ -82,7 +84,9 @@ def check_timeline(results_dir):
'gsutil', 'du',
'%s/%s/*/game_loop_results/results_scenario_0.json' %
(BUCKET, results_dir)
]).strip()
])
gsutil_du = byte_str_decode(gsutil_du)
gsutil_du = gsutil_du.strip()
if gsutil_du == '0':
print('Failed to produce a timeline.')
sys.exit(1)
Expand Down Expand Up @@ -113,8 +117,9 @@ def main():
return 1

git_revision = subprocess.check_output(['git', 'rev-parse', 'HEAD'],
cwd=script_dir).strip()

cwd=script_dir)
git_revision = byte_str_decode(git_revision)
git_revision = git_revision.strip()
results = []
apk = None
for apk in apks:
Expand Down
11 changes: 8 additions & 3 deletions ci/scan_flattened_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import subprocess
import sys
from urllib import request
from compatibility_helper import byte_str_decode

SCRIPT_DIR = os.path.dirname(sys.argv[0])
CHECKOUT_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
Expand Down Expand Up @@ -206,7 +207,9 @@ def get_common_ancestor_commit(dep, deps_list):
'git --git-dir ' + temp_dep_dir + '/.git remote show upstream ' +
"| sed -n \'/HEAD branch/s/.*: //p\'",
shell=True
).decode().strip()
)
default_branch = byte_str_decode(default_branch)
default_branch = default_branch.strip()
print(
'default_branch found: {default_branch}'.format(
default_branch=default_branch
Expand All @@ -223,7 +226,8 @@ def get_common_ancestor_commit(dep, deps_list):
"--format=\'%(objectname:short)\' refs/heads/upstream",
shell=True
)
commit = commit.decode().strip()
commit = byte_str_decode(commit)
commit = commit.strip()

# perform merge-base on most recent default branch commit and pinned mirror commit
ancestor_commit = subprocess.check_output(
Expand All @@ -232,7 +236,8 @@ def get_common_ancestor_commit(dep, deps_list):
),
shell=True
)
ancestor_commit = ancestor_commit.decode().strip()
ancestor_commit = byte_str_decode(ancestor_commit)
ancestor_commit = ancestor_commit.strip()
print('Ancestor commit: ' + ancestor_commit)
return ancestor_commit
except subprocess.CalledProcessError as error:
Expand Down
14 changes: 10 additions & 4 deletions testing/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
roboto_font_path = os.path.join(fonts_dir, 'Roboto-Regular.ttf')
font_subset_dir = os.path.join(buildroot_dir, 'flutter', 'tools', 'font-subset')

fml_unittests_filter = '--gtest_filter=-*TimeSensitiveTest*'
FML_UNITTESTS_FILTER = '--gtest_filter=-*TimeSensitiveTest*'
ENCODING = 'UTF-8'


def PrintDivider(char='='):
Expand Down Expand Up @@ -341,7 +342,7 @@ def make_test(name, flags=repeat_flags, extra_env={}):
make_test('embedder_a11y_unittests'),
make_test('embedder_proctable_unittests'),
make_test('embedder_unittests'),
make_test('fml_unittests', flags=[fml_unittests_filter] + repeat_flags),
make_test('fml_unittests', flags=[FML_UNITTESTS_FILTER] + repeat_flags),
make_test('no_dart_plugin_registrant_unittests'),
make_test('runtime_unittests'),
make_test('testing_unittests'),
Expand Down Expand Up @@ -569,8 +570,13 @@ def EnsureIosTestsAreBuilt(ios_out_dir):
def AssertExpectedXcodeVersion():
"""Checks that the user has a version of Xcode installed"""
version_output = subprocess.check_output(['xcodebuild', '-version'])
match = re.match(b"Xcode (\d+)", version_output)
message = "Xcode must be installed to run the iOS embedding unit tests"
# TODO ricardoamador: remove this check when python 2 is deprecated.
version_output = version_output if isinstance(
version_output, str
) else version_output.decode(ENCODING)
version_output = version_output.strip()
match = re.match(r'Xcode (\d+)', version_output)
message = 'Xcode must be installed to run the iOS embedding unit tests'
assert match, message


Expand Down
1 change: 1 addition & 0 deletions tools/fuchsia/merge_and_upload_debug_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def CheckCIPDPackageExists(package_name, tag):
tag,
]
stdout = subprocess.check_output(command)
stdout = stdout if isinstance(stdout, str) else stdout.decode('UTF-8')
match = re.search(r'No matching instances\.', stdout)
if match:
return False
Expand Down