Skip to content

Commit ba46d8f

Browse files
maca88hazzik
authored andcommitted
Upgrade AsyncGenerator to 0.14.0
1 parent 21975f6 commit ba46d8f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+112
-2409
lines changed

Tools/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.6.0" targetFramework="net461" />
88
<package id="NUnit.Extension.TeamCityEventListener" version="1.0.2" targetFramework="net461" />
99
<package id="NUnit.Extension.VSProjectLoader" version="3.6.0" targetFramework="net461" />
10-
<package id="CSharpAsyncGenerator.CommandLine" version="0.13.3" targetFramework="net461" />
10+
<package id="CSharpAsyncGenerator.CommandLine" version="0.14.0" targetFramework="net461" />
1111
<package id="vswhere" version="2.1.4" targetFramework="net461" />
1212
<package id="gitreleasemanager" version="0.7.0" targetFramework="net461" />
1313
</packages>

src/AsyncGenerator.yml

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -181,30 +181,10 @@
181181
methodConversion:
182182
- conversion: Copy
183183
name: AfterTransactionCompletionProcess_EvictsFromCache
184-
- conversion: Copy
185-
hasAttributeName: OneTimeSetUpAttribute
186-
- conversion: Copy
187-
hasAttributeName: OneTimeTearDownAttribute
188-
- conversion: Copy
189-
hasAttributeName: SetUpAttribute
190-
- conversion: Copy
191-
hasAttributeName: TearDownAttribute
192-
- conversion: Smart
193-
hasAttributeName: TestAttribute
194-
- conversion: Smart
195-
hasAttributeName: TheoryAttribute
196184
asyncExtensionMethods:
197185
projectFiles:
198186
- fileName: LinqExtensionMethods.cs
199187
projectName: NHibernate
200-
preserveReturnType:
201-
- hasAttributeName: TestAttribute
202-
- hasAttributeName: TheoryAttribute
203-
alwaysAwait:
204-
- hasAttributeName: TestAttribute
205-
- hasAttributeName: TheoryAttribute
206-
- hasAttributeName: SetUpAttribute
207-
- hasAttributeName: TearDownAttribute
208188
typeConversion:
209189
- conversion: Ignore
210190
name: ObjectAssert
@@ -214,32 +194,24 @@
214194
name: MultiThreadRunner
215195
- conversion: Ignore
216196
name: PeVerifier
217-
- conversion: Ignore
218-
hasAttributeName: IgnoreAttribute
219-
- conversion: NewType
220-
hasAttributeName: TestFixtureAttribute
221-
- conversion: NewType
222-
anyBaseTypeRule: HasTestFixtureAttribute
223197
- conversion: Ignore
224198
rule: IsTestCase
225199
- conversion: Ignore
226200
anyBaseTypeRule: IsTestCase
227-
ignoreSearchForMethodReferences:
228-
- hasAttributeName: TheoryAttribute
229-
- hasAttributeName: TestAttribute
230201
ignoreDocuments:
231202
- filePathEndsWith: Linq/MathTests.cs
232203
- filePathEndsWith: Linq/ExpressionSessionLeakTest.cs
233204
- filePathEndsWith: Linq/NorthwindDbCreator.cs
234205
cancellationTokens:
235-
withoutCancellationToken:
236-
- hasAttributeName: TestAttribute
237-
- hasAttributeName: TheoryAttribute
206+
enabled: true
238207
scanMethodBody: true
239208
scanForMissingAsyncMembers:
240209
- all: true
241210
registerPlugin:
242-
- type: AsyncGenerator.Core.Plugins.NUnitAsyncCounterpartsFinder
211+
- type: AsyncGenerator.Core.Plugins.NUnitPlugin
212+
parameters:
213+
- name: createNewTypes
214+
value: true
243215
assemblyName: AsyncGenerator.Core
244216
- type: AsyncGenerator.Core.Plugins.TransactionScopeAsyncFlowAdder
245217
assemblyName: AsyncGenerator.Core
@@ -302,6 +274,3 @@ typeRules:
302274
- filters:
303275
- name: TestCase
304276
name: IsTestCase
305-
- filters:
306-
- hasAttributeName: TestFixtureAttribute
307-
name: HasTestFixtureAttribute

src/NHibernate.Test/Async/Ado/BatcherFixture.cs

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -102,44 +102,7 @@ public async Task OneRoundTripUpdateAsync()
102102
await (CleanupAsync());
103103
}
104104

105-
#if NETFX
106-
[Test, Ignore("Not fixed yet.")]
107-
[Description("SqlClient: The batcher should run all different INSERT queries in only one roundtrip.")]
108-
public async Task SqlClientOneRoundTripForUpdateAndInsertAsync()
109-
{
110-
if (Sfi.Settings.BatcherFactory is SqlClientBatchingBatcherFactory == false)
111-
Assert.Ignore("This test is for SqlClientBatchingBatcher only");
112-
113-
await (FillDbAsync());
114-
115-
using (var sqlLog = new SqlLogSpy())
116-
using (ISession s = Sfi.OpenSession())
117-
using (ITransaction tx = s.BeginTransaction())
118-
{
119-
await (s.SaveAsync(new VerySimple
120-
{
121-
Name = "test441",
122-
Weight = 894
123-
}));
124-
125-
await (s.SaveAsync(new AlmostSimple
126-
{
127-
Name = "test441",
128-
Weight = 894
129-
}));
130-
131-
await (tx.CommitAsync());
132-
133-
var log = sqlLog.GetWholeLog();
134-
//log should only contain NHibernate.SQL once, because that means
135-
//that we ony generated a single batch (NHibernate.SQL log will output
136-
//once per batch)
137-
Assert.AreEqual(0, log.IndexOf("NHibernate.SQL"), "log should start with NHibernate.SQL");
138-
Assert.AreEqual(-1, log.IndexOf("NHibernate.SQL", "NHibernate.SQL".Length), "NHibernate.SQL should only appear once in the log");
139-
}
140-
141-
await (CleanupAsync());
142-
}
105+
#if NETFX
143106

144107
[Test]
145108
[Description("SqlClient: The batcher log output should be formatted")]

src/NHibernate.Test/Async/CacheTest/BatchableCacheFixture.cs

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -866,14 +866,14 @@ public async Task QueryCacheTestAsync()
866866

867867
[TestCase(true)]
868868
[TestCase(false)]
869-
public async Task QueryEntityBatchCacheTestAsync(bool clearEntityCacheAfterQuery, CancellationToken cancellationToken = default(CancellationToken))
869+
public async Task QueryEntityBatchCacheTestAsync(bool clearEntityCacheAfterQuery)
870870
{
871871
var persister = Sfi.GetEntityPersister(typeof(ReadOnlyItem).FullName);
872872
var cache = (BatchableCache) persister.Cache.Cache;
873873
var queryCache = GetDefaultQueryCache();
874874

875875
Sfi.Statistics.Clear();
876-
await (Sfi.EvictQueriesAsync(cancellationToken));
876+
await (Sfi.EvictQueriesAsync());
877877
cache.ClearStatistics();
878878
queryCache.ClearStatistics();
879879

@@ -884,9 +884,9 @@ public async Task QueryCacheTestAsync()
884884
{
885885
items = await (s.Query<ReadOnlyItem>()
886886
.WithOptions(o => o.SetCacheable(true))
887-
.ToListAsync(cancellationToken));
887+
.ToListAsync());
888888

889-
await (tx.CommitAsync(cancellationToken));
889+
await (tx.CommitAsync());
890890
}
891891

892892
Assert.That(queryCache.GetCalls, Has.Count.EqualTo(1), "Unexpected query cache GetCalls");
@@ -903,7 +903,7 @@ public async Task QueryCacheTestAsync()
903903

904904
if (clearEntityCacheAfterQuery)
905905
{
906-
await (cache.ClearAsync(cancellationToken));
906+
await (cache.ClearAsync(CancellationToken.None));
907907
}
908908

909909
Sfi.Statistics.Clear();
@@ -913,9 +913,9 @@ public async Task QueryCacheTestAsync()
913913
{
914914
items = await (s.Query<ReadOnlyItem>()
915915
.WithOptions(o => o.SetCacheable(true))
916-
.ToListAsync(cancellationToken));
916+
.ToListAsync());
917917

918-
await (tx.CommitAsync(cancellationToken));
918+
await (tx.CommitAsync());
919919
}
920920

921921
Assert.That(queryCache.GetCalls, Has.Count.EqualTo(1), "Unexpected query cache GetCalls");
@@ -935,7 +935,7 @@ public async Task QueryCacheTestAsync()
935935
[TestCase(false, false)]
936936
[TestCase(true, true)]
937937
[TestCase(false, true)]
938-
public async Task QueryFetchCollectionBatchCacheTestAsync(bool clearEntityCacheAfterQuery, bool future, CancellationToken cancellationToken = default(CancellationToken))
938+
public async Task QueryFetchCollectionBatchCacheTestAsync(bool clearEntityCacheAfterQuery, bool future)
939939
{
940940
if (future && !Sfi.ConnectionProvider.Driver.SupportsMultipleQueries)
941941
{
@@ -954,19 +954,19 @@ public async Task QueryCacheTestAsync()
954954

955955
using (var s = OpenSession())
956956
{
957-
var ids = await (s.Query<ReadOnly>().Select(o => o.Id).OrderBy(o => o).ToListAsync(cancellationToken));
957+
var ids = await (s.Query<ReadOnly>().Select(o => o.Id).OrderBy(o => o).ToListAsync());
958958
middleId = ids[2];
959959
}
960960

961961
Sfi.Statistics.Clear();
962-
await (Sfi.EvictQueriesAsync(cancellationToken));
962+
await (Sfi.EvictQueriesAsync());
963963
queryCache.ClearStatistics();
964964
cache.ClearStatistics();
965-
await (cache.ClearAsync(cancellationToken));
965+
await (cache.ClearAsync(CancellationToken.None));
966966
itemCache.ClearStatistics();
967-
await (itemCache.ClearAsync(cancellationToken));
967+
await (itemCache.ClearAsync(CancellationToken.None));
968968
collectionCache.ClearStatistics();
969-
await (collectionCache.ClearAsync(cancellationToken));
969+
await (collectionCache.ClearAsync(CancellationToken.None));
970970

971971
List<ReadOnly> items;
972972
using (var s = OpenSession())
@@ -992,10 +992,10 @@ public async Task QueryCacheTestAsync()
992992
items = await (s.Query<ReadOnly>()
993993
.WithOptions(o => o.SetCacheable(true))
994994
.FetchMany(o => o.Items)
995-
.ToListAsync(cancellationToken));
995+
.ToListAsync());
996996
}
997997

998-
await (tx.CommitAsync(cancellationToken));
998+
await (tx.CommitAsync());
999999
}
10001000

10011001
Assert.That(queryCache.GetCalls, Has.Count.EqualTo(future ? 0 : 1), "Unexpected query cache GetCalls");
@@ -1018,9 +1018,9 @@ public async Task QueryCacheTestAsync()
10181018

10191019
if (clearEntityCacheAfterQuery)
10201020
{
1021-
await (cache.ClearAsync(cancellationToken));
1022-
await (collectionCache.ClearAsync(cancellationToken));
1023-
await (itemCache.ClearAsync(cancellationToken));
1021+
await (cache.ClearAsync(CancellationToken.None));
1022+
await (collectionCache.ClearAsync(CancellationToken.None));
1023+
await (itemCache.ClearAsync(CancellationToken.None));
10241024
}
10251025

10261026
Sfi.Statistics.Clear();
@@ -1048,10 +1048,10 @@ public async Task QueryCacheTestAsync()
10481048
items = await (s.Query<ReadOnly>()
10491049
.WithOptions(o => o.SetCacheable(true))
10501050
.FetchMany(o => o.Items)
1051-
.ToListAsync(cancellationToken));
1051+
.ToListAsync());
10521052
}
10531053

1054-
await (tx.CommitAsync(cancellationToken));
1054+
await (tx.CommitAsync());
10551055
}
10561056

10571057
Assert.That(queryCache.GetCalls, Has.Count.EqualTo(future ? 0 : 1), "Unexpected query cache GetCalls");
@@ -1080,7 +1080,7 @@ public async Task QueryCacheTestAsync()
10801080
[TestCase(false, false)]
10811081
[TestCase(true, true)]
10821082
[TestCase(false, true)]
1083-
public async Task QueryFetchEntityBatchCacheTestAsync(bool clearEntityCacheAfterQuery, bool future, CancellationToken cancellationToken = default(CancellationToken))
1083+
public async Task QueryFetchEntityBatchCacheTestAsync(bool clearEntityCacheAfterQuery, bool future)
10841084
{
10851085
if (future && !Sfi.ConnectionProvider.Driver.SupportsMultipleQueries)
10861086
{
@@ -1097,17 +1097,17 @@ public async Task QueryCacheTestAsync()
10971097

10981098
using (var s = OpenSession())
10991099
{
1100-
var ids = await (s.Query<ReadOnlyItem>().Select(o => o.Id).OrderBy(o => o).ToListAsync(cancellationToken));
1100+
var ids = await (s.Query<ReadOnlyItem>().Select(o => o.Id).OrderBy(o => o).ToListAsync());
11011101
middleId = ids[17];
11021102
}
11031103

11041104
Sfi.Statistics.Clear();
1105-
await (Sfi.EvictQueriesAsync(cancellationToken));
1105+
await (Sfi.EvictQueriesAsync());
11061106
queryCache.ClearStatistics();
11071107
cache.ClearStatistics();
1108-
await (cache.ClearAsync(cancellationToken));
1108+
await (cache.ClearAsync(CancellationToken.None));
11091109
parentCache.ClearStatistics();
1110-
await (parentCache.ClearAsync(cancellationToken));
1110+
await (parentCache.ClearAsync(CancellationToken.None));
11111111

11121112
List<ReadOnlyItem> items;
11131113
using (var s = OpenSession())
@@ -1133,10 +1133,10 @@ public async Task QueryCacheTestAsync()
11331133
items = await (s.Query<ReadOnlyItem>()
11341134
.WithOptions(o => o.SetCacheable(true))
11351135
.Fetch(o => o.Parent)
1136-
.ToListAsync(cancellationToken));
1136+
.ToListAsync());
11371137
}
11381138

1139-
await (tx.CommitAsync(cancellationToken));
1139+
await (tx.CommitAsync());
11401140
}
11411141

11421142
Assert.That(queryCache.GetCalls, Has.Count.EqualTo(future ? 0 : 1), "Unexpected query cache GetCalls");
@@ -1158,8 +1158,8 @@ public async Task QueryCacheTestAsync()
11581158

11591159
if (clearEntityCacheAfterQuery)
11601160
{
1161-
await (cache.ClearAsync(cancellationToken));
1162-
await (parentCache.ClearAsync(cancellationToken));
1161+
await (cache.ClearAsync(CancellationToken.None));
1162+
await (parentCache.ClearAsync(CancellationToken.None));
11631163
}
11641164

11651165
Sfi.Statistics.Clear();
@@ -1187,10 +1187,10 @@ public async Task QueryCacheTestAsync()
11871187
items = await (s.Query<ReadOnlyItem>()
11881188
.WithOptions(o => o.SetCacheable(true))
11891189
.Fetch(o => o.Parent)
1190-
.ToListAsync(cancellationToken));
1190+
.ToListAsync());
11911191
}
11921192

1193-
await (tx.CommitAsync(cancellationToken));
1193+
await (tx.CommitAsync());
11941194
}
11951195

11961196
Assert.That(queryCache.GetCalls, Has.Count.EqualTo(future ? 0 : 1), "Unexpected query cache GetCalls");

0 commit comments

Comments
 (0)