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

Limit Cosmos functional tests to one TFM #20709

Merged
merged 1 commit into from
Apr 24, 2020
Merged
Changes from all commits
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 @@ -13,10 +13,20 @@ namespace Microsoft.EntityFrameworkCore.Cosmos.TestUtilities
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)]
public class CosmosDbConfiguredConditionAttribute : Attribute, ITestCondition
{
private static bool? _connectionAvailable;

public string SkipReason
#if NETCOREAPP3_1
=> "Cosmos tests don't run on .NET Core 3.1";
#else
=> "Unable to connect to Cosmos DB. Please install/start the emulator service or configure a valid endpoint.";
#endif

#if NETCOREAPP3_1
public ValueTask<bool> IsMetAsync()
{
return new ValueTask<bool>(false);
}
#else
private static bool? _connectionAvailable;

public async ValueTask<bool> IsMetAsync()
{
Expand All @@ -27,6 +37,7 @@ public async ValueTask<bool> IsMetAsync()

return _connectionAvailable.Value;
}
#endif

private static async Task<bool> TryConnectAsync()
{
Expand Down