mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-01-07 16:03:07 +00:00
excellent cleanup
This commit is contained in:
parent
ad1b756db9
commit
dd888f30e3
@ -23,16 +23,27 @@ namespace CodexPlugin.OverwatchSupport
|
|||||||
converter = new CodexLogConverter(writer, config, identityMap);
|
converter = new CodexLogConverter(writer, config, identityMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Finalize(string outputFilepath)
|
public void FinalizeWriter()
|
||||||
{
|
{
|
||||||
log.Log("Finalizing Codex transcript...");
|
log.Log("Finalizing Codex transcript...");
|
||||||
|
|
||||||
writer.AddHeader(CodexHeaderKey, CreateCodexHeader());
|
writer.AddHeader(CodexHeaderKey, CreateCodexHeader());
|
||||||
writer.Write(outputFilepath);
|
writer.Write(GetOutputFullPath());
|
||||||
|
|
||||||
log.Log("Done");
|
log.Log("Done");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string GetOutputFullPath()
|
||||||
|
{
|
||||||
|
var outputPath = Path.GetDirectoryName(log.GetFullName());
|
||||||
|
if (outputPath == null) throw new Exception("Logfile path is null");
|
||||||
|
var filename = Path.GetFileNameWithoutExtension(log.GetFullName());
|
||||||
|
if (string.IsNullOrEmpty(filename)) throw new Exception("Logfile name is null or empty");
|
||||||
|
var outputFile = Path.Combine(outputPath, filename + "_" + config.OutputPath);
|
||||||
|
if (!outputFile.EndsWith(".owts")) outputFile += ".owts";
|
||||||
|
return outputFile;
|
||||||
|
}
|
||||||
|
|
||||||
public ICodexNodeHooks CreateHooks(string nodeName)
|
public ICodexNodeHooks CreateHooks(string nodeName)
|
||||||
{
|
{
|
||||||
nodeName = Str.Between(nodeName, "'", "'");
|
nodeName = Str.Between(nodeName, "'", "'");
|
||||||
|
|||||||
@ -2,11 +2,13 @@
|
|||||||
{
|
{
|
||||||
public class CodexTranscriptWriterConfig
|
public class CodexTranscriptWriterConfig
|
||||||
{
|
{
|
||||||
public CodexTranscriptWriterConfig(bool includeBlockReceivedEvents)
|
public CodexTranscriptWriterConfig(string outputPath, bool includeBlockReceivedEvents)
|
||||||
{
|
{
|
||||||
|
OutputPath = outputPath;
|
||||||
IncludeBlockReceivedEvents = includeBlockReceivedEvents;
|
IncludeBlockReceivedEvents = includeBlockReceivedEvents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string OutputPath { get; }
|
||||||
public bool IncludeBlockReceivedEvents { get; }
|
public bool IncludeBlockReceivedEvents { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,41 +3,35 @@ using CodexContractsPlugin;
|
|||||||
using CodexContractsPlugin.Marketplace;
|
using CodexContractsPlugin.Marketplace;
|
||||||
using CodexPlugin;
|
using CodexPlugin;
|
||||||
using CodexTests;
|
using CodexTests;
|
||||||
using DistTestCore;
|
|
||||||
using GethPlugin;
|
using GethPlugin;
|
||||||
using Nethereum.Hex.HexConvertors.Extensions;
|
using Nethereum.Hex.HexConvertors.Extensions;
|
||||||
|
using NUnit.Framework;
|
||||||
using Utils;
|
using Utils;
|
||||||
|
|
||||||
namespace CodexReleaseTests.MarketTests
|
namespace CodexReleaseTests.MarketTests
|
||||||
{
|
{
|
||||||
public abstract class MarketplaceAutoBootstrapDistTest : AutoBootstrapDistTest
|
public abstract class MarketplaceAutoBootstrapDistTest : AutoBootstrapDistTest
|
||||||
{
|
{
|
||||||
private readonly Dictionary<TestLifecycle, MarketplaceHandle> handles = new Dictionary<TestLifecycle, MarketplaceHandle>();
|
private MarketplaceHandle handle = null!;
|
||||||
protected const int StartingBalanceTST = 1000;
|
protected const int StartingBalanceTST = 1000;
|
||||||
protected const int StartingBalanceEth = 10;
|
protected const int StartingBalanceEth = 10;
|
||||||
|
|
||||||
protected override void LifecycleStart(TestLifecycle lifecycle)
|
[SetUp]
|
||||||
|
public void SetupMarketplace()
|
||||||
{
|
{
|
||||||
base.LifecycleStart(lifecycle);
|
|
||||||
var geth = StartGethNode(s => s.IsMiner());
|
var geth = StartGethNode(s => s.IsMiner());
|
||||||
var contracts = Ci.StartCodexContracts(geth, BootstrapNode.Version);
|
var contracts = Ci.StartCodexContracts(geth, BootstrapNode.Version);
|
||||||
handles.Add(lifecycle, new MarketplaceHandle(geth, contracts));
|
handle = new MarketplaceHandle(geth, contracts);
|
||||||
}
|
|
||||||
|
|
||||||
protected override void LifecycleStop(TestLifecycle lifecycle, DistTestResult result)
|
|
||||||
{
|
|
||||||
handles.Remove(lifecycle);
|
|
||||||
base.LifecycleStop(lifecycle, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IGethNode GetGeth()
|
protected IGethNode GetGeth()
|
||||||
{
|
{
|
||||||
return handles[Get()].Geth;
|
return handle.Geth;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ICodexContracts GetContracts()
|
protected ICodexContracts GetContracts()
|
||||||
{
|
{
|
||||||
return handles[Get()].Contracts;
|
return handle.Contracts;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected TimeSpan GetPeriodDuration()
|
protected TimeSpan GetPeriodDuration()
|
||||||
|
|||||||
@ -1,11 +1,5 @@
|
|||||||
using CodexPlugin;
|
using CodexTests;
|
||||||
using CodexTests;
|
|
||||||
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 CodexReleaseTests.NodeTests
|
namespace CodexReleaseTests.NodeTests
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
[assembly: LevelOfParallelism(1)]
|
[assembly: LevelOfParallelism(10)]
|
||||||
namespace CodexReleaseTests
|
namespace CodexReleaseTests
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,70 +12,45 @@ using Assert = NUnit.Framework.Assert;
|
|||||||
namespace DistTestCore
|
namespace DistTestCore
|
||||||
{
|
{
|
||||||
[Parallelizable(ParallelScope.All)]
|
[Parallelizable(ParallelScope.All)]
|
||||||
|
[FixtureLifeCycle(LifeCycle.InstancePerTestCase)]
|
||||||
public abstract class DistTest
|
public abstract class DistTest
|
||||||
{
|
{
|
||||||
private const string TestNamespacePrefix = "cdx-";
|
private static readonly Global global = new Global();
|
||||||
private readonly Configuration configuration = new Configuration();
|
|
||||||
private readonly Assembly[] testAssemblies;
|
|
||||||
private readonly FixtureLog fixtureLog;
|
private readonly FixtureLog fixtureLog;
|
||||||
private readonly StatusLog statusLog;
|
private readonly StatusLog statusLog;
|
||||||
private readonly object lifecycleLock = new object();
|
private readonly TestLifecycle lifecycle;
|
||||||
private readonly EntryPoint globalEntryPoint;
|
private readonly string deployId = NameUtils.MakeDeployId();
|
||||||
private readonly Dictionary<string, TestLifecycle> lifecycles = new Dictionary<string, TestLifecycle>();
|
|
||||||
private readonly string deployId;
|
|
||||||
|
|
||||||
public DistTest()
|
public DistTest()
|
||||||
{
|
{
|
||||||
var assemblies = AppDomain.CurrentDomain.GetAssemblies();
|
var logConfig = global.Configuration.GetLogConfig();
|
||||||
testAssemblies = assemblies.Where(a => a.FullName!.ToLowerInvariant().Contains("test")).ToArray();
|
|
||||||
|
|
||||||
deployId = NameUtils.MakeDeployId();
|
|
||||||
|
|
||||||
var logConfig = configuration.GetLogConfig();
|
|
||||||
var startTime = DateTime.UtcNow;
|
var startTime = DateTime.UtcNow;
|
||||||
fixtureLog = FixtureLog.Create(logConfig, startTime, deployId);
|
fixtureLog = FixtureLog.Create(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 DefaultK8sTimeSet(), TestNamespacePrefix), configuration.GetFileManagerFolder());
|
fixtureLog.Log("Test framework revision: " + GitInfo.GetStatus());
|
||||||
|
|
||||||
|
lifecycle = new TestLifecycle(fixtureLog.CreateTestLog(startTime), global.Configuration,
|
||||||
|
GetWebCallTimeSet(),
|
||||||
|
GetK8sTimeSet(),
|
||||||
|
Global.TestNamespacePrefix + Guid.NewGuid().ToString(),
|
||||||
|
deployId,
|
||||||
|
ShouldWaitForCleanup()
|
||||||
|
);
|
||||||
|
|
||||||
Initialize(fixtureLog);
|
Initialize(fixtureLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
[OneTimeSetUp]
|
[OneTimeSetUp]
|
||||||
public void GlobalSetup()
|
public static void GlobalSetup()
|
||||||
{
|
{
|
||||||
fixtureLog.Log($"Starting...");
|
global.Setup();
|
||||||
globalEntryPoint.Announce();
|
|
||||||
|
|
||||||
// Previous test run may have been interrupted.
|
|
||||||
// Begin by cleaning everything up.
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Stopwatch.Measure(fixtureLog, "Global setup", () =>
|
|
||||||
{
|
|
||||||
globalEntryPoint.Tools.CreateWorkflow().DeleteNamespacesStartingWith(TestNamespacePrefix, wait: true);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
GlobalTestFailure.HasFailed = true;
|
|
||||||
fixtureLog.Error($"Global setup cleanup failed with: {ex}");
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
fixtureLog.Log("Test framework revision: " + GitInfo.GetStatus());
|
|
||||||
fixtureLog.Log("Global setup cleanup successful");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[OneTimeTearDown]
|
[OneTimeTearDown]
|
||||||
public void GlobalTearDown()
|
public static void GlobalTearDown()
|
||||||
{
|
{
|
||||||
globalEntryPoint.Decommission(
|
global.TearDown();
|
||||||
// There shouldn't be any of either, but clean everything up regardless.
|
|
||||||
deleteKubernetesResources: true,
|
|
||||||
deleteTrackedFiles: true,
|
|
||||||
waitTillDone: true
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
@ -85,18 +60,6 @@ namespace DistTestCore
|
|||||||
{
|
{
|
||||||
Assert.Inconclusive("Skip test: Previous test failed during clean up.");
|
Assert.Inconclusive("Skip test: Previous test failed during clean up.");
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
CreateNewTestLifecycle();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
fixtureLog.Error("Setup failed: " + ex);
|
|
||||||
GlobalTestFailure.HasFailed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TearDown]
|
[TearDown]
|
||||||
@ -117,18 +80,18 @@ namespace DistTestCore
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return Get().CoreInterface;
|
return lifecycle.CoreInterface;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public TrackedFile GenerateTestFile(ByteSize size, string label = "")
|
public TrackedFile GenerateTestFile(ByteSize size, string label = "")
|
||||||
{
|
{
|
||||||
return Get().GenerateTestFile(size, label);
|
return lifecycle.GenerateTestFile(size, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TrackedFile GenerateTestFile(Action<IGenerateOption> options, string label = "")
|
public TrackedFile GenerateTestFile(Action<IGenerateOption> options, string label = "")
|
||||||
{
|
{
|
||||||
return Get().GenerateTestFile(options, label);
|
return lifecycle.GenerateTestFile(options, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -137,12 +100,22 @@ namespace DistTestCore
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void ScopedTestFiles(Action action)
|
public void ScopedTestFiles(Action action)
|
||||||
{
|
{
|
||||||
Get().GetFileManager().ScopedFiles(action);
|
lifecycle.GetFileManager().ScopedFiles(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ILog GetTestLog()
|
public ILog GetTestLog()
|
||||||
{
|
{
|
||||||
return Get().Log;
|
return lifecycle.Log;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IFileManager GetFileManager()
|
||||||
|
{
|
||||||
|
return lifecycle.GetFileManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetTestNamespace()
|
||||||
|
{
|
||||||
|
return lifecycle.TestNamespace;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Log(string msg)
|
public void Log(string msg)
|
||||||
@ -159,64 +132,24 @@ namespace DistTestCore
|
|||||||
|
|
||||||
public void Measure(string name, Action action)
|
public void Measure(string name, Action action)
|
||||||
{
|
{
|
||||||
Stopwatch.Measure(Get().Log, name, action);
|
Stopwatch.Measure(lifecycle.Log, name, action);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected TimeRange GetTestRunTimeRange()
|
protected TimeRange GetTestRunTimeRange()
|
||||||
{
|
{
|
||||||
return new TimeRange(Get().TestStart, DateTime.UtcNow);
|
return new TimeRange(lifecycle.TestStart, DateTime.UtcNow);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void Initialize(FixtureLog fixtureLog)
|
protected virtual void Initialize(FixtureLog fixtureLog)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void LifecycleStart(TestLifecycle lifecycle)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void LifecycleStop(TestLifecycle lifecycle, DistTestResult testResult)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void CollectStatusLogData(TestLifecycle lifecycle, Dictionary<string, string> data)
|
protected virtual void CollectStatusLogData(TestLifecycle lifecycle, Dictionary<string, string> data)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected TestLifecycle Get()
|
|
||||||
{
|
|
||||||
lock (lifecycleLock)
|
|
||||||
{
|
|
||||||
return lifecycles[GetCurrentTestName()];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CreateNewTestLifecycle()
|
|
||||||
{
|
|
||||||
var testName = GetCurrentTestName();
|
|
||||||
fixtureLog.WriteLogTag();
|
|
||||||
Stopwatch.Measure(fixtureLog, $"Setup for {testName}", () =>
|
|
||||||
{
|
|
||||||
lock (lifecycleLock)
|
|
||||||
{
|
|
||||||
var testNamespace = TestNamespacePrefix + Guid.NewGuid().ToString();
|
|
||||||
var lifecycle = new TestLifecycle(
|
|
||||||
fixtureLog.CreateTestLog(),
|
|
||||||
configuration,
|
|
||||||
GetWebCallTimeSet(),
|
|
||||||
GetK8sTimeSet(),
|
|
||||||
testNamespace,
|
|
||||||
deployId,
|
|
||||||
ShouldWaitForCleanup());
|
|
||||||
lifecycles.Add(testName, lifecycle);
|
|
||||||
LifecycleStart(lifecycle);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DisposeTestLifecycle()
|
private void DisposeTestLifecycle()
|
||||||
{
|
{
|
||||||
var lifecycle = Get();
|
|
||||||
var testResult = GetTestResult();
|
var testResult = GetTestResult();
|
||||||
var testDuration = lifecycle.GetTestDuration();
|
var testDuration = lifecycle.GetTestDuration();
|
||||||
var data = lifecycle.GetPluginMetadata();
|
var data = lifecycle.GetPluginMetadata();
|
||||||
@ -228,9 +161,7 @@ namespace DistTestCore
|
|||||||
WriteEndTestLog(lifecycle.Log);
|
WriteEndTestLog(lifecycle.Log);
|
||||||
|
|
||||||
IncludeLogsOnTestFailure(lifecycle);
|
IncludeLogsOnTestFailure(lifecycle);
|
||||||
LifecycleStop(lifecycle, testResult);
|
|
||||||
lifecycle.DeleteAllResources();
|
lifecycle.DeleteAllResources();
|
||||||
lifecycles.Remove(GetCurrentTestName());
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,7 +218,7 @@ namespace DistTestCore
|
|||||||
var className = currentTest.ClassName;
|
var className = currentTest.ClassName;
|
||||||
var methodName = currentTest.MethodName;
|
var methodName = currentTest.MethodName;
|
||||||
|
|
||||||
var testClasses = testAssemblies.SelectMany(a => a.GetTypes()).Where(c => c.FullName == className).ToArray();
|
var testClasses = global.TestAssemblies.SelectMany(a => a.GetTypes()).Where(c => c.FullName == className).ToArray();
|
||||||
var testMethods = testClasses.SelectMany(c => c.GetMethods()).Where(m => m.Name == methodName).ToArray();
|
var testMethods = testClasses.SelectMany(c => c.GetMethods()).Where(m => m.Name == methodName).ToArray();
|
||||||
|
|
||||||
return testMethods.Select(m => m.GetCustomAttribute<T>())
|
return testMethods.Select(m => m.GetCustomAttribute<T>())
|
||||||
@ -296,19 +227,24 @@ namespace DistTestCore
|
|||||||
.ToArray();
|
.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected IDownloadedLog[] DownloadAllLogs()
|
||||||
|
{
|
||||||
|
return lifecycle.DownloadAllLogs();
|
||||||
|
}
|
||||||
|
|
||||||
private void IncludeLogsOnTestFailure(TestLifecycle lifecycle)
|
private void IncludeLogsOnTestFailure(TestLifecycle lifecycle)
|
||||||
{
|
{
|
||||||
var testStatus = TestContext.CurrentContext.Result.Outcome.Status;
|
var testStatus = TestContext.CurrentContext.Result.Outcome.Status;
|
||||||
if (ShouldDownloadAllLogs(testStatus))
|
if (ShouldDownloadAllLogs(testStatus))
|
||||||
{
|
{
|
||||||
lifecycle.Log.Log("Downloading all container logs...");
|
lifecycle.Log.Log("Downloading all container logs...");
|
||||||
lifecycle.DownloadAllLogs();
|
DownloadAllLogs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool ShouldDownloadAllLogs(TestStatus testStatus)
|
private bool ShouldDownloadAllLogs(TestStatus testStatus)
|
||||||
{
|
{
|
||||||
if (configuration.AlwaysDownloadContainerLogs) return true;
|
if (global.Configuration.AlwaysDownloadContainerLogs) return true;
|
||||||
if (!IsDownloadingLogsEnabled()) return false;
|
if (!IsDownloadingLogsEnabled()) return false;
|
||||||
if (testStatus == TestStatus.Failed)
|
if (testStatus == TestStatus.Failed)
|
||||||
{
|
{
|
||||||
@ -323,7 +259,7 @@ namespace DistTestCore
|
|||||||
return $"[{TestContext.CurrentContext.Test.Name}]";
|
return $"[{TestContext.CurrentContext.Test.Name}]";
|
||||||
}
|
}
|
||||||
|
|
||||||
private DistTestResult GetTestResult()
|
public DistTestResult GetTestResult()
|
||||||
{
|
{
|
||||||
var success = TestContext.CurrentContext.Result.Outcome.Status == TestStatus.Passed;
|
var success = TestContext.CurrentContext.Result.Outcome.Status == TestStatus.Passed;
|
||||||
var status = TestContext.CurrentContext.Result.Outcome.Status.ToString();
|
var status = TestContext.CurrentContext.Result.Outcome.Status.ToString();
|
||||||
|
|||||||
60
Tests/DistTestCore/Global.cs
Normal file
60
Tests/DistTestCore/Global.cs
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using Core;
|
||||||
|
using Logging;
|
||||||
|
|
||||||
|
namespace DistTestCore
|
||||||
|
{
|
||||||
|
public class Global
|
||||||
|
{
|
||||||
|
public const string TestNamespacePrefix = "cdx-";
|
||||||
|
public Configuration Configuration { get; } = new Configuration();
|
||||||
|
|
||||||
|
public Assembly[] TestAssemblies { get; }
|
||||||
|
private readonly EntryPoint globalEntryPoint;
|
||||||
|
private readonly ILog log;
|
||||||
|
|
||||||
|
public Global()
|
||||||
|
{
|
||||||
|
var assemblies = AppDomain.CurrentDomain.GetAssemblies();
|
||||||
|
TestAssemblies = assemblies.Where(a => a.FullName!.ToLowerInvariant().Contains("test")).ToArray();
|
||||||
|
|
||||||
|
log = new ConsoleLog();
|
||||||
|
globalEntryPoint = new EntryPoint(
|
||||||
|
log,
|
||||||
|
Configuration.GetK8sConfiguration(
|
||||||
|
new DefaultK8sTimeSet(),
|
||||||
|
TestNamespacePrefix
|
||||||
|
),
|
||||||
|
Configuration.GetFileManagerFolder()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Setup()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Stopwatch.Measure(log, "Global setup", () =>
|
||||||
|
{
|
||||||
|
globalEntryPoint.Announce();
|
||||||
|
globalEntryPoint.Tools.CreateWorkflow().DeleteNamespacesStartingWith(TestNamespacePrefix, wait: true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
GlobalTestFailure.HasFailed = true;
|
||||||
|
log.Error($"Global setup cleanup failed with: {ex}");
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TearDown()
|
||||||
|
{
|
||||||
|
globalEntryPoint.Decommission(
|
||||||
|
// There shouldn't be any of either, but clean everything up regardless.
|
||||||
|
deleteKubernetesResources: true,
|
||||||
|
deleteTrackedFiles: true,
|
||||||
|
waitTillDone: true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -4,19 +4,14 @@ namespace DistTestCore.Logs
|
|||||||
{
|
{
|
||||||
public class FixtureLog : BaseTestLog
|
public class FixtureLog : BaseTestLog
|
||||||
{
|
{
|
||||||
private readonly ILog backingLog;
|
|
||||||
private readonly string deployId;
|
|
||||||
|
|
||||||
public FixtureLog(ILog backingLog, string deployId)
|
public FixtureLog(ILog backingLog, string deployId)
|
||||||
: base(backingLog, deployId)
|
: base(backingLog, deployId)
|
||||||
{
|
{
|
||||||
this.backingLog = backingLog;
|
|
||||||
this.deployId = deployId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public TestLog CreateTestLog(string name = "")
|
public TestLog CreateTestLog(DateTime start, string name = "")
|
||||||
{
|
{
|
||||||
return TestLog.Create(this, name);
|
return TestLog.Create(this, start, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FixtureLog Create(LogConfig config, DateTime start, string deployId, string name = "")
|
public static FixtureLog Create(LogConfig config, DateTime start, string deployId, string name = "")
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
using Logging;
|
using Logging;
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace DistTestCore.Logs
|
namespace DistTestCore.Logs
|
||||||
{
|
{
|
||||||
@ -11,9 +10,9 @@ namespace DistTestCore.Logs
|
|||||||
backingLog.Log($"*** Begin: {methodName}");
|
backingLog.Log($"*** Begin: {methodName}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TestLog Create(FixtureLog parentLog, string name = "")
|
public static TestLog Create(FixtureLog parentLog, DateTime start, string name = "")
|
||||||
{
|
{
|
||||||
var methodName = NameUtils.GetTestMethodName(name);
|
var methodName = NameUtils.GetTestLogFileName(start, name);
|
||||||
var fullName = Path.Combine(parentLog.GetFullName(), methodName);
|
var fullName = Path.Combine(parentLog.GetFullName(), methodName);
|
||||||
var backingLog = CreateMainLog(fullName, name);
|
var backingLog = CreateMainLog(fullName, name);
|
||||||
return new TestLog(backingLog, methodName, parentLog.DeployId);
|
return new TestLog(backingLog, methodName, parentLog.DeployId);
|
||||||
|
|||||||
@ -5,6 +5,11 @@ namespace DistTestCore
|
|||||||
{
|
{
|
||||||
public static class NameUtils
|
public static class NameUtils
|
||||||
{
|
{
|
||||||
|
public static string GetTestLogFileName(DateTime start, string name = "")
|
||||||
|
{
|
||||||
|
return $"{Pad(start.Hour)}-{Pad(start.Minute)}-{Pad(start.Second)}Z_{GetTestMethodName(name)}";
|
||||||
|
}
|
||||||
|
|
||||||
public static string GetTestMethodName(string name = "")
|
public static string GetTestMethodName(string name = "")
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(name)) return name;
|
if (!string.IsNullOrEmpty(name)) return name;
|
||||||
@ -16,7 +21,7 @@ namespace DistTestCore
|
|||||||
public static string GetFixtureFullName(LogConfig config, DateTime start, string name)
|
public static string GetFixtureFullName(LogConfig config, DateTime start, string name)
|
||||||
{
|
{
|
||||||
var folder = DetermineFolder(config, start);
|
var folder = DetermineFolder(config, start);
|
||||||
var fixtureName = GetFixtureName(name, start);
|
var fixtureName = GetRawFixtureName();
|
||||||
return Path.Combine(folder, fixtureName);
|
return Path.Combine(folder, fixtureName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,13 +90,6 @@ namespace DistTestCore
|
|||||||
Pad(start.Day));
|
Pad(start.Day));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetFixtureName(string name, DateTime start)
|
|
||||||
{
|
|
||||||
var fixtureName = GetRawFixtureName();
|
|
||||||
if (!string.IsNullOrEmpty(name)) fixtureName = name;
|
|
||||||
return $"{Pad(start.Hour)}-{Pad(start.Minute)}-{Pad(start.Second)}Z_{fixtureName.Replace('.', '-')}";
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string Pad(int n)
|
private static string Pad(int n)
|
||||||
{
|
{
|
||||||
return n.ToString().PadLeft(2, '0');
|
return n.ToString().PadLeft(2, '0');
|
||||||
|
|||||||
@ -1,29 +1,27 @@
|
|||||||
using CodexClient;
|
using CodexClient;
|
||||||
using CodexPlugin;
|
using CodexPlugin;
|
||||||
using DistTestCore;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace CodexTests
|
namespace CodexTests
|
||||||
{
|
{
|
||||||
public class AutoBootstrapDistTest : CodexDistTest
|
public class AutoBootstrapDistTest : CodexDistTest
|
||||||
{
|
{
|
||||||
private readonly Dictionary<TestLifecycle, ICodexNode> bootstrapNodes = new Dictionary<TestLifecycle, ICodexNode>();
|
|
||||||
private bool isBooting = false;
|
private bool isBooting = false;
|
||||||
|
|
||||||
protected override void LifecycleStart(TestLifecycle tl)
|
public ICodexNode BootstrapNode { get; private set; } = null!;
|
||||||
|
|
||||||
|
[SetUp]
|
||||||
|
public void SetupBootstrapNode()
|
||||||
{
|
{
|
||||||
base.LifecycleStart(tl);
|
isBooting = true;
|
||||||
if (!bootstrapNodes.ContainsKey(tl))
|
BootstrapNode = StartCodex(s => s.WithName("BOOTSTRAP_" + GetTestNamespace()));
|
||||||
{
|
isBooting = false;
|
||||||
isBooting = true;
|
|
||||||
bootstrapNodes.Add(tl, StartCodex(s => s.WithName("BOOTSTRAP_" + tl.TestNamespace)));
|
|
||||||
isBooting = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LifecycleStop(TestLifecycle lifecycle, DistTestResult result)
|
[TearDown]
|
||||||
|
public void TearDownBootstrapNode()
|
||||||
{
|
{
|
||||||
bootstrapNodes.Remove(lifecycle);
|
BootstrapNode.Stop(waitTillStopped: false);
|
||||||
base.LifecycleStop(lifecycle, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnCodexSetup(ICodexSetup setup)
|
protected override void OnCodexSetup(ICodexSetup setup)
|
||||||
@ -33,18 +31,5 @@ namespace CodexTests
|
|||||||
var node = BootstrapNode;
|
var node = BootstrapNode;
|
||||||
if (node != null) setup.WithBootstrapNode(node);
|
if (node != null) setup.WithBootstrapNode(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ICodexNode BootstrapNode
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
var tl = Get();
|
|
||||||
if (bootstrapNodes.TryGetValue(tl, out var node))
|
|
||||||
{
|
|
||||||
return node;
|
|
||||||
}
|
|
||||||
throw new InvalidOperationException("Bootstrap node not yet started.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
using BlockchainUtils;
|
using BlockchainUtils;
|
||||||
using CodexClient;
|
using CodexClient;
|
||||||
using CodexClient.Hooks;
|
|
||||||
using CodexContractsPlugin;
|
using CodexContractsPlugin;
|
||||||
using CodexNetDeployer;
|
using CodexNetDeployer;
|
||||||
using CodexPlugin;
|
using CodexPlugin;
|
||||||
@ -17,85 +16,14 @@ 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
|
||||||
{
|
{
|
||||||
public class CodexLogTrackerProvider : ICodexHooksProvider
|
|
||||||
{
|
|
||||||
private readonly Action<ICodexNode> addNode;
|
|
||||||
|
|
||||||
public CodexLogTrackerProvider(Action<ICodexNode> addNode)
|
|
||||||
{
|
|
||||||
this.addNode = addNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
// See TestLifecycle.cs DownloadAllLogs()
|
|
||||||
public ICodexNodeHooks CreateHooks(string nodeName)
|
|
||||||
{
|
|
||||||
return new CodexLogTracker(addNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
public class CodexLogTracker : ICodexNodeHooks
|
|
||||||
{
|
|
||||||
private readonly Action<ICodexNode> addNode;
|
|
||||||
|
|
||||||
public CodexLogTracker(Action<ICodexNode> addNode)
|
|
||||||
{
|
|
||||||
this.addNode = addNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFileDownloaded(ByteSize size, ContentId cid)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFileDownloading(ContentId cid)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFileUploaded(string uid, ByteSize size, ContentId cid)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFileUploading(string uid, ByteSize size)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnNodeStarted(ICodexNode node, string peerId, string nodeId)
|
|
||||||
{
|
|
||||||
addNode(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnNodeStarting(DateTime startUtc, string image, EthAccount? ethAccount)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnNodeStopping()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnStorageAvailabilityCreated(StorageAvailability response)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnStorageContractSubmitted(StoragePurchaseContract storagePurchaseContract)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnStorageContractUpdated(StoragePurchase purchaseStatus)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class CodexDistTest : DistTest
|
public class CodexDistTest : DistTest
|
||||||
{
|
{
|
||||||
private static readonly object _lock = new object();
|
private readonly BlockCache blockCache = new BlockCache();
|
||||||
private static readonly Dictionary<TestLifecycle, CodexTranscriptWriter> writers = new Dictionary<TestLifecycle, CodexTranscriptWriter>();
|
private readonly List<ICodexNode> nodes = new List<ICodexNode>();
|
||||||
private static readonly Dictionary<TestLifecycle, BlockCache> blockCaches = new Dictionary<TestLifecycle, BlockCache>();
|
private CodexTranscriptWriter? writer;
|
||||||
|
|
||||||
// this entire structure is not good and needs to be destroyed at the earliest convenience:
|
|
||||||
private static readonly Dictionary<TestLifecycle, List<ICodexNode>> nodes = new Dictionary<TestLifecycle, List<ICodexNode>>();
|
|
||||||
|
|
||||||
public CodexDistTest()
|
public CodexDistTest()
|
||||||
{
|
{
|
||||||
@ -105,41 +33,26 @@ namespace CodexTests
|
|||||||
ProjectPlugin.Load<MetricsPlugin.MetricsPlugin>();
|
ProjectPlugin.Load<MetricsPlugin.MetricsPlugin>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SetUp]
|
||||||
|
public void SetupCodexDistTest()
|
||||||
|
{
|
||||||
|
writer = SetupTranscript();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[TearDown]
|
||||||
|
public void TearDownCodexDistTest()
|
||||||
|
{
|
||||||
|
TeardownTranscript();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Initialize(FixtureLog fixtureLog)
|
protected override void Initialize(FixtureLog fixtureLog)
|
||||||
{
|
{
|
||||||
var localBuilder = new LocalCodexBuilder(fixtureLog);
|
var localBuilder = new LocalCodexBuilder(fixtureLog);
|
||||||
localBuilder.Intialize();
|
localBuilder.Intialize();
|
||||||
localBuilder.Build();
|
localBuilder.Build();
|
||||||
}
|
|
||||||
|
|
||||||
protected override void LifecycleStart(TestLifecycle lifecycle)
|
Ci.AddCodexHooksProvider(new CodexLogTrackerProvider(nodes.Add));
|
||||||
{
|
|
||||||
base.LifecycleStart(lifecycle);
|
|
||||||
SetupTranscript(lifecycle);
|
|
||||||
|
|
||||||
Ci.AddCodexHooksProvider(new CodexLogTrackerProvider(n =>
|
|
||||||
{
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
if (!nodes.ContainsKey(lifecycle)) nodes.Add(lifecycle, new List<ICodexNode>());
|
|
||||||
nodes[lifecycle].Add(n);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void LifecycleStop(TestLifecycle lifecycle, DistTestResult result)
|
|
||||||
{
|
|
||||||
base.LifecycleStop(lifecycle, result);
|
|
||||||
TeardownTranscript(lifecycle, result);
|
|
||||||
|
|
||||||
if (!result.Success)
|
|
||||||
{
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
var codexNodes = nodes[lifecycle];
|
|
||||||
foreach (var node in codexNodes) node.DownloadLog();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICodexNode StartCodex()
|
public ICodexNode StartCodex()
|
||||||
@ -170,7 +83,7 @@ namespace CodexTests
|
|||||||
|
|
||||||
public IGethNode StartGethNode(Action<IGethSetup> setup)
|
public IGethNode StartGethNode(Action<IGethSetup> setup)
|
||||||
{
|
{
|
||||||
return Ci.StartGethNode(GetBlockCache(), setup);
|
return Ci.StartGethNode(blockCache, setup);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PeerConnectionTestHelpers CreatePeerConnectionTestHelpers()
|
public PeerConnectionTestHelpers CreatePeerConnectionTestHelpers()
|
||||||
@ -180,7 +93,7 @@ namespace CodexTests
|
|||||||
|
|
||||||
public PeerDownloadTestHelpers CreatePeerDownloadTestHelpers()
|
public PeerDownloadTestHelpers CreatePeerDownloadTestHelpers()
|
||||||
{
|
{
|
||||||
return new PeerDownloadTestHelpers(GetTestLog(), Get().GetFileManager());
|
return new PeerDownloadTestHelpers(GetTestLog(), GetFileManager());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AssertBalance(ICodexContracts contracts, ICodexNode codexNode, Constraint constraint, string msg = "")
|
public void AssertBalance(ICodexContracts contracts, ICodexNode codexNode, Constraint constraint, string msg = "")
|
||||||
@ -258,82 +171,47 @@ namespace CodexTests
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetupTranscript(TestLifecycle lifecycle)
|
private CodexTranscriptWriter? SetupTranscript()
|
||||||
{
|
{
|
||||||
var attr = GetTranscriptAttributeOfCurrentTest();
|
var attr = GetTranscriptAttributeOfCurrentTest();
|
||||||
if (attr == null) return;
|
if (attr == null) return null;
|
||||||
|
|
||||||
var config = new CodexTranscriptWriterConfig(
|
var config = new CodexTranscriptWriterConfig(
|
||||||
|
attr.OutputFilename,
|
||||||
attr.IncludeBlockReceivedEvents
|
attr.IncludeBlockReceivedEvents
|
||||||
);
|
);
|
||||||
|
|
||||||
var log = new LogPrefixer(lifecycle.Log, "(Transcript) ");
|
var log = new LogPrefixer(GetTestLog(), "(Transcript) ");
|
||||||
var writer = new CodexTranscriptWriter(log, config, Transcript.NewWriter(log));
|
var writer = new CodexTranscriptWriter(log, config, Transcript.NewWriter(log));
|
||||||
Ci.AddCodexHooksProvider(writer);
|
Ci.AddCodexHooksProvider(writer);
|
||||||
lock (_lock)
|
return writer;
|
||||||
{
|
|
||||||
writers.Add(lifecycle, writer);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TeardownTranscript(TestLifecycle lifecycle, DistTestResult result)
|
private void TeardownTranscript()
|
||||||
{
|
{
|
||||||
var attr = GetTranscriptAttributeOfCurrentTest();
|
if (writer == null) return;
|
||||||
if (attr == null) return;
|
|
||||||
|
|
||||||
var outputFilepath = GetOutputFullPath(lifecycle, attr);
|
|
||||||
|
|
||||||
CodexTranscriptWriter writer = null!;
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
writer = writers[lifecycle];
|
|
||||||
writers.Remove(lifecycle);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
var result = GetTestResult();
|
||||||
|
var log = GetTestLog();
|
||||||
writer.AddResult(result.Success, result.Result);
|
writer.AddResult(result.Success, result.Result);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Stopwatch.Measure(lifecycle.Log, "Transcript.ProcessLogs", () =>
|
Stopwatch.Measure(log, "Transcript.ProcessLogs", () =>
|
||||||
{
|
{
|
||||||
writer.ProcessLogs(lifecycle.DownloadAllLogs());
|
writer.ProcessLogs(DownloadAllLogs());
|
||||||
});
|
});
|
||||||
|
|
||||||
Stopwatch.Measure(lifecycle.Log, $"Transcript.Finalize: {outputFilepath}", () =>
|
Stopwatch.Measure(log, $"Transcript.FinalizeWriter", () =>
|
||||||
{
|
{
|
||||||
writer.IncludeFile(lifecycle.Log.GetFullName());
|
writer.IncludeFile(log.GetFullName());
|
||||||
writer.Finalize(outputFilepath);
|
writer.FinalizeWriter();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
lifecycle.Log.Error("Failure during transcript teardown: " + ex);
|
log.Error("Failure during transcript teardown: " + ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetOutputFullPath(TestLifecycle lifecycle, CreateTranscriptAttribute attr)
|
|
||||||
{
|
|
||||||
var outputPath = Path.GetDirectoryName(lifecycle.Log.GetFullName());
|
|
||||||
if (outputPath == null) throw new Exception("Logfile path is null");
|
|
||||||
var filename = Path.GetFileNameWithoutExtension(lifecycle.Log.GetFullName());
|
|
||||||
if (string.IsNullOrEmpty(filename)) throw new Exception("Logfile name is null or empty");
|
|
||||||
var outputFile = Path.Combine(outputPath, filename + "_" + attr.OutputFilename);
|
|
||||||
if (!outputFile.EndsWith(".owts")) outputFile += ".owts";
|
|
||||||
return outputFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
private BlockCache GetBlockCache()
|
|
||||||
{
|
|
||||||
var lifecycle = Get();
|
|
||||||
lock (_lock)
|
|
||||||
{
|
|
||||||
if (!blockCaches.ContainsKey(lifecycle))
|
|
||||||
{
|
|
||||||
blockCaches[lifecycle] = new BlockCache();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return blockCaches[lifecycle];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
|
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
|
||||||
|
|||||||
73
Tests/ExperimentalTests/CodexLogTrackerProvider.cs
Normal file
73
Tests/ExperimentalTests/CodexLogTrackerProvider.cs
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
using CodexClient;
|
||||||
|
using CodexClient.Hooks;
|
||||||
|
using Utils;
|
||||||
|
|
||||||
|
namespace CodexTests
|
||||||
|
{
|
||||||
|
public class CodexLogTrackerProvider : ICodexHooksProvider
|
||||||
|
{
|
||||||
|
private readonly Action<ICodexNode> addNode;
|
||||||
|
|
||||||
|
public CodexLogTrackerProvider(Action<ICodexNode> addNode)
|
||||||
|
{
|
||||||
|
this.addNode = addNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
// See TestLifecycle.cs DownloadAllLogs()
|
||||||
|
public ICodexNodeHooks CreateHooks(string nodeName)
|
||||||
|
{
|
||||||
|
return new CodexLogTracker(addNode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CodexLogTracker : ICodexNodeHooks
|
||||||
|
{
|
||||||
|
private readonly Action<ICodexNode> addNode;
|
||||||
|
|
||||||
|
public CodexLogTracker(Action<ICodexNode> addNode)
|
||||||
|
{
|
||||||
|
this.addNode = addNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnFileDownloaded(ByteSize size, ContentId cid)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnFileDownloading(ContentId cid)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnFileUploaded(string uid, ByteSize size, ContentId cid)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnFileUploading(string uid, ByteSize size)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnNodeStarted(ICodexNode node, string peerId, string nodeId)
|
||||||
|
{
|
||||||
|
addNode(node);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnNodeStarting(DateTime startUtc, string image, EthAccount? ethAccount)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnNodeStopping()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnStorageAvailabilityCreated(StorageAvailability response)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnStorageContractSubmitted(StoragePurchaseContract storagePurchaseContract)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnStorageContractUpdated(StoragePurchase purchaseStatus)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user