Skip to content

Conversation

finestructure
Copy link
Member

This pull forward changes required to parallelise tests. The point here is to reduce the noise of that PR with things that aren't required but can already be applied ahead of time.

# Conflicts:
#	Tests/AppTests/AllTests.swift
# Conflicts:
#	Tests/AppTests/Helpers/TestSupport.swift
@cla-bot cla-bot bot added the cla-signed label Mar 14, 2025
import Dependencies


@Suite(.dependency(\.date.now, .t0)) struct AllTests { }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to be able to bring up a number of test dbs at the start of the app tests and tear them down afterwards, all the tests need to belong to a single suite. The easiest way to do this is to nest all existing tests under a new top level suite.

This suite will then later gain the trait

- @Suite(.dependency(\.date.now, .t0)) struct AllTests { }
+ @Suite(.setupDatabasePool, .dependency(\.date.now, .t0)) struct AllTests { }

NB: AllTests isn't an ideal name I've just realised, because we have a couple of other test suites that aren't nested. I'll rename this to AllAppTests after all is done. It'd be too much rebasing for little gain at this point.

@Suite struct AnalyzeErrorTests {
let socialPosts = LockIsolated<[String]>([])
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the nested @Suites can't be defined in AllTests.swift, because they hold properties (which can't be declared in extensions).

@Suite


struct LiveGitlabBuilderTests {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change, just pulling it into its own file.

@finestructure finestructure merged commit 1a6e362 into main Mar 14, 2025
6 checks passed
@finestructure finestructure deleted the pull-forward-test-changes branch March 14, 2025 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants