Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move EventLog tests to not run on CI #32501

Merged
merged 4 commits into from
Feb 18, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class EventLogEntryCollectionTests
{
private const string message = "EntryCollectionMessage";

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void CopyingEventLogEntryCollection()
{
Expand Down Expand Up @@ -44,6 +45,7 @@ public void CopyingEventLogEntryCollection()
}
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void CheckingEntryEqualityWithNull()
{
Expand All @@ -69,6 +71,7 @@ public void CheckingEntryEqualityWithNull()
}
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void CheckingEntryEqualityAndIndex()
{
Expand Down Expand Up @@ -99,6 +102,7 @@ public void CheckingEntryEqualityAndIndex()
}
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void CheckingEntryInEquality()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ private void RaisingEvent(string log, string methodName, bool waitOnEvent = true
}
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void EntryWrittenEventRaised()
{
RaisingEvent("EnableEvent", nameof(EntryWrittenEventRaised));
Assert.NotEqual(0, eventCounter);
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void EntryWrittenEventRaiseDisable()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace System.Diagnostics.Tests
{
public class EventLogSourceCreationTests
{
[ActiveIssue("https://github.com/dotnet/runtime/issues/32241")]
[Trait(XunitConstants.Category, "EventLog")] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void CheckSourceExistenceAndDeletion()
{
Expand All @@ -28,6 +28,7 @@ public void CheckSourceExistenceAndDeletion()
Assert.False(EventLog.SourceExists(source));
}

[Trait(XunitConstants.Category, "EventLog")] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
public void LogNameWithSame8FirstChars_NetCore()
Expand All @@ -54,6 +55,7 @@ public void LogNameWithSame8FirstChars_NetCore()
}
}

[Trait(XunitConstants.Category, "EventLog")] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
[SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework)]
public void LogNameWithSame8FirstChars_NetFramework()
Expand Down Expand Up @@ -142,6 +144,7 @@ public void SourceDataNull()
Assert.Throws<ArgumentNullException>(() => EventLog.CreateEventSource(null));
}

[Trait(XunitConstants.Category, "EventLog")] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void SourceAlreadyExistsWhenCreatingSource()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public void EventLogReinitializationException()
}
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void ClearLog()
{
Expand Down Expand Up @@ -57,6 +58,7 @@ public void ApplicationEventLog_Count()
}
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void DeleteLog()
{
Expand Down Expand Up @@ -128,6 +130,7 @@ public void EventLogs_Get()
Assert.Contains(eventLogCollection, eventlog => eventlog.Log.Equals("System"));
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void GetMaxKilobytes_Set()
{
Expand Down Expand Up @@ -162,6 +165,7 @@ public void MaxKilobytesOutOfRangeException()
}
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void OverflowAndRetention_Set()
{
Expand Down Expand Up @@ -190,6 +194,7 @@ public void OverflowAndRetention_Set()
}
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void Overflow_OverWriteOlderAndRetention_Set()
{
Expand Down Expand Up @@ -248,6 +253,7 @@ public void MachineName_Set()
}
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void RegisterDisplayLogName()
{
Expand Down Expand Up @@ -314,6 +320,7 @@ public void InvalidMachineName()
Assert.Throws<ArgumentException>(() => EventLog.DeleteEventSource("", ""));
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void LogDisplayNameDefault()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ private EventLogEntry WriteLogEntryEvent(string source, bool data = false)
}
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
[InlineData(false)]
[InlineData(true)]
Expand Down Expand Up @@ -153,6 +154,7 @@ public void WriteEntry(bool sourceFlag)
}
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
[InlineData(false)]
[InlineData(true)]
Expand Down Expand Up @@ -182,6 +184,7 @@ public void WriteEntryWithType(bool sourceFlag)
}
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
[InlineData(false)]
[InlineData(true)]
Expand Down Expand Up @@ -211,6 +214,7 @@ public void WriteEntryWithTypeAndId(bool sourceFlag)
}
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
[InlineData(false)]
[InlineData(true)]
Expand Down Expand Up @@ -246,6 +250,7 @@ public void WriteEntryWithTypeIdAndCategory(bool sourceFlag)
}
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
[InlineData(false)]
[InlineData(true)]
Expand Down Expand Up @@ -302,6 +307,7 @@ public void WriteEntryWithNullOrEmptySource()
Assert.Throws<ArgumentException>(() => EventLog.WriteEntry("", message));
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
[InlineData(false)]
[InlineData(true)]
Expand All @@ -328,6 +334,7 @@ public void WriteEvent(bool SourceFlag)
}
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
[InlineData(false)]
[InlineData(true)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public void CloseSucceeds()
listener.Close(); // shouldn't fail.
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void WriteTest()
{
Expand All @@ -113,7 +114,7 @@ public void WriteTest()
}
}

[ActiveIssue("https://github.com/dotnet/corefx/issues/40224", TestPlatforms.Windows)]
[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
[InlineData(TraceEventType.Information, EventLogEntryType.Information, ushort.MaxValue + 1, ushort.MaxValue)]
[InlineData(TraceEventType.Error, EventLogEntryType.Error, ushort.MinValue - 1, ushort.MinValue)]
Expand Down Expand Up @@ -155,6 +156,7 @@ public static IEnumerable<object[]> GetTraceDataParams_MemberData()
yield return new object[] { new object[] { "one string + null", null } };
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
[MemberData(nameof(GetTraceDataParams_MemberData))]
public void TraceDataParamsData(object[] parameters)
Expand Down Expand Up @@ -195,7 +197,7 @@ public static IEnumerable<object[]> GetTraceEventFormat_MemberData()
yield return new object[] { null, new object[] { "thanks, 00", "i like it...", 111 } };
}

[ActiveIssue("https://github.com/dotnet/corefx/issues/40224", TestPlatforms.Windows)]
[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalTheory(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
[MemberData(nameof(GetTraceEventFormat_MemberData))]
public void TraceEventFormatAndParams(string format, object[] parameters)
Expand Down Expand Up @@ -251,6 +253,7 @@ public void TraceEventFormatAndParams(string format, object[] parameters)
}
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void TraceWithFilters()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public void GetPropertyValues()
}

[ActiveIssue("https://github.com/dotnet/corefx/issues/34547")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this ActiveIssue left in purpose?

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalTheory(typeof(Helpers), nameof(Helpers.SupportsEventLogs))]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
[InlineData("System")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ private void RaisingEvent(string log, string methodName, bool waitOnEvent = true
}
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void RecordWrittenEventRaised()
{
RaisingEvent("EnableEvent", nameof(RecordWrittenEventRaised));
Assert.NotEqual(0, eventCounter);
}

[Trait(XunitConstants.Category, XunitConstants.IgnoreForCI)] // Unreliable Win32 API call
[ConditionalFact(typeof(Helpers), nameof(Helpers.IsElevatedAndSupportsEventLogs))]
public void RecordWrittenEventRaiseDisable()
{
Expand Down