Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,16 @@ jobs:
# Testcontainers (Docker); GitHub's Windows runners cannot run Linux containers, so Windows runs the Core tests only.
- name: Test
if: runner.os == 'Linux'
run: dotnet test --no-build --configuration Release --solution tests/PythonScriptRunner.SemE2E.slnf
run: dotnet test --no-build --configuration Release --solution tests/PythonScriptRunner.SemE2E.slnf --filter-not-trait "Category=Timing"

# The tests that assert a duration (timeout, cancellation, latency, p95) run alone and one at a time: next to the
# other test projects, the runner's shared CPU made them miss their limits by a few milliseconds (D-188).
- name: Test (timing)
if: runner.os == 'Linux'
run: |
for project in Core Dashboard Worker; do
dotnet test --no-build --configuration Release --project "tests/PythonScriptRunner.$project.Tests" --filter-trait "Category=Timing" --parallel none
done

# The panel E2E tests run alone: containers starting or stopping in the other test projects change the host's network
# interfaces, and Chromium then aborts requests in flight with ERR_NETWORK_CHANGED.
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ A pull request is merged only when every job of `.github/workflows/ci.yml` is gr
## Conventions

- **Tests:** every acceptance criterion and every fixed bug has a test. Integration tests run against real Python (uv),
PostgreSQL and RabbitMQ (Testcontainers).
PostgreSQL and RabbitMQ (Testcontainers). A test that asserts a duration gets `[Trait("Category", "Timing")]`: the CI
runs those alone, one at a time (`--filter-trait "Category=Timing" --parallel none`).
- **Public API:** public types and members have XML documentation (the build generates it and fails on warnings).
- **Packages:** versions live in `Directory.Packages.props` (Central Package Management). Dependabot proposes updates
every Monday.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace PythonScriptRunner.Core.Tests.Integration;
public sealed class IsolationTests(PythonFixture fixture)
{
[Fact]
[Trait("Category", "Timing")]
public async Task Spec001_AC07_Timeout_KillsTheProcessTree()
{
// Arrange
Expand Down Expand Up @@ -44,6 +45,7 @@ with open(inputs["pid_file"], "w") as f:
}

[Fact]
[Trait("Category", "Timing")]
public async Task Spec001_AC08_Cancellation_StopsTheRun()
{
await using var host = RunnerHost.Create(fixture, b => b.AddStage("espera", s => s.Script("""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public sealed class PerformanceTests(PostgresFixture postgres, BrokerFixture bro
private static CancellationToken Ct => TestContext.Current.CancellationToken;

[Fact]
[Trait("Category", "Timing")]
public async Task Spec007_AC13_MainReadsWith90DaysOfRuns_AnswerWithP95Under500Ms()
{
var perDay = int.TryParse(Environment.GetEnvironmentVariable("PSR_PERF_RUNS_PER_DAY"), CultureInfo.InvariantCulture, out var configured)
Expand Down
1 change: 1 addition & 0 deletions tests/PythonScriptRunner.Dashboard.Tests/RealtimeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public sealed class RealtimeTests(PostgresFixture postgres, BrokerFixture broker
private static CancellationToken Ct => TestContext.Current.CancellationToken;

[Fact]
[Trait("Category", "Timing")]
public async Task Spec007_AC11_SubscribedClientsOfTwoInstances_ReceiveStepAndRunUpdatesInUnderOneSecond()
{
await using var env = await PsrEnvironment.CreateAsync(postgres, broker, python);
Expand Down
2 changes: 2 additions & 0 deletions tests/PythonScriptRunner.Worker.Tests/RecoveryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public sealed class RecoveryTests(PostgresFixture postgres, BrokerFixture broker
private static CancellationToken Ct => TestContext.Current.CancellationToken;

[Fact]
[Trait("Category", "Timing")]
public async Task Spec006_AC05_LostWorker_IdempotentStepIsRecoveredByAnother()
{
await using var env = await PsrEnvironment.CreateAsync(postgres, broker, python);
Expand Down Expand Up @@ -49,6 +50,7 @@ public async Task Spec006_AC06_LostWorker_NonIdempotentStepFailsAndReprocessComp
}

[Fact]
[Trait("Category", "Timing")]
public async Task Spec006_AC09_Cancel_StopsTheProcessInTheWorker()
{
await using var env = await PsrEnvironment.CreateAsync(postgres, broker, python);
Expand Down
Loading