-
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
Open
Copilot
wants to merge
44
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.
Open
Changes from all commits
Commits
Show all changes
44 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 73a869f
Fix deleted-marker semantics, extract CosmosName validation, fix Asse…
xperiandri ed0eb69
Expand builder and negative-path test coverage (plan part B)
xperiandri 8561e28
test: probe push_files permission scope (no-op, will be reverted)
xperiandri 21d30c3
Fix NotModified mapping and Debug TaskSeq failure; address review com…
xperiandri 3ba5caa
Report conditional-read test as inconclusive when the endpoint ignore…
xperiandri e9c9c9d
devcontainer: start the Cosmos Emulator from initializeCommand; move …
xperiandri 8a9d0b5
ci(windows): fix Cosmos Emulator readiness check and don't fail the b…
xperiandri 3b65026
Implement AsAsyncEnumerable without taskSeq; revert always-on Optimize
xperiandri f7fea72
Link the upstream emulator issue from the inconclusive conditional-re…
xperiandri f37ff46
devcontainer: run the emulator initializeCommand with pwsh instead of…
xperiandri 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,52 @@ | ||
| #!/usr/bin/env pwsh | ||
| # Host-side devcontainer initializeCommand. | ||
| # | ||
| # On GitHub Actions, start the Cosmos DB Emulator container on the runner and wait until it is ready, | ||
| # so the dev container (which shares the host network) can run the integration tests against | ||
| # 127.0.0.1:8081. Local developers manage their own emulator, so outside GitHub Actions this is a no-op. | ||
| $ErrorActionPreference = 'Stop' | ||
| Set-StrictMode -Version Latest | ||
|
|
||
| if ($env:GITHUB_ACTIONS -ne 'true') { | ||
| exit 0 | ||
| } | ||
|
|
||
| $containerName = 'cosmosdb' | ||
|
|
||
| # The dev container CLI can run initializeCommand more than once, so only create the container once. | ||
| $existing = docker ps --all --filter "name=^$containerName$" --format '{{.Names}}' | ||
| if ($existing -contains $containerName) { | ||
| Write-Host 'Cosmos DB Emulator container already exists.' | ||
| docker start $containerName | Out-Null | ||
| } | ||
| else { | ||
| # Same settings as .github/scripts/linux/start-cosmos-emulator.sh, which the main Linux CI job uses. | ||
| docker run -d --name $containerName ` | ||
| -p 8081:8081 -p 8080:8080 -p 1234:1234 ` | ||
| -e PROTOCOL=https ` | ||
| mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview | Out-Null | ||
| } | ||
|
|
||
| if ($LASTEXITCODE -ne 0) { | ||
| throw "docker exited with code $LASTEXITCODE." | ||
| } | ||
|
|
||
| $maxAttempts = 120 | ||
| for ($attempt = 1; $attempt -le $maxAttempts; $attempt++) { | ||
| try { | ||
| $response = Invoke-WebRequest -Uri 'http://127.0.0.1:8080/ready' -SkipHttpErrorCheck -TimeoutSec 5 | ||
| if ($response.StatusCode -eq 200) { | ||
| Write-Host 'Cosmos DB Emulator is ready.' | ||
| exit 0 | ||
| } | ||
| } | ||
| catch { | ||
| # The readiness endpoint is not listening yet. | ||
| } | ||
|
|
||
| Write-Host "Cosmos DB Emulator is not ready yet (attempt $attempt/$maxAttempts)." | ||
| Start-Sleep -Seconds 5 | ||
| } | ||
|
|
||
| docker logs --tail 50 $containerName | ||
| throw 'Cosmos DB Emulator failed to become ready in time.' |
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
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
Oops, something went wrong.
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.