-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable testing against CE 8.0-M2 and M3 (#380)
* Enable testing against CE 8.0-M2 and M3 * Use patched SkippableTheoryDiscoverer to fix tests discovery * Use older syntax * Add missing REDIS_VERSION env variables * Skip CMS.MERGE tests on cluster * Fix execution guards for some standalone-only tests * Fix GraphTests
- Loading branch information
Showing
9 changed files
with
77 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using Xunit.Sdk; | ||
|
||
namespace NRedisStack.Tests; | ||
|
||
// TODO(imalinovskiy): Remove this file once tests are migrated to Xunit v3 | ||
|
||
/// Copyright (c) Andrew Arnott. All rights reserved. | ||
// Licensed under the Microsoft Public License (Ms-PL). | ||
// https://github.com/AArnott/Xunit.SkippableFact/blob/main/src/Xunit.SkippableFact/Sdk/SkippableTheoryDiscoverer.cs | ||
// See https://github.com/AArnott/Xunit.SkippableFact/blob/main/LICENSE for full license information. | ||
|
||
using System.Collections.Generic; | ||
using Validation; | ||
using Xunit.Abstractions; | ||
|
||
/// <summary> | ||
/// Patched TestCase discoverer to support SkipIfRedisAttribute. | ||
/// </summary> | ||
public class SkippableTheoryDiscoverer : IXunitTestCaseDiscoverer | ||
{ | ||
/// <summary> | ||
/// The diagnostic message sink provided to the constructor. | ||
/// </summary> | ||
private readonly IMessageSink diagnosticMessageSink; | ||
|
||
/// <summary> | ||
/// The complex theory discovery process that we wrap. | ||
/// </summary> | ||
private readonly TheoryDiscoverer theoryDiscoverer; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="SkippableTheoryDiscoverer"/> class. | ||
/// </summary> | ||
/// <param name="diagnosticMessageSink">The message sink used to send diagnostic messages.</param> | ||
public SkippableTheoryDiscoverer(IMessageSink diagnosticMessageSink) | ||
{ | ||
this.diagnosticMessageSink = diagnosticMessageSink; | ||
this.theoryDiscoverer = new TheoryDiscoverer(diagnosticMessageSink); | ||
} | ||
|
||
/// <inheritdoc /> | ||
public virtual IEnumerable<IXunitTestCase> Discover(ITestFrameworkDiscoveryOptions discoveryOptions, ITestMethod testMethod, IAttributeInfo factAttribute) | ||
{ | ||
Requires.NotNull(factAttribute, nameof(factAttribute)); | ||
string[] skippingExceptionNames = new[] { "Xunit.SkippableFact.SkipException" }; | ||
TestMethodDisplay defaultMethodDisplay = discoveryOptions.MethodDisplayOrDefault(); | ||
|
||
IEnumerable<IXunitTestCase>? basis = this.theoryDiscoverer.Discover(discoveryOptions, testMethod, factAttribute); | ||
foreach (IXunitTestCase? testCase in basis) | ||
{ | ||
if (testCase is XunitTheoryTestCase) | ||
{ | ||
yield return new SkippableTheoryTestCase(skippingExceptionNames, this.diagnosticMessageSink, defaultMethodDisplay, discoveryOptions.MethodDisplayOptionsOrDefault(), testCase.TestMethod); | ||
} | ||
else | ||
{ | ||
yield return new SkippableFactTestCase(skippingExceptionNames, this.diagnosticMessageSink, defaultMethodDisplay, discoveryOptions.MethodDisplayOptionsOrDefault(), testCase.TestMethod, testCase.TestMethodArguments); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters