mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-01-05 23:13:08 +00:00
lots of using-statement fixes
This commit is contained in:
parent
c73fa186fc
commit
9a227b3d0e
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@ obj
|
|||||||
bin
|
bin
|
||||||
.vscode
|
.vscode
|
||||||
Tools/AutoClient/datapath
|
Tools/AutoClient/datapath
|
||||||
|
.editorconfig
|
||||||
|
|||||||
@ -9,15 +9,15 @@ namespace CodexClient
|
|||||||
{
|
{
|
||||||
private readonly ILog log;
|
private readonly ILog log;
|
||||||
private readonly IFileManager fileManager;
|
private readonly IFileManager fileManager;
|
||||||
private readonly ICodexHooksProvider hooksProvider;
|
private readonly CodexHooksFactory hooksFactor;
|
||||||
private readonly IHttpFactory httpFactory;
|
private readonly IHttpFactory httpFactory;
|
||||||
private readonly IIProcessControlFactory processControlFactory;
|
private readonly IIProcessControlFactory processControlFactory;
|
||||||
|
|
||||||
public CodexNodeFactory(ILog log, IFileManager fileManager, ICodexHooksProvider hooksProvider, IHttpFactory httpFactory, IIProcessControlFactory processControlFactory)
|
public CodexNodeFactory(ILog log, IFileManager fileManager, CodexHooksFactory hooksFactory, IHttpFactory httpFactory, IIProcessControlFactory processControlFactory)
|
||||||
{
|
{
|
||||||
this.log = log;
|
this.log = log;
|
||||||
this.fileManager = fileManager;
|
this.fileManager = fileManager;
|
||||||
this.hooksProvider = hooksProvider;
|
this.hooksFactor = hooksFactory;
|
||||||
this.httpFactory = httpFactory;
|
this.httpFactory = httpFactory;
|
||||||
this.processControlFactory = processControlFactory;
|
this.processControlFactory = processControlFactory;
|
||||||
}
|
}
|
||||||
@ -26,9 +26,11 @@ namespace CodexClient
|
|||||||
{
|
{
|
||||||
var processControl = processControlFactory.CreateProcessControl(instance);
|
var processControl = processControlFactory.CreateProcessControl(instance);
|
||||||
var access = new CodexAccess(log, httpFactory, processControl, instance);
|
var access = new CodexAccess(log, httpFactory, processControl, instance);
|
||||||
var hooks = hooksProvider.CreateHooks(access.GetName());
|
var hooks = hooksFactor.CreateHooks(access.GetName());
|
||||||
var marketplaceAccess = CreateMarketplaceAccess(instance, access, hooks);
|
var marketplaceAccess = CreateMarketplaceAccess(instance, access, hooks);
|
||||||
return new CodexNode(log, access, fileManager, marketplaceAccess, hooks);
|
var node = new CodexNode(log, access, fileManager, marketplaceAccess, hooks);
|
||||||
|
node.Initialize();
|
||||||
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IMarketplaceAccess CreateMarketplaceAccess(ICodexInstance instance, CodexAccess access, ICodexNodeHooks hooks)
|
private IMarketplaceAccess CreateMarketplaceAccess(ICodexInstance instance, CodexAccess access, ICodexNodeHooks hooks)
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using CodexContractsPlugin;
|
using CodexClient;
|
||||||
|
using CodexContractsPlugin;
|
||||||
using GethPlugin;
|
using GethPlugin;
|
||||||
using KubernetesWorkflow.Types;
|
using KubernetesWorkflow.Types;
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
using Core;
|
using CodexClient;
|
||||||
using KubernetesWorkflow.Types;
|
using KubernetesWorkflow.Types;
|
||||||
using Logging;
|
|
||||||
using Utils;
|
using Utils;
|
||||||
|
|
||||||
namespace CodexPlugin
|
namespace CodexPlugin
|
||||||
|
|||||||
@ -14,9 +14,9 @@ namespace CodexPlugin
|
|||||||
|
|
||||||
public class CodexNodeGroup : ICodexNodeGroup
|
public class CodexNodeGroup : ICodexNodeGroup
|
||||||
{
|
{
|
||||||
private readonly CodexNode[] nodes;
|
private readonly ICodexNode[] nodes;
|
||||||
|
|
||||||
public CodexNodeGroup(IPluginTools tools, CodexNode[] nodes)
|
public CodexNodeGroup(IPluginTools tools, ICodexNode[] nodes)
|
||||||
{
|
{
|
||||||
this.nodes = nodes;
|
this.nodes = nodes;
|
||||||
Version = new DebugInfoVersion();
|
Version = new DebugInfoVersion();
|
||||||
@ -61,7 +61,6 @@ namespace CodexPlugin
|
|||||||
|
|
||||||
public void EnsureOnline()
|
public void EnsureOnline()
|
||||||
{
|
{
|
||||||
foreach (var node in nodes) node.Initialize();
|
|
||||||
var versionResponses = Nodes.Select(n => n.Version);
|
var versionResponses = Nodes.Select(n => n.Version);
|
||||||
|
|
||||||
var first = versionResponses.First();
|
var first = versionResponses.First();
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using CodexPlugin.Hooks;
|
using CodexClient;
|
||||||
|
using CodexClient.Hooks;
|
||||||
using Core;
|
using Core;
|
||||||
using KubernetesWorkflow;
|
using KubernetesWorkflow;
|
||||||
using KubernetesWorkflow.Types;
|
using KubernetesWorkflow.Types;
|
||||||
@ -7,7 +8,7 @@ using Utils;
|
|||||||
|
|
||||||
namespace CodexPlugin
|
namespace CodexPlugin
|
||||||
{
|
{
|
||||||
public class CodexStarter : IProcessControl
|
public class CodexStarter : IIProcessControlFactory
|
||||||
{
|
{
|
||||||
private readonly IPluginTools pluginTools;
|
private readonly IPluginTools pluginTools;
|
||||||
private readonly CodexContainerRecipe recipe = new CodexContainerRecipe();
|
private readonly CodexContainerRecipe recipe = new CodexContainerRecipe();
|
||||||
@ -24,6 +25,15 @@ namespace CodexPlugin
|
|||||||
|
|
||||||
public CodexHooksFactory HooksFactory { get; } = new CodexHooksFactory();
|
public CodexHooksFactory HooksFactory { get; } = new CodexHooksFactory();
|
||||||
|
|
||||||
|
public IProcessControl CreateProcessControl(ICodexInstance instance)
|
||||||
|
{
|
||||||
|
var pod = podMap[instance];
|
||||||
|
return new CodexContainerProcessControl(pluginTools, pod, onStop: () =>
|
||||||
|
{
|
||||||
|
podMap.Remove(instance);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public RunningPod[] BringOnline(CodexSetup codexSetup)
|
public RunningPod[] BringOnline(CodexSetup codexSetup)
|
||||||
{
|
{
|
||||||
LogSeparator();
|
LogSeparator();
|
||||||
@ -47,46 +57,14 @@ namespace CodexPlugin
|
|||||||
return containers;
|
return containers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Stop(ICodexInstance instance, bool waitTillStopped)
|
|
||||||
{
|
|
||||||
Log($"Stopping node...");
|
|
||||||
var pod = podMap[instance];
|
|
||||||
podMap.Remove(instance);
|
|
||||||
|
|
||||||
var workflow = pluginTools.CreateWorkflow();
|
|
||||||
workflow.Stop(pod, waitTillStopped);
|
|
||||||
Log("Stopped.");
|
|
||||||
}
|
|
||||||
|
|
||||||
public IDownloadedLog DownloadLog(ICodexInstance instance, LogFile file)
|
|
||||||
{
|
|
||||||
var workflow = pluginTools.CreateWorkflow();
|
|
||||||
var pod = podMap[instance];
|
|
||||||
return workflow.DownloadContainerLog(pod.Containers.Single());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DeleteDataDirFolder(ICodexInstance instance)
|
|
||||||
{
|
|
||||||
var pod = podMap[instance];
|
|
||||||
var container = pod.Containers.Single();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var dataDirVar = container.Recipe.EnvVars.Single(e => e.Name == "CODEX_DATA_DIR");
|
|
||||||
var dataDir = dataDirVar.Value;
|
|
||||||
var workflow = pluginTools.CreateWorkflow();
|
|
||||||
workflow.ExecuteCommand(container, "rm", "-Rfv", $"/codex/{dataDir}/repo");
|
|
||||||
Log("Deleted repo folder.");
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Log("Unable to delete repo folder: " + e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ICodexNodeGroup WrapCodexContainers(CoreInterface coreInterface, RunningPod[] containers)
|
public ICodexNodeGroup WrapCodexContainers(CoreInterface coreInterface, RunningPod[] containers)
|
||||||
{
|
{
|
||||||
var codexNodeFactory = new CodexNodeFactory(pluginTools, HooksFactory);
|
var codexNodeFactory = new CodexNodeFactory(
|
||||||
|
log: pluginTools.GetLog(),
|
||||||
|
fileManager: pluginTools.GetFileManager(),
|
||||||
|
hooksFactory: HooksFactory,
|
||||||
|
httpFactory: pluginTools,
|
||||||
|
processControlFactory: this);
|
||||||
|
|
||||||
var group = CreateCodexGroup(coreInterface, containers, codexNodeFactory);
|
var group = CreateCodexGroup(coreInterface, containers, codexNodeFactory);
|
||||||
|
|
||||||
@ -139,8 +117,7 @@ namespace CodexPlugin
|
|||||||
private CodexNodeGroup CreateCodexGroup(CoreInterface coreInterface, RunningPod[] runningContainers, CodexNodeFactory codexNodeFactory)
|
private CodexNodeGroup CreateCodexGroup(CoreInterface coreInterface, RunningPod[] runningContainers, CodexNodeFactory codexNodeFactory)
|
||||||
{
|
{
|
||||||
var instances = runningContainers.Select(CreateInstance).ToArray();
|
var instances = runningContainers.Select(CreateInstance).ToArray();
|
||||||
var accesses = instances.Select(CreateAccess).ToArray();
|
var nodes = instances.Select(codexNodeFactory.CreateCodexNode).ToArray();
|
||||||
var nodes = accesses.Select(codexNodeFactory.CreateOnlineCodexNode).ToArray();
|
|
||||||
var group = new CodexNodeGroup(pluginTools, nodes);
|
var group = new CodexNodeGroup(pluginTools, nodes);
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -156,18 +133,6 @@ namespace CodexPlugin
|
|||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
|
|
||||||
private CodexAccess CreateAccess(ICodexInstance instance)
|
|
||||||
{
|
|
||||||
var crashWatcher = CreateCrashWatcher(instance);
|
|
||||||
return new CodexAccess(pluginTools, this, instance, crashWatcher);
|
|
||||||
}
|
|
||||||
|
|
||||||
private ICrashWatcher CreateCrashWatcher(ICodexInstance instance)
|
|
||||||
{
|
|
||||||
var pod = podMap[instance];
|
|
||||||
return pluginTools.CreateWorkflow().CreateCrashWatcher(pod.Containers.Single());
|
|
||||||
}
|
|
||||||
|
|
||||||
private ICodexInstance CreateInstance(RunningPod pod)
|
private ICodexInstance CreateInstance(RunningPod pod)
|
||||||
{
|
{
|
||||||
var instance = CodexInstanceContainerExtension.CreateFromPod(pod);
|
var instance = CodexInstanceContainerExtension.CreateFromPod(pod);
|
||||||
@ -198,4 +163,66 @@ namespace CodexPlugin
|
|||||||
pluginTools.GetLog().Log(message);
|
pluginTools.GetLog().Log(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class CodexContainerProcessControl : IProcessControl
|
||||||
|
{
|
||||||
|
private readonly IPluginTools tools;
|
||||||
|
private readonly RunningPod pod;
|
||||||
|
private readonly Action onStop;
|
||||||
|
private readonly ContainerCrashWatcher crashWatcher;
|
||||||
|
|
||||||
|
public CodexContainerProcessControl(IPluginTools tools, RunningPod pod, Action onStop)
|
||||||
|
{
|
||||||
|
this.tools = tools;
|
||||||
|
this.pod = pod;
|
||||||
|
this.onStop = onStop;
|
||||||
|
|
||||||
|
crashWatcher = tools.CreateWorkflow().CreateCrashWatcher(pod.Containers.Single());
|
||||||
|
crashWatcher.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Stop(bool waitTillStopped)
|
||||||
|
{
|
||||||
|
Log($"Stopping node...");
|
||||||
|
var workflow = tools.CreateWorkflow();
|
||||||
|
workflow.Stop(pod, waitTillStopped);
|
||||||
|
crashWatcher.Stop();
|
||||||
|
onStop();
|
||||||
|
Log("Stopped.");
|
||||||
|
}
|
||||||
|
|
||||||
|
public IDownloadedLog DownloadLog(LogFile file)
|
||||||
|
{
|
||||||
|
var workflow = tools.CreateWorkflow();
|
||||||
|
return workflow.DownloadContainerLog(pod.Containers.Single());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteDataDirFolder()
|
||||||
|
{
|
||||||
|
var container = pod.Containers.Single();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var dataDirVar = container.Recipe.EnvVars.Single(e => e.Name == "CODEX_DATA_DIR");
|
||||||
|
var dataDir = dataDirVar.Value;
|
||||||
|
var workflow = tools.CreateWorkflow();
|
||||||
|
workflow.ExecuteCommand(container, "rm", "-Rfv", $"/codex/{dataDir}/repo");
|
||||||
|
Log("Deleted repo folder.");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Log("Unable to delete repo folder: " + e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool HasCrashed()
|
||||||
|
{
|
||||||
|
return crashWatcher.HasCrashed();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Log(string message)
|
||||||
|
{
|
||||||
|
tools.GetLog().Log(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using KubernetesWorkflow;
|
using CodexClient;
|
||||||
|
using KubernetesWorkflow;
|
||||||
using Utils;
|
using Utils;
|
||||||
|
|
||||||
namespace CodexPlugin
|
namespace CodexPlugin
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using CodexPlugin.Hooks;
|
using CodexClient;
|
||||||
|
using CodexClient.Hooks;
|
||||||
using Core;
|
using Core;
|
||||||
using KubernetesWorkflow.Types;
|
using KubernetesWorkflow.Types;
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
using CodexPlugin.OverwatchSupport.LineConverters;
|
using CodexClient;
|
||||||
using KubernetesWorkflow;
|
using CodexPlugin.OverwatchSupport.LineConverters;
|
||||||
using Logging;
|
using Logging;
|
||||||
using OverwatchTranscript;
|
using OverwatchTranscript;
|
||||||
using Utils;
|
using Utils;
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using CodexPlugin.Hooks;
|
using CodexClient;
|
||||||
|
using CodexClient.Hooks;
|
||||||
using OverwatchTranscript;
|
using OverwatchTranscript;
|
||||||
using Utils;
|
using Utils;
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
using CodexPlugin.Hooks;
|
using CodexClient.Hooks;
|
||||||
using KubernetesWorkflow;
|
|
||||||
using Logging;
|
using Logging;
|
||||||
using OverwatchTranscript;
|
using OverwatchTranscript;
|
||||||
using Utils;
|
using Utils;
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
namespace CodexPlugin.OverwatchSupport
|
using CodexClient;
|
||||||
|
|
||||||
|
namespace CodexPlugin.OverwatchSupport
|
||||||
{
|
{
|
||||||
public class IdentityMap
|
public class IdentityMap
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
namespace CodexPlugin.OverwatchSupport.LineConverters
|
using CodexClient;
|
||||||
|
|
||||||
|
namespace CodexPlugin.OverwatchSupport.LineConverters
|
||||||
{
|
{
|
||||||
public class BlockReceivedLineConverter : ILineConverter
|
public class BlockReceivedLineConverter : ILineConverter
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
namespace CodexPlugin.OverwatchSupport.LineConverters
|
using CodexClient;
|
||||||
|
|
||||||
|
namespace CodexPlugin.OverwatchSupport.LineConverters
|
||||||
{
|
{
|
||||||
public class BootstrapLineConverter : ILineConverter
|
public class BootstrapLineConverter : ILineConverter
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
namespace CodexPlugin.OverwatchSupport.LineConverters
|
using CodexClient;
|
||||||
|
|
||||||
|
namespace CodexPlugin.OverwatchSupport.LineConverters
|
||||||
{
|
{
|
||||||
public class DialSuccessfulLineConverter : ILineConverter
|
public class DialSuccessfulLineConverter : ILineConverter
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
namespace CodexPlugin.OverwatchSupport.LineConverters
|
using CodexClient;
|
||||||
|
|
||||||
|
namespace CodexPlugin.OverwatchSupport.LineConverters
|
||||||
{
|
{
|
||||||
public class PeerDroppedLineConverter : ILineConverter
|
public class PeerDroppedLineConverter : ILineConverter
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using OverwatchTranscript;
|
using CodexClient;
|
||||||
|
using OverwatchTranscript;
|
||||||
|
|
||||||
namespace CodexPlugin.OverwatchSupport
|
namespace CodexPlugin.OverwatchSupport
|
||||||
{
|
{
|
||||||
|
|||||||
@ -15,7 +15,7 @@ public static class Program
|
|||||||
var pluginRoot = FindCodexPluginFolder();
|
var pluginRoot = FindCodexPluginFolder();
|
||||||
var clientRoot = FindCodexClientFolder();
|
var clientRoot = FindCodexClientFolder();
|
||||||
Console.WriteLine("Located CodexPlugin: " + pluginRoot);
|
Console.WriteLine("Located CodexPlugin: " + pluginRoot);
|
||||||
var openApiFile = Path.Combine(pluginRoot, "openapi.yaml");
|
var openApiFile = Path.Combine(clientRoot, "openapi.yaml");
|
||||||
var clientFile = Path.Combine(clientRoot, "obj", "openapiClient.cs");
|
var clientFile = Path.Combine(clientRoot, "obj", "openapiClient.cs");
|
||||||
var targetFile = Path.Combine(pluginRoot, "ApiChecker.cs");
|
var targetFile = Path.Combine(pluginRoot, "ApiChecker.cs");
|
||||||
|
|
||||||
|
|||||||
@ -29,12 +29,12 @@ namespace DistTestCore
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool AlwaysDownloadContainerLogs { get; set; }
|
public bool AlwaysDownloadContainerLogs { get; set; }
|
||||||
|
|
||||||
public KubernetesWorkflow.Configuration GetK8sConfiguration(ITimeSet timeSet, string k8sNamespace)
|
public KubernetesWorkflow.Configuration GetK8sConfiguration(IK8sTimeSet timeSet, string k8sNamespace)
|
||||||
{
|
{
|
||||||
return GetK8sConfiguration(timeSet, new DoNothingK8sHooks(), k8sNamespace);
|
return GetK8sConfiguration(timeSet, new DoNothingK8sHooks(), k8sNamespace);
|
||||||
}
|
}
|
||||||
|
|
||||||
public KubernetesWorkflow.Configuration GetK8sConfiguration(ITimeSet timeSet, IK8sHooks hooks, string k8sNamespace)
|
public KubernetesWorkflow.Configuration GetK8sConfiguration(IK8sTimeSet timeSet, IK8sHooks hooks, string k8sNamespace)
|
||||||
{
|
{
|
||||||
var config = new KubernetesWorkflow.Configuration(
|
var config = new KubernetesWorkflow.Configuration(
|
||||||
kubeConfigFile: kubeConfigFile,
|
kubeConfigFile: kubeConfigFile,
|
||||||
|
|||||||
@ -6,6 +6,7 @@ using NUnit.Framework;
|
|||||||
using NUnit.Framework.Interfaces;
|
using NUnit.Framework.Interfaces;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Utils;
|
using Utils;
|
||||||
|
using WebUtils;
|
||||||
using Assert = NUnit.Framework.Assert;
|
using Assert = NUnit.Framework.Assert;
|
||||||
|
|
||||||
namespace DistTestCore
|
namespace DistTestCore
|
||||||
@ -35,7 +36,7 @@ namespace DistTestCore
|
|||||||
fixtureLog = new FixtureLog(logConfig, startTime, deployId);
|
fixtureLog = new FixtureLog(logConfig, startTime, deployId);
|
||||||
statusLog = new StatusLog(logConfig, startTime, "dist-tests", deployId);
|
statusLog = new StatusLog(logConfig, startTime, "dist-tests", deployId);
|
||||||
|
|
||||||
globalEntryPoint = new EntryPoint(fixtureLog, configuration.GetK8sConfiguration(new DefaultTimeSet(), TestNamespacePrefix), configuration.GetFileManagerFolder());
|
globalEntryPoint = new EntryPoint(fixtureLog, configuration.GetK8sConfiguration(new DefaultK8sTimeSet(), TestNamespacePrefix), configuration.GetFileManagerFolder());
|
||||||
|
|
||||||
Initialize(fixtureLog);
|
Initialize(fixtureLog);
|
||||||
}
|
}
|
||||||
@ -194,7 +195,8 @@ namespace DistTestCore
|
|||||||
var lifecycle = new TestLifecycle(
|
var lifecycle = new TestLifecycle(
|
||||||
fixtureLog.CreateTestLog(),
|
fixtureLog.CreateTestLog(),
|
||||||
configuration,
|
configuration,
|
||||||
GetTimeSet(),
|
GetWebCallTimeSet(),
|
||||||
|
GetK8sTimeSet(),
|
||||||
testNamespace,
|
testNamespace,
|
||||||
deployId,
|
deployId,
|
||||||
ShouldWaitForCleanup());
|
ShouldWaitForCleanup());
|
||||||
@ -241,10 +243,16 @@ namespace DistTestCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ITimeSet GetTimeSet()
|
private IWebCallTimeSet GetWebCallTimeSet()
|
||||||
{
|
{
|
||||||
if (ShouldUseLongTimeouts()) return new LongTimeSet();
|
if (ShouldUseLongTimeouts()) return new LongWebCallTimeSet();
|
||||||
return new DefaultTimeSet();
|
return new DefaultWebCallTimeSet();
|
||||||
|
}
|
||||||
|
|
||||||
|
private IK8sTimeSet GetK8sTimeSet()
|
||||||
|
{
|
||||||
|
if (ShouldUseLongTimeouts()) return new LongK8sTimeSet();
|
||||||
|
return new DefaultK8sTimeSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool ShouldWaitForCleanup()
|
private bool ShouldWaitForCleanup()
|
||||||
|
|||||||
@ -6,6 +6,7 @@ using KubernetesWorkflow.Recipe;
|
|||||||
using KubernetesWorkflow.Types;
|
using KubernetesWorkflow.Types;
|
||||||
using Logging;
|
using Logging;
|
||||||
using Utils;
|
using Utils;
|
||||||
|
using WebUtils;
|
||||||
|
|
||||||
namespace DistTestCore
|
namespace DistTestCore
|
||||||
{
|
{
|
||||||
@ -18,15 +19,16 @@ namespace DistTestCore
|
|||||||
private readonly string deployId;
|
private readonly string deployId;
|
||||||
private readonly List<IDownloadedLog> stoppedContainerLogs = new List<IDownloadedLog>();
|
private readonly List<IDownloadedLog> stoppedContainerLogs = new List<IDownloadedLog>();
|
||||||
|
|
||||||
public TestLifecycle(TestLog log, Configuration configuration, ITimeSet timeSet, string testNamespace, string deployId, bool waitForCleanup)
|
public TestLifecycle(TestLog log, Configuration configuration, IWebCallTimeSet webCallTimeSet, IK8sTimeSet k8sTimeSet, string testNamespace, string deployId, bool waitForCleanup)
|
||||||
{
|
{
|
||||||
Log = log;
|
Log = log;
|
||||||
Configuration = configuration;
|
Configuration = configuration;
|
||||||
TimeSet = timeSet;
|
WebCallTimeSet = webCallTimeSet;
|
||||||
|
K8STimeSet = k8sTimeSet;
|
||||||
TestNamespace = testNamespace;
|
TestNamespace = testNamespace;
|
||||||
TestStart = DateTime.UtcNow;
|
TestStart = DateTime.UtcNow;
|
||||||
|
|
||||||
entryPoint = new EntryPoint(log, configuration.GetK8sConfiguration(timeSet, this, testNamespace), configuration.GetFileManagerFolder(), timeSet);
|
entryPoint = new EntryPoint(log, configuration.GetK8sConfiguration(k8sTimeSet, this, testNamespace), configuration.GetFileManagerFolder(), webCallTimeSet, k8sTimeSet);
|
||||||
metadata = entryPoint.GetPluginMetadata();
|
metadata = entryPoint.GetPluginMetadata();
|
||||||
CoreInterface = entryPoint.CreateInterface();
|
CoreInterface = entryPoint.CreateInterface();
|
||||||
this.deployId = deployId;
|
this.deployId = deployId;
|
||||||
@ -37,7 +39,8 @@ namespace DistTestCore
|
|||||||
public DateTime TestStart { get; }
|
public DateTime TestStart { get; }
|
||||||
public TestLog Log { get; }
|
public TestLog Log { get; }
|
||||||
public Configuration Configuration { get; }
|
public Configuration Configuration { get; }
|
||||||
public ITimeSet TimeSet { get; }
|
public IWebCallTimeSet WebCallTimeSet { get; }
|
||||||
|
public IK8sTimeSet K8STimeSet { get; }
|
||||||
public string TestNamespace { get; }
|
public string TestNamespace { get; }
|
||||||
public bool WaitForCleanup { get; }
|
public bool WaitForCleanup { get; }
|
||||||
public CoreInterface CoreInterface { get; }
|
public CoreInterface CoreInterface { get; }
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using CodexPlugin;
|
using CodexClient;
|
||||||
|
using CodexPlugin;
|
||||||
using DistTestCore;
|
using DistTestCore;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,5 @@
|
|||||||
using CodexPlugin;
|
using CodexClient;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Utils;
|
using Utils;
|
||||||
|
|
||||||
namespace CodexTests.BasicTests
|
namespace CodexTests.BasicTests
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using BlockchainUtils;
|
using BlockchainUtils;
|
||||||
|
using CodexClient;
|
||||||
using CodexContractsPlugin;
|
using CodexContractsPlugin;
|
||||||
using CodexNetDeployer;
|
using CodexNetDeployer;
|
||||||
using CodexPlugin;
|
using CodexPlugin;
|
||||||
@ -15,7 +16,6 @@ using Newtonsoft.Json;
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using NUnit.Framework.Constraints;
|
using NUnit.Framework.Constraints;
|
||||||
using OverwatchTranscript;
|
using OverwatchTranscript;
|
||||||
using Utils;
|
|
||||||
|
|
||||||
namespace CodexTests
|
namespace CodexTests
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
using CodexContractsPlugin;
|
using CodexClient;
|
||||||
using CodexPlugin;
|
using CodexContractsPlugin;
|
||||||
using GethPlugin;
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using Utils;
|
using Utils;
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using CodexPlugin;
|
using CodexClient;
|
||||||
using FileUtils;
|
using FileUtils;
|
||||||
using Logging;
|
using Logging;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using CodexPlugin;
|
using CodexClient;
|
||||||
using Logging;
|
using Logging;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using CodexPlugin;
|
using CodexClient;
|
||||||
using Logging;
|
using Logging;
|
||||||
using static CodexTests.Helpers.FullConnectivityHelper;
|
using static CodexTests.Helpers.FullConnectivityHelper;
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using CodexPlugin;
|
using CodexClient;
|
||||||
using FileUtils;
|
using FileUtils;
|
||||||
using Logging;
|
using Logging;
|
||||||
using Utils;
|
using Utils;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using CodexPlugin;
|
using CodexClient;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace CodexTests.PeerDiscoveryTests
|
namespace CodexTests.PeerDiscoveryTests
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
using CodexContractsPlugin;
|
using CodexContractsPlugin;
|
||||||
using CodexPlugin;
|
using CodexClient;
|
||||||
using GethPlugin;
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace CodexTests.PeerDiscoveryTests
|
namespace CodexTests.PeerDiscoveryTests
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using CodexPlugin;
|
using CodexClient;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using Utils;
|
using Utils;
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using CodexPlugin;
|
using CodexClient;
|
||||||
|
using CodexPlugin;
|
||||||
using DistTestCore;
|
using DistTestCore;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using Utils;
|
using Utils;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
using CodexContractsPlugin;
|
using NUnit.Framework;
|
||||||
using NUnit.Framework;
|
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
using Utils;
|
||||||
|
|
||||||
namespace FrameworkTests.CodexContractsPlugin
|
namespace FrameworkTests.CodexContractsPlugin
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using CodexOpenApi;
|
using CodexClient;
|
||||||
|
using CodexOpenApi;
|
||||||
using CodexPlugin;
|
using CodexPlugin;
|
||||||
using Logging;
|
using Logging;
|
||||||
using Nethereum.Model;
|
using Nethereum.Model;
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
using BiblioTech.Options;
|
using BiblioTech.Options;
|
||||||
using CodexContractsPlugin;
|
using CodexContractsPlugin;
|
||||||
using GethPlugin;
|
using GethPlugin;
|
||||||
|
using Utils;
|
||||||
|
|
||||||
namespace BiblioTech.Commands
|
namespace BiblioTech.Commands
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
using BiblioTech.Options;
|
using BiblioTech.Options;
|
||||||
using Discord;
|
using Discord;
|
||||||
using GethPlugin;
|
using Utils;
|
||||||
using k8s.KubeConfigModels;
|
|
||||||
using NBitcoin.Secp256k1;
|
|
||||||
|
|
||||||
namespace BiblioTech.Commands
|
namespace BiblioTech.Commands
|
||||||
{
|
{
|
||||||
@ -67,7 +65,7 @@ namespace BiblioTech.Commands
|
|||||||
await Program.AdminChecker.SendInAdminChannel($"User {Mention(user)} used '/{Name}' but the provided address is already in use by another user. (address: {newAddress})");
|
await Program.AdminChecker.SendInAdminChannel($"User {Mention(user)} used '/{Name}' but the provided address is already in use by another user. (address: {newAddress})");
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ResponseOK(CommandContext context, IUser user, GethPlugin.EthAddress newAddress)
|
private async Task ResponseOK(CommandContext context, IUser user, EthAddress newAddress)
|
||||||
{
|
{
|
||||||
await context.Followup(new string[]
|
await context.Followup(new string[]
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
using GethPlugin;
|
using Nethereum.Util;
|
||||||
using Nethereum.Util;
|
using Utils;
|
||||||
|
|
||||||
namespace BiblioTech.Options
|
namespace BiblioTech.Options
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using CodexContractsPlugin;
|
using CodexContractsPlugin;
|
||||||
using GethPlugin;
|
using GethPlugin;
|
||||||
|
using Utils;
|
||||||
|
|
||||||
namespace BiblioTech
|
namespace BiblioTech
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
using Discord;
|
using Discord;
|
||||||
using GethPlugin;
|
using GethPlugin;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Utils;
|
||||||
|
|
||||||
namespace BiblioTech
|
namespace BiblioTech
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
|
using GethPlugin;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Utils;
|
|
||||||
|
|
||||||
namespace KeyMaker.Controllers
|
namespace KeyMaker.Controllers
|
||||||
{
|
{
|
||||||
@ -10,7 +10,7 @@ namespace KeyMaker.Controllers
|
|||||||
[HttpGet]
|
[HttpGet]
|
||||||
public KeyResponse Get()
|
public KeyResponse Get()
|
||||||
{
|
{
|
||||||
var account = EthAccount.GenerateNew();
|
var account = EthAccountGenerator.GenerateNew();
|
||||||
|
|
||||||
return new KeyResponse
|
return new KeyResponse
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
using CodexContractsPlugin;
|
using CodexContractsPlugin;
|
||||||
using CodexContractsPlugin.Marketplace;
|
using CodexContractsPlugin.Marketplace;
|
||||||
using GethPlugin;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Utils;
|
||||||
|
|
||||||
namespace TestNetRewarder
|
namespace TestNetRewarder
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
using DiscordRewards;
|
using DiscordRewards;
|
||||||
using GethPlugin;
|
using Utils;
|
||||||
|
|
||||||
namespace TestNetRewarder
|
namespace TestNetRewarder
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
using BlockchainUtils;
|
using BlockchainUtils;
|
||||||
using CodexContractsPlugin.ChainMonitor;
|
using CodexContractsPlugin.ChainMonitor;
|
||||||
using DiscordRewards;
|
using DiscordRewards;
|
||||||
using GethPlugin;
|
|
||||||
using NethereumWorkflow;
|
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
using Utils;
|
||||||
|
|
||||||
namespace TestNetRewarder
|
namespace TestNetRewarder
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using CodexPlugin;
|
using CodexClient;
|
||||||
using CodexPlugin.OverwatchSupport;
|
using CodexPlugin.OverwatchSupport;
|
||||||
using OverwatchTranscript;
|
using OverwatchTranscript;
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using CodexPlugin;
|
using CodexClient;
|
||||||
using CodexPlugin.OverwatchSupport;
|
using CodexPlugin.OverwatchSupport;
|
||||||
using OverwatchTranscript;
|
using OverwatchTranscript;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user