37 lines
1.0 KiB
C#
Raw Normal View History

2023-04-13 11:30:19 +02:00
using DistTestCore.CodexLogs;
using Logging;
2023-04-12 13:53:55 +02:00
namespace DistTestCore
{
public class TestLifecycle
{
2023-04-12 16:06:04 +02:00
public TestLifecycle(Configuration configuration)
2023-04-12 13:53:55 +02:00
{
2023-04-12 16:06:04 +02:00
Log = new TestLog(configuration.GetLogConfig());
FileManager = new FileManager(Log, configuration);
2023-04-13 09:33:10 +02:00
CodexStarter = new CodexStarter(this, configuration);
2023-04-12 16:06:04 +02:00
}
2023-04-12 13:53:55 +02:00
2023-04-12 16:06:04 +02:00
public TestLog Log { get; }
public FileManager FileManager { get; }
public CodexStarter CodexStarter { get; }
2023-04-12 13:53:55 +02:00
2023-04-12 16:06:04 +02:00
public void DeleteAllResources()
{
CodexStarter.DeleteAllResources();
FileManager.DeleteAllTestFiles();
2023-04-12 13:53:55 +02:00
}
2023-04-13 11:30:19 +02:00
public ICodexNodeLog DownloadLog(OnlineCodexNode node)
{
var subFile = Log.CreateSubfile();
var description = node.Describe();
var handler = new LogDownloadHandler(description, subFile);
CodexStarter.DownloadLog(node.CodexAccess.Container, handler);
return new CodexNodeLog(subFile);
}
2023-04-12 13:53:55 +02:00
}
}