-
Notifications
You must be signed in to change notification settings - Fork 3
Expand Cosmos Emulator tests and harden read extension validation #18
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
Draft
Copilot
wants to merge
34
commits into
main
Choose a base branch
from
copilot/add-integration-tests-cosmos-emulator-again
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
c327a5d
Initial plan
Copilot d921eca
Add Cosmos emulator integration test infrastructure and scenario plan
Copilot 527ea36
Refine Cosmos test infrastructure and planned scenario list
Copilot f98ebe5
Remove DB name normalization and format integration files
Copilot 67c9905
Use TestContext-based database identifier for integration tests
Copilot 44baaef
Harden test data hash conversion for database identifier
Copilot e177988
Add integration tests for create/read/upsert/replace/patch/delete/rea…
Copilot 7d70871
Address integration test review feedback in patch scenario
Copilot 660a0cc
Add CosmosAssert helper and simplify integration test assertions
Copilot 771f88d
Refine CosmosAssert failure handling consistency
Copilot f9d3251
Plan split operation tests into separate files with AndRead coverage
Copilot 6d5d59f
Split operation integration tests into per-operation files with AndRe…
Copilot 4a47672
Adjust shared operation test fixture visibility
Copilot 0bf340c
Remove class-scope literal from operation test infrastructure
Copilot 03795eb
Rename test methods add read extension coverage and builder tests
Copilot 31d54c0
Add Assert extensions and align test namespaces
Copilot d63fbff
Fix Assert extension signatures and keep test helper usage
Copilot 60e97b6
fixup! Split operation integration tests into per-operation files wit…
xperiandri e1305d3
Delete IntegrationTestPlan file per PR feedback
Copilot 5d79634
Apply suggestions from code review
xperiandri f62634d
fixup! ci(cosmos): use separate common action to check Azure Cosmos E…
xperiandri cd491da
Fix failing Cosmos emulator tests
Copilot d53c998
Handle undefined deleted marker in IsNotDeletedAsync
Copilot 829a053
Validate deleted field name in IsNotDeletedAsync query
Copilot a06c43a
Harden IsNotDeletedAsync field-name validation
Copilot 5db799c
Address review feedback for nullArg, test categories, and scenario se…
Copilot 842d5ed
Apply validation feedback ordering in IntegrationTestBase
Copilot bde1f0d
Simplify async exception test delegate in read extensions tests
Copilot 7badc2f
fix `ReadExtensionsIntegrationTests` name
xperiandri 69776da
Refine IsNotDeletedAsync docs and validation coverage
Copilot 1a73340
Address follow-up review notes for IsNotDeletedAsync
Copilot b9c6eae
Tidy read extensions test variable naming
Copilot 985d3f9
Expand deleted-field validation coverage in read extension tests
Copilot e19cf82
Changes before error encountered
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| namespace FSharp.Azure.Cosmos.Tests | ||
|
|
||
| open System.Runtime.InteropServices | ||
| open Microsoft.VisualStudio.TestTools.UnitTesting | ||
|
|
||
| [<AutoOpen>] | ||
| module AssertExtensions = | ||
|
|
||
| type Assert with | ||
|
|
||
| static member WantSome (value, [<Optional>] message : string | null) = | ||
| match value with | ||
| | Some some -> some | ||
| | None -> | ||
| Assert.Fail (message) | ||
| Unchecked.defaultof<_> | ||
|
|
||
| static member IsSome (value, [<Optional>] message : string | null) = Assert.WantSome (value, message) |> ignore | ||
|
|
||
| static member IsNone (value, [<Optional>] message : string | null) = | ||
| match value with | ||
| | Some _ -> Assert.Fail (message) | ||
| | None -> () | ||
|
|
||
| static member WantValueSome (value, [<Optional>] message : string | null) = | ||
| match value with | ||
| | ValueSome some -> some | ||
| | ValueNone -> | ||
| Assert.Fail (message) | ||
| Unchecked.defaultof<_> | ||
|
|
||
| static member IsValueSome (value, [<Optional>] message : string | null) = Assert.WantValueSome (value, message) |> ignore | ||
|
|
||
| static member IsValueNone (value, [<Optional>] message : string | null) = | ||
| match value with | ||
| | ValueSome _ -> Assert.Fail (message) | ||
| | ValueNone -> () | ||
|
|
||
| static member WantOk (value, [<Optional>] message : string | null) = | ||
| match value with | ||
| | Ok ok -> ok | ||
| | Error error -> | ||
| match message with | ||
| | null -> Assert.Fail (string error) | ||
| | message -> Assert.Fail ($"'{message}': {error}") | ||
| Unchecked.defaultof<_> | ||
|
|
||
| static member IsOk (value, [<Optional>] message : string | null) = Assert.WantOk (value, message) |> ignore | ||
|
|
||
| static member WantError (value, [<Optional>] message : string | null) = | ||
| match value with | ||
| | Error error -> error | ||
| | Ok value -> | ||
| match message with | ||
| | null -> Assert.Fail (string value) | ||
| | message -> Assert.Fail ($"'{message}': {value}") | ||
| Unchecked.defaultof<_> | ||
|
|
||
| static member IsError (value, [<Optional>] message : string | null) = Assert.WantError (value, message) |> ignore | ||
|
|
||
| static member inline IsDefaultOf< ^T> (value : ^T, [<Optional>] message : string) = | ||
| Assert.AreEqual (box value, box Unchecked.defaultof< ^T>, message) | ||
|
|
||
| static member inline OkEquals< ^R, 'E> (expected : ^R, actual : Result< ^R, 'E >, [<Optional>] message : string | null) = | ||
| Assert.AreEqual (box expected, box (Assert.WantOk (actual, message)), message) | ||
|
|
||
| static member inline ErrorEquals<'R, ^E> (expected : ^E, actual : Result<'R, ^E>, [<Optional>] message : string | null) = | ||
| Assert.AreEqual (box expected, box (Assert.WantError (actual, message)), message) | ||
|
|
||
| static member FailWithData<'T> ([<Optional>] message : string | null) = | ||
| Assert.Fail (message) | ||
| Unchecked.defaultof<'T> |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.