| # Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file | |
| # for details. All rights reserved. Use of this source code is governed by a | |
| # BSD-style license that can be found in the LICENSE file. | |
| from recipe_engine.post_process import MustRun, DoesNotRunRE | |
| DEPS = [ | |
| 'recipe_engine/cipd', | |
| 'recipe_engine/path', | |
| 'recipe_engine/runtime', | |
| 'recipe_engine/step', | |
| 'safe_cipd', | |
| ] | |
| PYTHON_VERSION_COMPATIBILITY = "PY3" | |
| def RunSteps(api): | |
| package_name = 'dart/test/package' | |
| tags = {'tag': 'value'} | |
| unique_tags = {'unique_tag': 'value'} | |
| pkg_def = api.cipd.PackageDefinition(package_name, api.path.cleanup_dir, | |
| 'copy') | |
| pkg_def.add_dir(api.path.cleanup_dir) | |
| output_path = api.path.cleanup_dir / 'test.zip' | |
| # Test with experimental build (should skip) | |
| pin = api.safe_cipd.register( | |
| package_name, pkg_def, output_path, tags=tags, unique_tags=unique_tags) | |
| api.step.empty(f'uploaded pin: {pin}') | |
| assert pin is None, 'Expected None, got Pin' | |
| def GenTests(api): | |
| yield api.test( | |
| 'experimental', | |
| api.runtime(is_experimental=True), | |
| api.post_process(MustRun, 'upload skipped: experimental build'), | |
| api.post_process(DoesNotRunRE, 'register'), | |
| ) |