Skip to content
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

Making synchronous APIs obsolete and test suite clean up #3502

Merged
merged 5 commits into from
Oct 23, 2024
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/on-push-do-ci-build-pg15-jsonnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,4 @@ jobs:
- name: test-aspnet-core
if: ${{ success() || failure() }}
run: ./build.sh test-aspnet-core
shell: bash
shell: bash
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,4 @@ jobs:
- name: test-aspnet-core
if: ${{ success() || failure() }}
run: ./build.sh test-aspnet-core
shell: bash
shell: bash
207 changes: 0 additions & 207 deletions azure-pipelines.yml

This file was deleted.

2 changes: 1 addition & 1 deletion docs/configuration/multitenancy.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var store = DocumentStore.For(opts =>
opts.TenantIdStyle = TenantIdStyle.ForceUpperCase;
});
```
<sup><a href='https://github.com/JasperFx/marten/blob/master/src/Marten.Testing/Examples/MultiTenancy.cs#L13-L27' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_using_tenant_id_style' title='Start of snippet'>anchor</a></sup>
<sup><a href='https://github.com/JasperFx/marten/blob/master/src/Marten.Testing/Examples/MultiTenancy.cs#L14-L28' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_using_tenant_id_style' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

## Static Database to Tenant Mapping
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/storeoptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static DocumentStore For(Action<StoreOptions> configure)
return new DocumentStore(options);
}
```
<sup><a href='https://github.com/JasperFx/marten/blob/master/src/Marten/DocumentStore.cs#L520-L530' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_documentstore.for' title='Start of snippet'>anchor</a></sup>
<sup><a href='https://github.com/JasperFx/marten/blob/master/src/Marten/DocumentStore.cs#L525-L535' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_documentstore.for' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

The major parts of `StoreOptions` are shown in the class diagram below:
Expand Down
20 changes: 9 additions & 11 deletions docs/documents/concurrency.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class CoffeeShop: Shop
public ICollection<Guid> Employees { get; set; } = new List<Guid>();
}
```
<sup><a href='https://github.com/JasperFx/marten/blob/master/src/DocumentDbTests/Concurrency/optimistic_concurrency.cs#L833-L843' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_useoptimisticconcurrencyattribute' title='Start of snippet'>anchor</a></sup>
<sup><a href='https://github.com/JasperFx/marten/blob/master/src/DocumentDbTests/Concurrency/optimistic_concurrency.cs#L826-L836' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_useoptimisticconcurrencyattribute' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Or by using Marten's configuration API to do it programmatically:
Expand All @@ -62,13 +62,13 @@ To demonstrate the failure case, consider the following  acceptance test from M
<a id='snippet-sample_update_with_stale_version_standard'></a>
```cs
[Fact]
public void update_with_stale_version_standard()
public async Task update_with_stale_version_standard()
{
var doc1 = new CoffeeShop();
using (var session = theStore.LightweightSession())
{
session.Store(doc1);
session.SaveChanges();
await session.SaveChangesAsync();
}

var session1 = theStore.DirtyTrackedSession();
Expand All @@ -83,11 +83,11 @@ public void update_with_stale_version_standard()
session2Copy.Name = "Dominican Joe's";

// Should go through just fine
session2.SaveChanges();
await session2.SaveChangesAsync();

var ex = Exception<ConcurrencyException>.ShouldBeThrownBy(() =>
var ex = await Should.ThrowAsync<ConcurrencyException>(async () =>
{
session1.SaveChanges();
await session1.SaveChangesAsync();
});

ex.Message.ShouldBe($"Optimistic concurrency check failed for {typeof(Shop).FullName} #{doc1.Id}");
Expand All @@ -98,13 +98,11 @@ public void update_with_stale_version_standard()
session2.Dispose();
}

using (var query = theStore.QuerySession())
{
query.Load<CoffeeShop>(doc1.Id).Name.ShouldBe("Dominican Joe's");
}
await using var query = theStore.QuerySession();
query.Load<CoffeeShop>(doc1.Id).Name.ShouldBe("Dominican Joe's");
}
```
<sup><a href='https://github.com/JasperFx/marten/blob/master/src/DocumentDbTests/Concurrency/optimistic_concurrency.cs#L127-L171' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_update_with_stale_version_standard' title='Start of snippet'>anchor</a></sup>
<sup><a href='https://github.com/JasperFx/marten/blob/master/src/DocumentDbTests/Concurrency/optimistic_concurrency.cs#L127-L169' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_update_with_stale_version_standard' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Marten is throwing an `AggregateException` for the entire batch of changes.
Expand Down
Loading
Loading