| # 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 google.protobuf import json_format |
| from google.protobuf import struct_pb2 |
| |
| from recipe_engine.recipe_api import Property |
| |
| DEPS = [ |
| "fuchsia/fxt", |
| "fuchsia/status_check", |
| "recipe_engine/properties", |
| ] |
| |
| PROPERTIES = { |
| "sdk_mode": Property(default=False), |
| } |
| |
| |
| def RunSteps(api, sdk_mode): |
| api.fxt.orchestrate_fxt_tests( |
| "foo-bucket", |
| "123456", |
| options=api.fxt.Options( |
| image_name=None if sdk_mode else "test-name", |
| use_staging_host=True, |
| tap_projects=["tap-project1", "tap-project2"], |
| guitar_config=json_format.ParseDict( |
| {"projectfoo": "bar"}, struct_pb2.Struct() |
| ), |
| sdk_mode=sdk_mode, |
| ), |
| guitar_test_filter_exprs=["deps(//baz)"], |
| ) |
| |
| |
| def GenTests(api): |
| yield api.status_check.test("successful_tests") + api.fxt.orchestrate_fxt_tests() |
| yield ( |
| api.status_check.test("failed_tests_sdk_mode", status="failure") |
| + api.properties(sdk_mode=True) |
| + api.fxt.orchestrate_fxt_tests(success=False) |
| ) |