Share tests timeout and set to .infinity

This commit is contained in:
Davide 2024-11-26 12:33:28 +01:00
parent 9b8ebc10a8
commit e49e8881b3
No known key found for this signature in database
GPG Key ID: A48836171C759F5E
4 changed files with 38 additions and 10 deletions

View File

@ -58,7 +58,7 @@ extension ExtendedTunnelTests {
.store(in: &subscriptions)
try await tunnel.disconnect()
await fulfillment(of: [exp], timeout: 1.0)
await fulfillment(of: [exp], timeout: CommonLibraryTests.timeout)
XCTAssertEqual(sut.lastErrorCode, .crypto)
}
@ -88,7 +88,7 @@ extension ExtendedTunnelTests {
.store(in: &subscriptions)
try await tunnel.install(profile, connect: true, title: \.name)
await fulfillment(of: [exp], timeout: 1.0)
await fulfillment(of: [exp], timeout: CommonLibraryTests.timeout)
XCTAssertEqual(sut.dataCount, dataCount)
}

View File

@ -381,7 +381,7 @@ extension IAPManagerTests {
.store(in: &subscriptions)
await sut.reloadReceipt()
await fulfillment(of: [exp], timeout: 1.0)
await fulfillment(of: [exp], timeout: CommonLibraryTests.timeout)
XCTAssertEqual(sut.eligibleFeatures, [
.appleTV,
@ -433,7 +433,7 @@ extension IAPManagerTests {
.store(in: &subscriptions)
sut.observeObjects()
await fulfillment(of: [exp], timeout: 1.0)
await fulfillment(of: [exp], timeout: CommonLibraryTests.timeout)
XCTAssertNotEqual(sut.userLevel, .undefined)
XCTAssertFalse(sut.eligibleFeatures.isEmpty)

View File

@ -31,8 +31,6 @@ import XCTest
@MainActor
final class ProfileManagerTests: XCTestCase {
private let timeout = 3.0
private var subscriptions: Set<AnyCancellable> = []
}
@ -247,7 +245,7 @@ extension ProfileManagerTests {
.store(in: &subscriptions)
try await sut.save(profile)
await fulfillment(of: [exp], timeout: timeout)
await fulfillment(of: [exp], timeout: CommonLibraryTests.timeout)
}
func test_givenRepository_whenRemove_thenIsRemoved() async throws {
@ -294,7 +292,7 @@ extension ProfileManagerTests {
.store(in: &subscriptions)
try await sut.save(profile, remotelyShared: true)
await fulfillment(of: [exp], timeout: timeout)
await fulfillment(of: [exp], timeout: CommonLibraryTests.timeout)
XCTAssertTrue(sut.isRemotelyShared(profileWithId: profile.id))
}
@ -321,7 +319,7 @@ extension ProfileManagerTests {
.store(in: &subscriptions)
try await sut.save(profile, remotelyShared: false)
await fulfillment(of: [exp], timeout: timeout)
await fulfillment(of: [exp], timeout: CommonLibraryTests.timeout)
XCTAssertFalse(sut.isRemotelyShared(profileWithId: profile.id))
}
@ -731,6 +729,6 @@ private extension ProfileManagerTests {
.store(in: &subscriptions)
try await action(sut)
await fulfillment(of: [exp], timeout: timeout)
await fulfillment(of: [exp], timeout: CommonLibraryTests.timeout)
}
}

View File

@ -0,0 +1,30 @@
//
// Shared.swift
// Passepartout
//
// Created by Davide De Rosa on 11/26/24.
// Copyright (c) 2024 Davide De Rosa. All rights reserved.
//
// https://github.com/passepartoutvpn
//
// This file is part of Passepartout.
//
// Passepartout is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Passepartout is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
enum CommonLibraryTests {
static let timeout: TimeInterval = .infinity
}