Skip to content

Commit

Permalink
[GitHub Actions] Make PR validation run on Linux only (#27)
Browse files Browse the repository at this point in the history
* Make PR validation run on Linux only

* Fix AltAdapterSpec HOCON configuration
  • Loading branch information
Arkatufus authored Mar 29, 2024
1 parent f38a8cd commit 236999b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pr_validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ jobs:
name: Test-${{matrix.os}}
runs-on: ${{matrix.os}}

# The docker image for v5.0.9 doesn't exist for windows, we can only test on linux.
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]

steps:
- name: "Checkout"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Akka.Configuration;
using Akka.Persistence.TCK.Journal;
using Xunit;
using Xunit.Abstractions;

namespace Akka.Persistence.EventStore.Tests
{
Expand All @@ -10,31 +11,32 @@ public class EventStoreJournalAltAdapterSpec : JournalSpec, IClassFixture<Databa
{
protected override bool SupportsRejectingNonSerializableObjects { get; } = false;

public EventStoreJournalAltAdapterSpec(DatabaseFixture databaseFixture)
: base(CreateSpecConfig(databaseFixture), nameof(EventStoreJournalAltAdapterSpec))
public EventStoreJournalAltAdapterSpec(DatabaseFixture databaseFixture, ITestOutputHelper output)
: base(CreateSpecConfig(databaseFixture), nameof(EventStoreJournalAltAdapterSpec), output)
{
Initialize();
}

private static Config CreateSpecConfig(DatabaseFixture databaseFixture)
{
var specString = @"
akka.test.single-expect-default = 10s
akka.persistence {
publish-plugin-commands = on
journal {
plugin = ""akka.persistence.journal.eventstore""
eventstore {
class = ""Akka.Persistence.EventStore.Journal.EventStoreJournal, Akka.Persistence.EventStore""
connection-string = """ + databaseFixture.ConnectionString + @"""
connection-name = ""EventStoreJournalSpec""
read-batch-size = 500
adapter = ""Akka.Persistence.EventStore.Tests.AltAdapter, Akka.Persistence.EventStore.Tests""
}
}
}";

return ConfigurationFactory.ParseString(specString);
return ConfigurationFactory.ParseString(
$$"""
akka.loglevel = DEBUG
akka.test.single-expect-default = 10s
akka.persistence {
publish-plugin-commands = on
journal {
plugin = "akka.persistence.journal.eventstore"
eventstore {
class = "Akka.Persistence.EventStore.Journal.EventStoreJournal, Akka.Persistence.EventStore"
connection-string = "{{databaseFixture.ConnectionString}}"
connection-name = "EventStoreJournalSpec"
read-batch-size = 500
adapter = "{{typeof(AltEventAdapter).AssemblyQualifiedName}}"
}
}
}
""").WithFallback(DefaultConfig);
}
}
}

0 comments on commit 236999b

Please sign in to comment.