| # Copyright 2020 The Fuchsia Authors. 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 import recipe_test_api |
| |
| from PB.recipe_modules.fuchsia.fxt.options import Options |
| |
| |
| class FxtTestApi(recipe_test_api.RecipeTestApi): |
| Options = Options |
| |
| def orchestrate_fxt_tests( |
| self, |
| tap_request_id="tap-id", |
| guitar_project_request_ids=("guitar-project-id1", "guitar-project-id2"), |
| success=True, |
| ): |
| launch_test_data = { |
| "tap_request_id": tap_request_id, |
| "guitar_project_request_ids": guitar_project_request_ids, |
| "workspace": "test-ws", |
| "change_num": 12345, |
| } |
| return self.step_data( |
| "run external tests.launch", self.m.json.output(launch_test_data) |
| ) + self.step_data("run external tests.monitor", retcode=0 if success else 1) |