Expand Cosmos Emulator tests and harden read extension validation#18
Draft
Copilot wants to merge 33 commits into
Draft
Expand Cosmos Emulator tests and harden read extension validation#18Copilot wants to merge 33 commits into
Copilot wants to merge 33 commits into
Conversation
Copilot
AI
changed the title
[WIP] Add integration tests against Cosmos Emulator
Add Cosmos Emulator integration test foundation and scoped scenario plan
May 23, 2026
xperiandri
requested changes
May 23, 2026
Collaborator
xperiandri
left a comment
There was a problem hiding this comment.
Fix and format with Fantomas according to your instructions
xperiandri
reviewed
May 24, 2026
xperiandri
reviewed
May 24, 2026
Copilot
AI
changed the title
Add Cosmos Emulator integration test foundation and scoped scenario plan
Add Cosmos Emulator integration tests for core operations
May 24, 2026
xperiandri
reviewed
May 24, 2026
Copilot
AI
changed the title
Add Cosmos Emulator integration tests for core operations
Expand Cosmos Emulator tests for operations, read extensions, and builders
May 24, 2026
542f3fc to
d5b9617
Compare
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/727cc9a9-e850-45de-b65f-4e8eb8ff33fc Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/727cc9a9-e850-45de-b65f-4e8eb8ff33fc Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/727cc9a9-e850-45de-b65f-4e8eb8ff33fc Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
…ad coverage Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/727cc9a9-e850-45de-b65f-4e8eb8ff33fc Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/727cc9a9-e850-45de-b65f-4e8eb8ff33fc Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/727cc9a9-e850-45de-b65f-4e8eb8ff33fc Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/63ac5990-d78f-452f-9f2f-85e08fdbff91 Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/6f71a1f0-316c-4294-88a6-23f8995238fc Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/6f71a1f0-316c-4294-88a6-23f8995238fc Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
…h AndRead coverage
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/a905fb7f-9390-4144-84f7-22ff34a8fb8c Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Co-authored-by: Andrii Chebukin <XperiAndri@Outlook.com>
…mulator readiness
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/b2eda2fa-a0cb-4604-b8ca-51bd73075963 Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/b2eda2fa-a0cb-4604-b8ca-51bd73075963 Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/b2eda2fa-a0cb-4604-b8ca-51bd73075963 Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/b2eda2fa-a0cb-4604-b8ca-51bd73075963 Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
…eding Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/fb87fcd3-5c25-4e1f-ab2c-0f29ce614280 Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/fb87fcd3-5c25-4e1f-ab2c-0f29ce614280 Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/fb87fcd3-5c25-4e1f-ab2c-0f29ce614280 Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
2a78e83 to
bde1f0d
Compare
xperiandri
requested changes
May 24, 2026
| $"""SELECT VALUE COUNT(1) | ||
| FROM item | ||
| WHERE item.id = @Id | ||
| AND (NOT IS_DEFINED(item.{deletedFieldName}) OR IS_NULL(item.{deletedFieldName}))""" |
Collaborator
There was a problem hiding this comment.
@copilot так что с покрытием всех этих кейсов тестами?
Comment on lines
+218
to
+225
| (deletedFieldName : string | null) | ||
| (id : string, [<Optional>] requiestOptions : QueryRequestOptions, [<Optional>] cancellationToken : CancellationToken) | ||
| = | ||
| task { | ||
| let deletedFieldName = | ||
| match deletedFieldName with | ||
| | null -> nullArg (nameof deletedFieldName) | ||
| | deletedFieldName -> deletedFieldName |
Collaborator
There was a problem hiding this comment.
@copilot ты понимаешь что это идиотизм декларировать string | null а потом кидать исключение.
Suggested change
| (deletedFieldName : string | null) | |
| (id : string, [<Optional>] requiestOptions : QueryRequestOptions, [<Optional>] cancellationToken : CancellationToken) | |
| = | |
| task { | |
| let deletedFieldName = | |
| match deletedFieldName with | |
| | null -> nullArg (nameof deletedFieldName) | |
| | deletedFieldName -> deletedFieldName | |
| (deletedFieldName : string) | |
| (id : string, [<Optional>] requiestOptions : QueryRequestOptions, [<Optional>] cancellationToken : CancellationToken) | |
| = | |
| if deletedFieldName |> withNull |> isNull then | |
| nullArg (nameof deletedFieldName) | |
| task { |
Author
| @@ -215,15 +215,41 @@ module Operations = | |||
| /// <param name="partitionKey">Partition key</param> | |||
| /// <param name="cancellationToken">Cancellation token</param> | |||
| member container.IsNotDeletedAsync | |||
Collaborator
There was a problem hiding this comment.
@copilot <exception XML комментарии добавь на все методы где они вылетают
Author
There was a problem hiding this comment.
Добавил XML <exception> в 69776da для методов, где выбрасываются исключения: IsNotDeletedAsync, AddPreTriggers, AddPostTriggers.
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/7c652b6b-140a-42c5-9e86-a71d0a69c5ba Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/7c652b6b-140a-42c5-9e86-a71d0a69c5ba Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/7c652b6b-140a-42c5-9e86-a71d0a69c5ba Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Azure.Cosmos/sessions/7c652b6b-140a-42c5-9e86-a71d0a69c5ba Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR expands Cosmos Emulator integration coverage and incorporates review-driven fixes in both tests and read extension behavior.
Changes Made
DatabaseTestApplicationFactoryderivatives (SingleItemScenario,MultipleItemsScenario).IntegrationTestBase<'DatabaseTestApplicationFactory>/OperationTestBase<'DatabaseTestApplicationFactory>patterns.TestCategoriesconstants and applied explicitTestCategoryattributes across test classes.IsNotDeletedAsyncinCosmos.fs:deletedFieldNameto non-nullablestring,nullArgguard,requestOptionsparameter naming.<exception>documentation for methods that throw inCosmos.fs(IsNotDeletedAsync,AddPreTriggers,AddPostTriggers).IsNotDeletedAsyncresult as expected.Validation
dotnet build FSharp.Azure.Cosmos.slnxdotnet test FSharp.Azure.Cosmos.slnxdotnet test tests/Cosmos.Tests/FSharp.Azure.Cosmos.Tests.fsprojdotnet test tests/Cosmos.Tests/FSharp.Azure.Cosmos.Tests.fsproj --filter "FullyQualifiedName~ReadExtensionsIntegrationTests"