Skip to content

Commit

Permalink
Fix concurrency in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Supereg committed Aug 20, 2024
1 parent 8924228 commit 625f98a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions TemplateApplicationTests/TemplateApplicationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import XCTest


class TemplateApplicationTests: XCTestCase {
@MainActor
func testContactsCount() throws {
XCTAssertEqual(Contacts(presentingAccount: .constant(true)).contacts.count, 1)
}
Expand Down
9 changes: 5 additions & 4 deletions TemplateApplicationUITests/ContactsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ import XCTest


class ContactsTests: XCTestCase {
override func setUpWithError() throws {
try super.setUpWithError()
@MainActor
override func setUp() async throws {

Check failure on line 15 in TemplateApplicationUITests/ContactsTests.swift

View workflow job for this annotation

GitHub Actions / SwiftLint / SwiftLint

Vertical Whitespace after Opening Braces Violation: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)

Check warning on line 15 in TemplateApplicationUITests/ContactsTests.swift

View workflow job for this annotation

GitHub Actions / Build and Test / Test using xcodebuild or run fastlane

Vertical Whitespace after Opening Braces Violation: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
continueAfterFailure = false

let app = XCUIApplication()
app.launchArguments = ["--skipOnboarding"]
app.launch()
}



@MainActor
func testContacts() throws {
let app = XCUIApplication()

Expand Down
7 changes: 4 additions & 3 deletions TemplateApplicationUITests/ContributionsTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ import XCTest


final class ContributionsTest: XCTestCase {
override func setUpWithError() throws {
try super.setUpWithError()
@MainActor
override func setUp() async throws {

Check failure on line 15 in TemplateApplicationUITests/ContributionsTest.swift

View workflow job for this annotation

GitHub Actions / SwiftLint / SwiftLint

Vertical Whitespace after Opening Braces Violation: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
continueAfterFailure = false

let app = XCUIApplication()
app.launchArguments = ["--setupTestAccount", "--skipOnboarding"]
app.deleteAndLaunch(withSpringboardAppName: "TemplateApplication")
}

@MainActor
func testLicenseInformationPage() throws {
let app = XCUIApplication()

Expand Down
8 changes: 4 additions & 4 deletions TemplateApplicationUITests/SchedulerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ import XCTestExtensions


class SchedulerTests: XCTestCase {
override func setUpWithError() throws {
try super.setUpWithError()

@MainActor
override func setUp() async throws {
continueAfterFailure = false

let app = XCUIApplication()
app.launchArguments = ["--skipOnboarding", "--testSchedule"]
app.deleteAndLaunch(withSpringboardAppName: "TemplateApplication")
}



@MainActor
func testScheduler() throws {
let app = XCUIApplication()

Expand Down

0 comments on commit 625f98a

Please sign in to comment.