blob: 77a263ce3b95f7877e1c211423f5e502dc0991df [file] [log] [blame]
// Copyright 2019 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.
library fuchsia.test.manager;
using fuchsia.developer.remotecontrol;
using fuchsia.diagnostics;
using fuchsia.test;
using fuchsia.url;
/// Holds the server end of an iterator over the isolated logs of a test.
resource flexible union LogsIterator {
/// Server end of the iterator, when this protocol is used by host-side clients.
1: request<fuchsia.developer.remotecontrol.ArchiveIterator> archive;
/// Server end of the iterator, when this protocol is used by Fuchsia clients.
2: request<fuchsia.diagnostics.BatchIterator> batch;
};
/// Options to run particular test suite.
resource table LaunchOptions {
/// Isolated logs from the test component will be streamed through this iterator.
1: LogsIterator logs_iterator;
};
/// Error for `LaunchSuite` call.
enum LaunchError {
/// There were insufficient resources to perform the operation.
RESOURCE_UNAVAILABLE = 1;
/// Cannot resolve `test_url`.
INSTANCE_CANNOT_RESOLVE = 2;
/// Invalid argument(s) passed.
INVALID_ARGS = 3;
/// Failed to connect to the `fuchsia.test.TestSuite` that the test should
/// expose.
FAILED_TO_CONNECT_TO_TEST_SUITE = 4;
/// Some internal error occured. Something wrong with test manager setup. Check logs and report bug.
INTERNAL_ERROR = 5;
};
/// Controller for running suite. Suite would be destroyed when client end of this protocol is closed.
protocol SuiteController {
/// Destroys running suite.
Kill();
};
/// Launches a test that implements the `fuchsia.test.Suite` protocol
/// (either directly or via a runner adapter). The test must be a
/// v2 component test.
///
/// Designed to be used by run_test_suite to execute v2 tests.
///
/// If test suite doesn't expose `fuchsia.test.Suite` protocol, this
/// call will suceed but call on suite protocol will fail with `PEER_CLOSED` error.
[Discoverable]
protocol Harness {
LaunchSuite(fuchsia.url.Url test_url, LaunchOptions options,
request<fuchsia.test.Suite> suite, request<SuiteController> controller) -> ()
error LaunchError;
};