| # Copyright 2026 The Pigweed Authors |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| # use this file except in compliance with the License. You may obtain a copy of |
| # the License at |
| # |
| # https://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| # License for the specific language governing permissions and limitations under |
| # the License. |
| """Test of airlock_arguments.""" |
| |
| from __future__ import annotations |
| |
| from collections.abc import Iterator |
| |
| from recipe_engine import post_process, recipe_api, recipe_test_api |
| |
| DEPS = [ |
| 'pigweed/bazel', |
| 'recipe_engine/buildbucket', |
| 'recipe_engine/step', |
| ] |
| |
| |
| def RunSteps(api: recipe_api.RecipeScriptApi): |
| args = api.bazel.airlock_arguments() |
| |
| if not args: |
| api.step.empty('(no arguments)') |
| |
| for arg in args: |
| api.step.empty(arg) |
| |
| |
| def GenTests(api) -> Iterator[recipe_test_api.TestData]: |
| yield api.test( |
| 'default', |
| api.post_process(post_process.MustRun, '(no arguments)'), |
| api.post_process(post_process.DropExpectation), |
| ) |
| |
| yield api.test( |
| 'use_airlock', |
| api.buildbucket.ci_build(experiments=['pigweed.use_airlock']), |
| api.post_process(post_process.MustRun, '--config=airlock'), |
| api.post_process(post_process.DropExpectation), |
| ) |