| # 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. | |
| DEPS = [ | |
| 'safe_cipd', | |
| 'recipe_engine/cipd', | |
| 'recipe_engine/file', | |
| 'recipe_engine/path', | |
| 'recipe_engine/step', | |
| ] | |
| def RunSteps(api): | |
| package_name = 'test/package' | |
| tags = {'channel': 'beta'} | |
| unique_tags = {'version': '1.2.3'} | |
| # Create a dummy file to package | |
| dummy_file = api.path.cleanup_dir / 'dummy.txt' | |
| api.file.write_text('create dummy', dummy_file, 'dummy content') | |
| pkg_def = api.cipd.PackageDefinition(package_name, api.path.cleanup_dir, | |
| 'copy') | |
| pkg_def.add_file(dummy_file) | |
| output_path = api.path.cleanup_dir / 'test.zip' | |
| api.safe_cipd.register( | |
| package_name, pkg_def, output_path, tags=tags, unique_tags=unique_tags) | |
| def GenTests(api): | |
| yield api.test( | |
| 'existing-different', | |
| api.step_data( | |
| 'cipd search test/package version:1.2.3', | |
| api.cipd.example_search( | |
| 'test/package', | |
| instances=['different-instance-id'], | |
| )), | |
| status='FAILURE', | |
| ) |