-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests(mongo-db): move integration to direct sink generation (#138)
* feat(exception): add option to render in provider as string * feat(ui): implement new exception management * tests(ui): useException, review implementation * tests: new BE option * bump versions * tests(mongodb): use real sink to generate logs * feat(log-model): new Id property, map for mssql, mysql, mongo and raven * feat(elastic): map Id onto hits id * bump packages * bump nugets * Revert "feat(log-model): new Id property, map for mssql, mysql, mongo and raven" This reverts commit d2c2378. * Revert "feat(elastic): map Id onto hits id" This reverts commit 50e6fff.
- Loading branch information
1 parent
e7ae2eb
commit ef9b076
Showing
13 changed files
with
107 additions
and
191 deletions.
There are no files selected for viewing
This file contains 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 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 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 was deleted.
Oops, something went wrong.
This file contains 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 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
39 changes: 0 additions & 39 deletions
39
tests/Serilog.Ui.Common.Tests/DataSamples/MongoDbLogModelFaker.cs
This file was deleted.
Oops, something went wrong.
36 changes: 2 additions & 34 deletions
36
tests/Serilog.Ui.MongoDbProvider.Tests/DataProvider/DataProviderSearchTest.cs
This file contains 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 |
---|---|---|
@@ -1,43 +1,11 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using FluentAssertions; | ||
using Microsoft.Extensions.Primitives; | ||
using MongoDb.Tests.Util; | ||
using MongoDb.Tests.Util; | ||
using Serilog.Ui.Common.Tests.TestSuites.Impl; | ||
using Serilog.Ui.Core.Models; | ||
using Serilog.Ui.MongoDbProvider; | ||
using Xunit; | ||
|
||
namespace MongoDb.Tests.DataProvider | ||
{ | ||
[Collection(nameof(MongoDbDataProvider))] | ||
[Trait("Integration-Search", "MongoDb")] | ||
public class DataProviderSearchTest(BaseIntegrationTest instance) : IntegrationSearchTests<BaseIntegrationTest>(instance) | ||
{ | ||
public override async Task It_finds_only_data_emitted_in_dates_range() | ||
{ | ||
var firstTimeStamp = LogCollector.TimesSamples.First().AddSeconds(50); | ||
var lastTimeStamp = LogCollector.TimesSamples.Last().AddSeconds(50); | ||
var inTimeStampCount = LogCollector.DataSet | ||
.Count(p => p.Timestamp >= firstTimeStamp && p.Timestamp < lastTimeStamp); | ||
var query = new Dictionary<string, StringValues> | ||
{ | ||
["page"] = "1", | ||
["count"] = "1000", | ||
["startDate"] = firstTimeStamp.ToString("O"), | ||
["endDate"] = lastTimeStamp.ToString("O") | ||
}; | ||
|
||
var (logs, count) = await Provider.FetchDataAsync(FetchLogsQuery.ParseQuery(query)); | ||
|
||
var enumerateLogs = logs.ToList(); | ||
enumerateLogs.Should().NotBeEmpty(); | ||
enumerateLogs.Should().HaveCount(inTimeStampCount); | ||
count.Should().Be(inTimeStampCount); | ||
enumerateLogs.Should().OnlyContain(p => | ||
p.Timestamp.ToUniversalTime() >= firstTimeStamp && | ||
p.Timestamp.ToUniversalTime() < lastTimeStamp); | ||
} | ||
} | ||
public class DataProviderSearchTest(BaseIntegrationTest instance) : IntegrationSearchTests<BaseIntegrationTest>(instance); | ||
} |
This file contains 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 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.