workflow creator lifecycle
This commit is contained in:
parent
c995732f35
commit
4cbd9ac828
|
@ -45,7 +45,7 @@ namespace CodexPlugin
|
|||
|
||||
public ICodexNodeGroup SetupCodexNodes(int number)
|
||||
{
|
||||
var rc = StartCodexNodes(1, s => { });
|
||||
var rc = StartCodexNodes(number, s => { });
|
||||
return WrapCodexContainers(rc);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ namespace DistTestCore
|
|||
public abstract class DistTest : PluginInterface
|
||||
{
|
||||
private const string TestsType = "dist-tests";
|
||||
private const string TestNamespacePrefix = "ct-";
|
||||
private readonly Configuration configuration = new Configuration();
|
||||
private readonly Assembly[] testAssemblies;
|
||||
private readonly FixtureLog fixtureLog;
|
||||
|
@ -45,7 +46,7 @@ namespace DistTestCore
|
|||
Stopwatch.Measure(fixtureLog, "Global setup", () =>
|
||||
{
|
||||
var wc = new WorkflowCreator(fixtureLog, configuration.GetK8sConfiguration(GetTimeSet()), string.Empty);
|
||||
wc.CreateWorkflow().DeleteNamespace();
|
||||
wc.CreateWorkflow().DeleteNamespacesStartingWith(TestNamespacePrefix);
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -221,7 +222,7 @@ namespace DistTestCore
|
|||
{
|
||||
lock (lifecycleLock)
|
||||
{
|
||||
var testNamespace = Guid.NewGuid().ToString();
|
||||
var testNamespace = TestNamespacePrefix + Guid.NewGuid().ToString();
|
||||
var lifecycle = new TestLifecycle(fixtureLog.CreateTestLog(), configuration, GetTimeSet(), testNamespace);
|
||||
lifecycles.Add(testName, lifecycle);
|
||||
DefaultContainerRecipe.TestsType = TestsType;
|
||||
|
|
|
@ -9,6 +9,7 @@ namespace DistTestCore
|
|||
{
|
||||
private readonly PluginManager pluginManager;
|
||||
private readonly DateTime testStart;
|
||||
private readonly WorkflowCreator workflowCreator;
|
||||
|
||||
public TestLifecycle(TestLog log, Configuration configuration, ITimeSet timeSet, string testNamespace)
|
||||
{
|
||||
|
@ -19,6 +20,8 @@ namespace DistTestCore
|
|||
testStart = DateTime.UtcNow;
|
||||
FileManager = new FileManager(Log, Configuration.GetFileManagerFolder());
|
||||
|
||||
workflowCreator = new WorkflowCreator(Log, Configuration.GetK8sConfiguration(TimeSet), TestNamespace);
|
||||
|
||||
pluginManager = new PluginManager();
|
||||
pluginManager.DiscoverPlugins();
|
||||
pluginManager.InitializePlugins(this);
|
||||
|
@ -50,8 +53,7 @@ namespace DistTestCore
|
|||
public IStartupWorkflow CreateWorkflow(string? namespaceOverride = null)
|
||||
{
|
||||
if (namespaceOverride != null) throw new Exception("Namespace override is not supported in the DistTest environment. (It would mess up automatic resource cleanup.)");
|
||||
var wc = new WorkflowCreator(Log, Configuration.GetK8sConfiguration(TimeSet), TestNamespace);
|
||||
return wc.CreateWorkflow();
|
||||
return workflowCreator.CreateWorkflow();
|
||||
}
|
||||
|
||||
public IFileManager GetFileManager()
|
||||
|
|
Loading…
Reference in New Issue