cs-codex-dist-tests/CodexPlugin/Plugin.cs

56 lines
1.3 KiB
C#
Raw Normal View History

2023-09-11 14:57:57 +00:00
using DistTestCore;
using KubernetesWorkflow;
2023-09-12 08:31:55 +00:00
using Logging;
2023-09-11 14:57:57 +00:00
namespace CodexPlugin
{
public class Plugin : IProjectPlugin
{
2023-09-12 08:31:55 +00:00
private CodexStarter codexStarter = null!;
2023-09-11 14:57:57 +00:00
2023-09-12 08:31:55 +00:00
#region IProjectPlugin Implementation
public void Announce(ILog log)
2023-09-11 14:57:57 +00:00
{
2023-09-12 08:31:55 +00:00
log.Log("hello from codex plugin. codex container info here.");
}
public void Initialize(IPluginTools tools)
{
codexStarter = new CodexStarter(tools);
2023-09-11 14:57:57 +00:00
DistTestExtensions.Plugin = this;
}
2023-09-12 08:31:55 +00:00
public void Finalize(ILog log)
{
}
#endregion
2023-09-11 14:57:57 +00:00
public RunningContainers[] StartCodexNodes(int numberOfNodes, Action<ICodexSetup> setup)
{
var codexSetup = new CodexSetup(numberOfNodes, CodexLogLevel.Trace);
setup(codexSetup);
return codexStarter.BringOnline(codexSetup);
}
public ICodexNodeGroup WrapCodexContainers(RunningContainers[] containers)
{
return codexStarter.WrapCodexContainers(containers);
}
public IOnlineCodexNode SetupCodexNode(Action<ICodexSetup> setup)
{
return null!;
}
public ICodexNodeGroup SetupCodexNodes(int number)
{
var rc = StartCodexNodes(1, s => { });
return WrapCodexContainers(rc);
}
2023-09-12 08:31:55 +00:00
2023-09-11 14:57:57 +00:00
}
}