2023-09-20 08:51:47 +00:00
|
|
|
|
using Logging;
|
|
|
|
|
|
|
|
|
|
namespace DistTestCore.Logs
|
2023-09-12 09:25:04 +00:00
|
|
|
|
{
|
|
|
|
|
public abstract class BaseTestLog : BaseLog
|
|
|
|
|
{
|
|
|
|
|
private bool hasFailed;
|
2024-02-22 13:41:07 +00:00
|
|
|
|
private readonly string deployId;
|
|
|
|
|
|
|
|
|
|
protected BaseTestLog(string deployId)
|
|
|
|
|
{
|
|
|
|
|
this.deployId = deployId;
|
|
|
|
|
}
|
2023-09-12 09:25:04 +00:00
|
|
|
|
|
2023-09-20 08:51:47 +00:00
|
|
|
|
public void WriteLogTag()
|
|
|
|
|
{
|
|
|
|
|
var category = NameUtils.GetCategoryName();
|
|
|
|
|
var name = NameUtils.GetTestMethodName();
|
2024-02-22 13:41:07 +00:00
|
|
|
|
LogFile.WriteRaw($"{deployId} {category} {name}");
|
2023-09-20 08:51:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-09-12 09:25:04 +00:00
|
|
|
|
public void MarkAsFailed()
|
|
|
|
|
{
|
|
|
|
|
if (hasFailed) return;
|
|
|
|
|
hasFailed = true;
|
|
|
|
|
LogFile.ConcatToFilename("_FAILED");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|