diff --git a/Tests/CodexTests/ScalabilityTests/ScalabilityTests.cs b/Tests/CodexTests/ScalabilityTests/ScalabilityTests.cs index 4ce41bf..79fa145 100644 --- a/Tests/CodexTests/ScalabilityTests/ScalabilityTests.cs +++ b/Tests/CodexTests/ScalabilityTests/ScalabilityTests.cs @@ -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, diff --git a/Tests/DistTestCore/Configuration.cs b/Tests/DistTestCore/Configuration.cs index 39ae73a..3fa34b5 100644 --- a/Tests/DistTestCore/Configuration.cs +++ b/Tests/DistTestCore/Configuration.cs @@ -24,6 +24,9 @@ namespace DistTestCore this.dataFilesPath = dataFilesPath; } + /// + /// Does not override [DontDownloadLogs] attribute. + /// public bool AlwaysDownloadContainerLogs { get; set; } public KubernetesWorkflow.Configuration GetK8sConfiguration(ITimeSet timeSet, string k8sNamespace) diff --git a/Tests/DistTestCore/DistTest.cs b/Tests/DistTestCore/DistTest.cs index 76f9d5b..cfc3158 100644 --- a/Tests/DistTestCore/DistTest.cs +++ b/Tests/DistTestCore/DistTest.cs @@ -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); } } diff --git a/Tests/DistTestCore/DontDownloadLogsOnFailureAttribute.cs b/Tests/DistTestCore/DontDownloadLogsAttribute.cs similarity index 67% rename from Tests/DistTestCore/DontDownloadLogsOnFailureAttribute.cs rename to Tests/DistTestCore/DontDownloadLogsAttribute.cs index 800b35b..13baab8 100644 --- a/Tests/DistTestCore/DontDownloadLogsOnFailureAttribute.cs +++ b/Tests/DistTestCore/DontDownloadLogsAttribute.cs @@ -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) { }