Disables downloading logs

This commit is contained in:
benbierens 2024-04-15 07:36:12 +02:00
parent 3683044bf7
commit 23ebd4166b
No known key found for this signature in database
GPG Key ID: 877D2C2E09A22F3A
4 changed files with 9 additions and 5 deletions

View File

@ -14,7 +14,7 @@ public class ScalabilityTests : CodexDistTest
[Test]
[Combinatorial]
[UseLongTimeouts]
[DontDownloadLogsOnFailure]
[DontDownloadLogs]
public void ShouldMaintainFileInNetwork(
[Values(10, 40, 80, 100)] int numberOfNodes,
[Values(100, 1000, 5000, 10000)] int fileSizeInMb,

View File

@ -24,6 +24,9 @@ namespace DistTestCore
this.dataFilesPath = dataFilesPath;
}
/// <summary>
/// Does not override [DontDownloadLogs] attribute.
/// </summary>
public bool AlwaysDownloadContainerLogs { get; set; }
public KubernetesWorkflow.Configuration GetK8sConfiguration(ITimeSet timeSet, string k8sNamespace)

View File

@ -267,10 +267,11 @@ namespace DistTestCore
private bool ShouldDownloadAllLogs(TestStatus testStatus)
{
if (!IsDownloadingLogsEnabled()) return false;
if (configuration.AlwaysDownloadContainerLogs) return true;
if (testStatus == TestStatus.Failed)
{
return IsDownloadingLogsEnabled();
return true;
}
return false;
@ -289,7 +290,7 @@ namespace DistTestCore
private bool IsDownloadingLogsEnabled()
{
var testProperties = TestContext.CurrentContext.Test.Properties;
return !testProperties.ContainsKey(DontDownloadLogsOnFailureAttribute.DontDownloadKey);
return !testProperties.ContainsKey(DontDownloadLogsAttribute.DontDownloadKey);
}
}

View File

@ -3,11 +3,11 @@
namespace DistTestCore
{
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public class DontDownloadLogsOnFailureAttribute : PropertyAttribute
public class DontDownloadLogsAttribute : PropertyAttribute
{
public const string DontDownloadKey = "DontDownloadLogs";
public DontDownloadLogsOnFailureAttribute()
public DontDownloadLogsAttribute()
: base(DontDownloadKey)
{
}