Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
--health-timeout=5s

cosmosdb:
image: mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview
image: mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-latest
ports:
- 8081:8081
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,6 @@ protected Test2Context()
}
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/291 (Session tokens not properly tracked)
public class CosmosNonSharedSessionTokenTests(NonSharedFixture fixture) : NonSharedModelTestBase(fixture), IClassFixture<NonSharedFixture>
{
protected override ITestStoreFactory NonSharedTestStoreFactory
Expand All @@ -588,8 +587,7 @@ protected override ITestStoreFactory NonSharedTestStoreFactory

protected override TestStore CreateTestStore() => CosmosTestStore.Create(NonSharedStoreName, (cfg) => cfg.SessionTokenManagementMode(Cosmos.Infrastructure.SessionTokenManagementMode.SemiAutomatic));

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/322
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
[Fact]
public virtual async Task UseSessionTokens_uses_session_tokens()
{
var contextFactory = await InitializeNonSharedTest<CosmosSessionTokenContext>();
Expand Down Expand Up @@ -633,8 +631,7 @@ public virtual async Task ReadItem_does_not_exist_returns_null()
Assert.Null(result);
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/322
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
[Fact]
public virtual async Task Read_item_session_not_found_throws_CosmosException()
{
var contextFactory = await InitializeNonSharedTest<CosmosSessionTokenContext>();
Expand Down Expand Up @@ -721,7 +718,7 @@ public virtual async Task Pooled_context_clears_SessionTokenStorage()
Assert.True(_sessionTokenStorage.ClearCalled);
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/319
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/331
[ConditionalTheory(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
[InlineData(AutoTransactionBehavior.Never)]
[InlineData(AutoTransactionBehavior.Always)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ public class CosmosTransactionalBatchTest(CosmosTransactionalBatchTest.CosmosFix

protected CosmosFixture Fixture { get; } = fixture;

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/292 (Transactional batch limits not enforced)
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
[Fact]
public virtual async Task SaveChanges_fails_for_duplicate_key_in_same_partition_prevents_other_inserts_in_same_partition_even_if_staged_before_add()
{
using (var arrangeContext = Fixture.CreateContext())
Expand Down Expand Up @@ -107,8 +106,7 @@ public virtual async Task SaveChanges_transaction_behavior_never_fails_for_dupli
Assert.Equal(4, customersCount);
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/292 (Transactional batch limits not enforced)
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
[Fact]
public virtual async Task SaveChanges_transaction_behavior_always_fails_for_multiple_partitionkeys()
{
using var context = Fixture.CreateContext();
Expand Down Expand Up @@ -171,8 +169,7 @@ public virtual async Task SaveChanges_transaction_behavior_always_succeeds_for_1
Assert.Equal(100, customersCount);
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/292 (Transactional batch limits not enforced)
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
[Fact]
public virtual async Task SaveChanges_transaction_behavior_always_fails_for_multiple_entities_with_triggers()
{
using var context = Fixture.CreateContext();
Expand All @@ -189,7 +186,7 @@ public virtual async Task SaveChanges_transaction_behavior_always_fails_for_mult
Assert.Equal(0, customersCount);
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/294
// Triggers are not supported in the Linux emulator
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
public virtual async Task SaveChanges_transaction_behavior_always_succeeds_for_single_entity_with_trigger()
{
Expand Down Expand Up @@ -233,8 +230,7 @@ public virtual async Task SaveChanges_transaction_behavior_always_succeeds_for_s
Assert.Equal(1, customersCount);
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/292 (Transactional batch limits not enforced)
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
[Fact]
public virtual async Task SaveChanges_transaction_behavior_always_fails_for_single_entity_with_trigger_and_entity_without_trigger()
{
using var context = Fixture.CreateContext();
Expand Down Expand Up @@ -284,7 +280,6 @@ public virtual async Task SaveChanges_entity_too_large_throws()
Assert.Equal(0, customersCount);
}


[Fact]
public virtual async Task SaveChanges_too_large_entry_after_smaller_throws_after_saving_smaller()
{
Expand Down Expand Up @@ -366,7 +361,7 @@ public virtual async Task SaveChanges_exactly_2_mib_does_not_split_and_one_byte_
private const int MaxSpecialCharsInId = MaxKeySize / 3;

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/323
[ConditionalTheory(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator)), InlineData(true), InlineData(false)]
[Theory, InlineData(true), InlineData(false)]
public virtual async Task SaveChanges_update_id_contains_special_chars_which_makes_request_larger_than_2_mib_splits_into_2_batches(bool isIdSpecialChar)
{
using var context = Fixture.CreateContext();
Expand Down
4 changes: 1 addition & 3 deletions test/EFCore.Cosmos.FunctionalTests/EndToEndCosmosTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ namespace Microsoft.EntityFrameworkCore;

public class EndToEndCosmosTest(NonSharedFixture fixture) : NonSharedModelTestBase(fixture), IClassFixture<NonSharedFixture>
{

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/292 (Transactional batch limits not enforced)
[ConditionalTheory(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
[Theory]
[InlineData(false)]
[InlineData(true)]
public async Task Can_add_update_delete_end_to_end(bool transactionalBatch)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ FROM root c
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Where()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand Down Expand Up @@ -197,7 +197,7 @@ public override Task GroupBy()

#endregion GroupBy

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Select_within_Select_within_Select_with_aggregates()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ FROM root c
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Select_Sum()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ FROM root c
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Where()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand Down Expand Up @@ -164,7 +164,7 @@ public override Task GroupBy()

#endregion GroupBy

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Select_within_Select_within_Select_with_aggregates()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ FROM root c
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Select_Sum()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ public override Task Indexer_property_is_pushdown_into_subquery(bool async)
() => base.Indexer_property_is_pushdown_into_subquery(async),
CosmosStrings.NonCorrelatedSubqueriesNotSupported);

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override Task Can_query_indexer_property_on_owned_collection(bool async)
=> CosmosTestHelpers.Instance.NoSyncTest(
async, async a =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ FROM root c
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Inline_collection_Count_with_zero_values()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand All @@ -73,7 +73,7 @@ FROM a IN (SELECT VALUE [])
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Inline_collection_Count_with_one_value()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand All @@ -91,7 +91,7 @@ FROM a IN (SELECT VALUE [2])
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Inline_collection_Count_with_two_values()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand All @@ -109,7 +109,7 @@ FROM a IN (SELECT VALUE [2, 999])
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Inline_collection_Count_with_three_values()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand Down Expand Up @@ -251,7 +251,7 @@ FROM root c
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Inline_collection_Min_with_two_values()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand All @@ -268,7 +268,7 @@ FROM a IN (SELECT VALUE [30, c["Int"]])) = 30)
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Inline_collection_List_Min_with_two_values()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand All @@ -285,7 +285,7 @@ FROM a IN (SELECT VALUE [30, c["Int"]])) = 30)
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Inline_collection_Max_with_two_values()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand All @@ -302,7 +302,7 @@ FROM a IN (SELECT VALUE [30, c["Int"]])) = 30)
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Inline_collection_List_Max_with_two_values()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand All @@ -319,7 +319,7 @@ FROM a IN (SELECT VALUE [30, c["Int"]])) = 30)
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Inline_collection_Min_with_three_values()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand All @@ -338,7 +338,7 @@ FROM a IN (SELECT VALUE [30, c["Int"], @i])) = 25)
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Inline_collection_List_Min_with_three_values()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand All @@ -357,7 +357,7 @@ FROM a IN (SELECT VALUE [30, c["Int"], @i])) = 25)
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Inline_collection_Max_with_three_values()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand All @@ -376,7 +376,7 @@ FROM a IN (SELECT VALUE [30, c["Int"], @i])) = 35)
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Inline_collection_List_Max_with_three_values()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand All @@ -395,7 +395,7 @@ FROM a IN (SELECT VALUE [30, c["Int"], @i])) = 35)
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Inline_collection_of_nullable_value_type_Min()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand All @@ -414,7 +414,7 @@ FROM a IN (SELECT VALUE [30, c["Int"], @i])) = 25)
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Inline_collection_of_nullable_value_type_Max()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand Down Expand Up @@ -452,7 +452,7 @@ FROM a IN (SELECT VALUE [30, c["NullableInt"], @i])) = 30)
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Inline_collection_of_nullable_value_type_with_null_Max()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand Down Expand Up @@ -481,7 +481,7 @@ public override async Task Inline_collection_with_single_parameter_element_Conta
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Inline_collection_with_single_parameter_element_Count()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand Down Expand Up @@ -529,7 +529,7 @@ WHERE ARRAY_CONTAINS(@Select, c["NullableString"])
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Inline_collection_Count_with_column_predicate_with_EF_Parameter()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand All @@ -549,7 +549,7 @@ FROM p IN (SELECT VALUE @p)
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Inline_collection_in_query_filter()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand All @@ -572,7 +572,7 @@ public override async Task Inline_collection_SelectMany_with_unreferenced_collec
=> await Assert.ThrowsAsync<InvalidOperationException>(
() => base.Inline_collection_SelectMany_with_unreferenced_collection_value());

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Parameter_collection_Count()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand Down Expand Up @@ -1322,7 +1322,7 @@ FROM root c
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Column_collection_Count_with_predicate()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand All @@ -1340,7 +1340,7 @@ FROM i IN c["Ints"]
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Column_collection_Where_Count()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand Down Expand Up @@ -2317,7 +2317,7 @@ FROM root c
""");
}

// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/330 (Aggregates over subqueries return null result set)
public override async Task Values_of_enum_casted_to_underlying_value()
{
CosmosTestEnvironment.SkipOnLinuxEmulator();
Expand Down
Loading
Loading