From 5eca42e74f811143026108965f39c14d19a06cd5 Mon Sep 17 00:00:00 2001 From: mbdavid Date: Mon, 19 Feb 2024 12:58:38 -0300 Subject: [PATCH] add N limit count --- .travis.yml | 23 ---------------------- LiteDB.Tests/Engine/Rebuild_Crash_Tests.cs | 10 ++++++---- LiteDB.Tests/LiteDB.Tests.csproj | 6 ++++++ LiteDB.Tests/xunit.runner.json | 4 ++++ README.md | 2 +- 5 files changed, 17 insertions(+), 28 deletions(-) delete mode 100644 .travis.yml create mode 100644 LiteDB.Tests/xunit.runner.json diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 76a621cf3..000000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: csharp -mono: none -os: linux -dotnet: 3.1.101 - -jobs: - include: - - os: linux - dist: bionic - - os: osx - -env: - global: - - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - -script: - - dotnet restore ./LiteDB/LiteDB.csproj - - dotnet build ./LiteDB/LiteDB.csproj -f netstandard2.0 - - dotnet test ./LiteDB.Tests/LiteDB.Tests.csproj --logger:console --verbosity=minimal - -notifications: - email: false diff --git a/LiteDB.Tests/Engine/Rebuild_Crash_Tests.cs b/LiteDB.Tests/Engine/Rebuild_Crash_Tests.cs index f8ca0289e..7bce95d7a 100644 --- a/LiteDB.Tests/Engine/Rebuild_Crash_Tests.cs +++ b/LiteDB.Tests/Engine/Rebuild_Crash_Tests.cs @@ -15,6 +15,8 @@ public class Rebuild_Crash_Tests [Fact] public void Rebuild_Crash_IO_Write_Error() { + var N = 1_000; + using (var file = new TempFile()) { var settings = new EngineSettings @@ -24,7 +26,7 @@ public void Rebuild_Crash_IO_Write_Error() Password = "46jLz5QWd5fI3m4LiL2r" }; - var data = Enumerable.Range(1, 10_000).Select(i => new BsonDocument + var data = Enumerable.Range(1, N).Select(i => new BsonDocument { ["_id"] = i, ["name"] = Faker.Fullname(), @@ -41,7 +43,7 @@ public void Rebuild_Crash_IO_Write_Error() { var p = new BasePage(page); - if (p.PageID == 248) + if (p.PageID == 28) { p.ColID.Should().Be(1); p.PageType.Should().Be(PageType.Data); @@ -79,8 +81,8 @@ public void Rebuild_Crash_IO_Write_Error() var col2 = db.Query("col2", Query.All()).ToList().Count; var errors = db.Query("_rebuild_errors", Query.All()).ToList().Count; - col1.Should().Be(9_999); - col2.Should().Be(10_000); + col1.Should().Be(N - 1); + col2.Should().Be(N); errors.Should().Be(1); } diff --git a/LiteDB.Tests/LiteDB.Tests.csproj b/LiteDB.Tests/LiteDB.Tests.csproj index 6667200ba..b82a96b95 100644 --- a/LiteDB.Tests/LiteDB.Tests.csproj +++ b/LiteDB.Tests/LiteDB.Tests.csproj @@ -11,6 +11,12 @@ 1701;1702;1705;1591;0618 + + + PreserveNewest + + + diff --git a/LiteDB.Tests/xunit.runner.json b/LiteDB.Tests/xunit.runner.json new file mode 100644 index 000000000..015166b78 --- /dev/null +++ b/LiteDB.Tests/xunit.runner.json @@ -0,0 +1,4 @@ +{ + "parallelizeAssembly": false, + "parallelizeTestCollections": false +} \ No newline at end of file diff --git a/README.md b/README.md index fe5a04659..9ae1ac052 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # LiteDB - A .NET NoSQL Document Store in a single data file -[![Join the chat at https://gitter.im/mbdavid/LiteDB](https://badges.gitter.im/mbdavid/LiteDB.svg)](https://gitter.im/mbdavid/LiteDB?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build status](https://ci.appveyor.com/api/projects/status/sfe8he0vik18m033?svg=true)](https://ci.appveyor.com/project/mbdavid/litedb) [![Build Status](https://travis-ci.org/mbdavid/LiteDB.svg?branch=master)](https://travis-ci.org/mbdavid/LiteDB) +[![Build status](https://ci.appveyor.com/api/projects/status/sfe8he0vik18m033?svg=true)](https://ci.appveyor.com/project/mbdavid/litedb) ---