/* SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * * Modifications Copyright OpenSearch Contributors. See * GitHub history for details. * * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you 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 * * http://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. */ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; using OpenSearch.OpenSearch.Xunit.XunitPlumbing; using OpenSearch.Stack.ArtifactsApi; namespace OpenSearch.OpenSearch.Xunit { /// /// The Xunit test runner options /// public class OpenSearchXunitRunOptions { /// /// Informs the runner whether we expect to run integration tests. Defaults to true /// public bool RunIntegrationTests { get; set; } = true; /// /// Setting this to true will assume the cluster that is currently running was started for the purpose of these tests /// Defaults to false /// public bool IntegrationTestsMayUseAlreadyRunningNode { get; set; } = false; /// /// Informs the runner whether unit tests will be run. Defaults to false. /// If set to true and is false, the runner will run all the /// tests in parallel with the maximum degree of parallelism /// public bool RunUnitTests { get; set; } /// /// A global test filter that can be used to only run certain tests. /// Accepts a comma separated list of filters /// public string TestFilter { get; set; } /// /// A global cluster filter that can be used to only run certain cluster's tests. /// Accepts a comma separated list of filters /// public string ClusterFilter { get; set; } /// /// Informs the runner what version of OpenSearch is under test. Required for /// to kick in /// public OpenSearchVersion Version { get; set; } /// /// Called when the tests have finished running successfully /// /// Per cluster timings of the total test time, including starting OpenSearch /// All collection of failed cluster, failed tests tuples public virtual void OnTestsFinished(Dictionary runnerClusterTotals, ConcurrentBag> runnerFailedCollections) { } /// /// Called before tests run. An ideal place to perform actions such as writing information to /// . /// public virtual void OnBeforeTestsRun() { } } }