Skip to content

Commit

Permalink
Stabilizing CoreTests in CI
Browse files Browse the repository at this point in the history
Trying to isolate another test

Trying to isolate another test

Trying to isolate a test

Trying to isolate a test

removing some tests from CI for troubleshooting

Trying to isolate a test

Trying to better isolate a unit test

trying to address a failing test on CI

Trying to isolate a test better

Trying to isolate a test that's unreliable a bit more

Added a missing await in a test

turning off all CI tests but Marten.Testing
  • Loading branch information
jeremydmiller committed Oct 22, 2024
1 parent 0f9da68 commit 847bcda
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 95 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/on-push-do-ci-build-pg12-plv8-systemtextjson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,26 +112,6 @@ jobs:
run: ./build.sh test-core
shell: bash

- name: test-document-db
if: ${{ success() || failure() }}
run: ./build.sh test-document-db
shell: bash

- name: test-event-sourcing
if: ${{ success() || failure() }}
run: ./build.sh test-event-sourcing
shell: bash

- name: test-cli
if: ${{ success() || failure() }}
run: ./build.sh test-cli
shell: bash

- name: test-linq
if: ${{ success() || failure() }}
run: ./build.sh test-linq
shell: bash

# - name: test-multi-tenancy
# if: ${{ success() || failure() }}
# run: ./build.sh test-multi-tenancy
Expand All @@ -142,11 +122,6 @@ jobs:
run: ./build.sh test-patching
shell: bash

- name: test-value-types
if: ${{ success() || failure() }}
run: ./build.sh test-value-types
shell: bash

- name: test-code-gen
if: ${{ success() || failure() }}
run: ./build.sh test-code-gen
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/on-push-do-ci-build-pg15-jsonnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,26 +105,6 @@ jobs:
run: ./build.sh test-core
shell: bash

- name: test-document-db
if: ${{ success() || failure() }}
run: ./build.sh test-document-db
shell: bash

- name: test-event-sourcing
if: ${{ success() || failure() }}
run: ./build.sh test-event-sourcing
shell: bash

- name: test-cli
if: ${{ success() || failure() }}
run: ./build.sh test-cli
shell: bash

- name: test-linq
if: ${{ success() || failure() }}
run: ./build.sh test-linq
shell: bash

# - name: test-multi-tenancy
# if: ${{ success() || failure() }}
# run: ./build.sh test-multi-tenancy
Expand All @@ -135,11 +115,6 @@ jobs:
run: ./build.sh test-patching
shell: bash

- name: test-value-types
if: ${{ success() || failure() }}
run: ./build.sh test-value-types
shell: bash

- name: test-code-gen
if: ${{ success() || failure() }}
run: ./build.sh test-code-gen
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/on-push-do-ci-build-pgLatest-systemtextjson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,26 +105,6 @@ jobs:
run: ./build.sh test-core
shell: bash

- name: test-document-db
if: ${{ success() || failure() }}
run: ./build.sh test-document-db
shell: bash

- name: test-event-sourcing
if: ${{ success() || failure() }}
run: ./build.sh test-event-sourcing
shell: bash

- name: test-cli
if: ${{ success() || failure() }}
run: ./build.sh test-cli
shell: bash

- name: test-linq
if: ${{ success() || failure() }}
run: ./build.sh test-linq
shell: bash

# - name: test-multi-tenancy
# if: ${{ success() || failure() }}
# run: ./build.sh test-multi-tenancy
Expand All @@ -135,11 +115,6 @@ jobs:
run: ./build.sh test-patching
shell: bash

- name: test-value-types
if: ${{ success() || failure() }}
run: ./build.sh test-value-types
shell: bash

- name: test-code-gen
if: ${{ success() || failure() }}
run: ./build.sh test-code-gen
Expand Down
5 changes: 5 additions & 0 deletions src/CoreTests/MartenServiceCollectionExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ public async Task apply_changes_on_startup()
// The normal Marten configuration
services.AddMarten(opts =>
{
// This helps isolate a test, not something you need to do
// in normal usage
opts.ApplyChangesLockId += 18;

opts.Connection(ConnectionSource.ConnectionString);
opts.RegisterDocumentType<User>();
})
Expand Down Expand Up @@ -186,6 +190,7 @@ public async Task assert_configuration_on_startup()
{
opts.Connection(ConnectionSource.ConnectionString);
opts.RegisterDocumentType<User>();
opts.DatabaseSchemaName = "startup";
})
.AssertDatabaseMatchesConfigurationOnStartup();
});
Expand Down
8 changes: 4 additions & 4 deletions src/CoreTests/create_database_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ public async Task can_use_existing_database_without_calling_into_create()
{
var user1 = new User { FirstName = "User" };
var dbCreated = false;
using var store = DocumentStore.For(_ =>
using var store = DocumentStore.For(opts =>
{
_.AutoCreateSchemaObjects = AutoCreate.All;
_.Connection(ConnectionSource.ConnectionString);
_.CreateDatabasesForTenants(c =>
opts.AutoCreateSchemaObjects = AutoCreate.All;
opts.Connection(ConnectionSource.ConnectionString);
opts.CreateDatabasesForTenants(c =>
{
c.MaintenanceDatabase(ConnectionSource.ConnectionString);
c.ForTenant()
Expand Down
10 changes: 5 additions & 5 deletions src/CoreTests/retry_mechanism.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@

namespace CoreTests;

public class retry_mechanism : IntegrationContext
public class retry_mechanism : OneOffConfigurationsContext
{
public retry_mechanism(DefaultStoreFixture fixture) : base(fixture)
{
}

[Fact]
public async Task can_successfully_retry()
{
StoreOptions(opts => opts.DatabaseSchemaName = "retries");

var sometimesFailingOperation1 = new SometimesFailingOperation();
theSession.QueueOperation(sometimesFailingOperation1);

Expand All @@ -35,6 +33,8 @@ public async Task can_successfully_retry()
[Fact]
public async Task can_successfully_retry_sync()
{
StoreOptions(opts => opts.DatabaseSchemaName = "retries");

var sometimesFailingOperation1 = new SometimesFailingOperation();
theSession.QueueOperation(sometimesFailingOperation1);

Expand Down
8 changes: 7 additions & 1 deletion src/CoreTests/using_multiple_document_stores_in_same_host.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,14 @@ public void all_the_defaults()
{
using var container = Container.For(services =>
{
services.AddMarten(ConnectionSource.ConnectionString);
services.AddMarten(opts =>
{
opts.Connection(ConnectionSource.ConnectionString);
});

services.AddMartenStore<IFirstStore>(opts =>
{
opts.ApplyChangesLockId += 17;
opts.Connection(ConnectionSource.ConnectionString);
opts.DatabaseSchemaName = "first_store";
});
Expand Down Expand Up @@ -370,8 +374,10 @@ public async Task apply_changes_on_startup()
x.AddLogging();
x.AddMartenStore<IFirstStore>(opts =>
{
opts.ApplyChangesLockId += 19;
opts.Connection(ConnectionSource.ConnectionString);
opts.RegisterDocumentType<User>();
opts.DatabaseSchemaName = "first_store";
})
.ApplyAllDatabaseChangesOnStartup();
});
Expand Down
6 changes: 1 addition & 5 deletions src/DocumentDbTests/Reading/query_plans.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@

namespace DocumentDbTests.Reading;

public class query_plans : IntegrationContext
public class query_plans : OneOffConfigurationsContext
{
public query_plans(DefaultStoreFixture fixture) : base(fixture)
{
}

[Fact]
public async Task query_by_query_plan()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,15 @@ public async Task query_string_array_intersects_array()
}

[Fact]
public void query_string_list_intersects_array()
public async Task query_string_list_intersects_array()
{
buildAuthorData();
await buildAuthorData();

var interests = new[] { "health", "astrology" };
var res = theSession.Query<Article>()
var res = await theSession.Query<Article>()
.Where(x => x.CategoryList.Any(s => interests.Contains(s)))
.OrderBy(x => x.Long)
.ToList();
.ToListAsync();

res.Count.ShouldBe(2);
res[0].Long.ShouldBe(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Shouldly;
using Xunit;

namespace CoreTests.Bugs;
namespace StressTests.Bugs;

public class Bug616Account
{
Expand Down

0 comments on commit 847bcda

Please sign in to comment.