Skip to content

Commit 9af9968

Browse files
committed
test without skippableTheory
1 parent 036fad2 commit 9af9968

File tree

3 files changed

+2
-63
lines changed

3 files changed

+2
-63
lines changed

.github/workflows/integration.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- '**/*.md'
88
branches:
99
- master
10+
- ali/fix_ci_wind_tests
1011
pull_request:
1112
schedule:
1213
- cron: "0 1 * * *"

tests/NRedisStack.Tests/SkipIfRedisAttribute.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ public enum Is
1515
}
1616

1717
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
18-
[XunitTestCaseDiscoverer("NRedisStack.Tests.SkippableTheoryDiscoverer", "NRedisStack.Tests")]
19-
public class SkipIfRedisAttribute : SkippableTheoryAttribute
18+
public class SkipIfRedisAttribute : TheoryAttribute
2019
{
2120
private readonly string _targetVersion;
2221
private readonly Comparison _comparison;
Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +0,0 @@
1-
using Xunit.Sdk;
2-
3-
namespace NRedisStack.Tests;
4-
5-
// TODO(imalinovskiy): Remove this file once tests are migrated to Xunit v3
6-
7-
/// Copyright (c) Andrew Arnott. All rights reserved.
8-
// Licensed under the Microsoft Public License (Ms-PL).
9-
// https://github.com/AArnott/Xunit.SkippableFact/blob/main/src/Xunit.SkippableFact/Sdk/SkippableTheoryDiscoverer.cs
10-
// See https://github.com/AArnott/Xunit.SkippableFact/blob/main/LICENSE for full license information.
11-
12-
using System.Collections.Generic;
13-
using Validation;
14-
using Xunit.Abstractions;
15-
16-
/// <summary>
17-
/// Patched TestCase discoverer to support SkipIfRedisAttribute.
18-
/// </summary>
19-
public class SkippableTheoryDiscoverer : IXunitTestCaseDiscoverer
20-
{
21-
/// <summary>
22-
/// The diagnostic message sink provided to the constructor.
23-
/// </summary>
24-
private readonly IMessageSink diagnosticMessageSink;
25-
26-
/// <summary>
27-
/// The complex theory discovery process that we wrap.
28-
/// </summary>
29-
private readonly TheoryDiscoverer theoryDiscoverer;
30-
31-
/// <summary>
32-
/// Initializes a new instance of the <see cref="SkippableTheoryDiscoverer"/> class.
33-
/// </summary>
34-
/// <param name="diagnosticMessageSink">The message sink used to send diagnostic messages.</param>
35-
public SkippableTheoryDiscoverer(IMessageSink diagnosticMessageSink)
36-
{
37-
this.diagnosticMessageSink = diagnosticMessageSink;
38-
this.theoryDiscoverer = new TheoryDiscoverer(diagnosticMessageSink);
39-
}
40-
41-
/// <inheritdoc />
42-
public virtual IEnumerable<IXunitTestCase> Discover(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo factAttribute)
43-
{
44-
Requires.NotNull(factAttribute, nameof(factAttribute));
45-
string[] skippingExceptionNames = new[] { "Xunit.SkippableFact.SkipException" };
46-
TestMethodDisplay defaultMethodDisplay = discoveryOptions.MethodDisplayOrDefault();
47-
48-
IEnumerable<IXunitTestCase>? basis = this.theoryDiscoverer.Discover(discoveryOptions, testMethod, factAttribute);
49-
foreach (IXunitTestCase? testCase in basis)
50-
{
51-
if (testCase is XunitTheoryTestCase)
52-
{
53-
yield return new SkippableTheoryTestCase(skippingExceptionNames, this.diagnosticMessageSink, defaultMethodDisplay, discoveryOptions.MethodDisplayOptionsOrDefault(), testCase.TestMethod);
54-
}
55-
else
56-
{
57-
yield return new SkippableFactTestCase(skippingExceptionNames, this.diagnosticMessageSink, defaultMethodDisplay, discoveryOptions.MethodDisplayOptionsOrDefault(), testCase.TestMethod, testCase.TestMethodArguments);
58-
}
59-
}
60-
}
61-
}

0 commit comments

Comments
 (0)