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

[Impeller] added an assert that goldens are generated #50222

Merged
merged 2 commits into from
Feb 1, 2024
Merged
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
12 changes: 12 additions & 0 deletions testing/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@

ENCODING = 'UTF-8'

# This number must be updated when adding new golden tests to impeller.
_NUM_EXPECTED_GENERATED_IMPELLER_GOLDEN_FILES = 566

logger = logging.getLogger(__name__)
logger_handler = logging.StreamHandler()

Expand Down Expand Up @@ -1115,6 +1118,15 @@ def run_impeller_golden_tests(build_dir: str):
)
with tempfile.TemporaryDirectory(prefix='impeller_golden') as temp_dir:
run_cmd([tests_path, '--working_dir=%s' % temp_dir], cwd=build_dir)
num_generated_files = len(os.listdir(temp_dir))
if num_generated_files != _NUM_EXPECTED_GENERATED_IMPELLER_GOLDEN_FILES:
raise Exception(
'`impeller_golden_tests` was expected to generate '
f'{_NUM_EXPECTED_GENERATED_IMPELLER_GOLDEN_FILES} files, '
f'{num_generated_files} were generated. If this is expected, update '
'_NUM_EXPECTED_GENERATED_IMPELLER_GOLDEN_FILES.'
)

with DirectoryChange(harvester_path):
run_cmd(['dart', 'pub', 'get'])
bin_path = Path('.').joinpath('bin'
Expand Down