Skip to content

Skip sync tests in Cosmos#33860

Closed
roji wants to merge 1 commit intodotnet:mainfrom
roji:CosmosSyncTest
Closed

Skip sync tests in Cosmos#33860
roji wants to merge 1 commit intodotnet:mainfrom
roji:CosmosSyncTest

Conversation

@roji
Copy link
Copy Markdown
Member

@roji roji commented May 31, 2024

Re-push of #33756

#33386 removed sync I/O support from Cosmos; the approach for the tests was to override e.g. all query tests, and introduce a special "NoSyncTest" wrapper to catch the special exception thrown when the test runs in the sync variant, and introduces is (async) checks in many tests. This forces us to deal with the sync case in each and every test.

This draft PR proposes to instead handle this via a simple [SkipSyncTests] attribute, which is used at the assembly level; if the test method being executed has a bool async parameter, and that parameter has a false argument, the test is skipped. We can then add a few targeted tests for the sync case which check that the appropriate exception is thrown.

@roji roji closed this May 31, 2024
@roji roji deleted the CosmosSyncTest branch June 13, 2025 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant