mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 17:45:19 +00:00
SwiftTesting: Enable in GitHubActions + peer uuids (#767)
This commit is contained in:
@@ -24,4 +24,4 @@ jobs:
|
|||||||
run: swift build
|
run: swift build
|
||||||
|
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: swift test --parallel --disable-swift-testing # so it only runs xctests: https://github.com/swiftlang/swift-package-manager/issues/8529#issuecomment-2815711345
|
run: swift test --parallel
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
import Testing
|
import Testing
|
||||||
import CryptoKit
|
import CryptoKit
|
||||||
|
import struct Foundation.UUID
|
||||||
@testable import bitchat
|
@testable import bitchat
|
||||||
|
|
||||||
// TODO: Remove once MockBLEService is refactored to fix race condition
|
// TODO: Remove once MockBLEService is refactored to fix race condition
|
||||||
@@ -20,12 +21,10 @@ struct PrivateChatE2ETests {
|
|||||||
private let mockKeychain: MockKeychain
|
private let mockKeychain: MockKeychain
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
MockBLEService.resetTestBus()
|
// Create services with unique peer IDs to avoid any collision
|
||||||
|
alice = MockBLEService(peerID: PeerID(str: UUID().uuidString), nickname: TestConstants.testNickname1)
|
||||||
// Create services with unique peer IDs to avoid collision with other test suites
|
bob = MockBLEService(peerID: PeerID(str: UUID().uuidString), nickname: TestConstants.testNickname2)
|
||||||
alice = MockBLEService(peerID: "PRIV_ALICE_", nickname: TestConstants.testNickname1)
|
charlie = MockBLEService(peerID: PeerID(str: UUID().uuidString), nickname: TestConstants.testNickname3)
|
||||||
bob = MockBLEService(peerID: "PRIV_BOB___", nickname: TestConstants.testNickname2)
|
|
||||||
charlie = MockBLEService(peerID: "PRIV_CHARLE", nickname: TestConstants.testNickname3)
|
|
||||||
mockKeychain = MockKeychain()
|
mockKeychain = MockKeychain()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Testing
|
import Testing
|
||||||
|
import struct Foundation.UUID
|
||||||
@testable import bitchat
|
@testable import bitchat
|
||||||
|
|
||||||
@Suite(.serialized)
|
@Suite(.serialized)
|
||||||
@@ -20,13 +21,11 @@ struct PublicChatE2ETests {
|
|||||||
private var receivedMessages: [String: [BitchatMessage]] = [:]
|
private var receivedMessages: [String: [BitchatMessage]] = [:]
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
MockBLEService.resetTestBus()
|
// Create mock services with unique peer IDs to avoid any collision
|
||||||
|
alice = MockBLEService(peerID: PeerID(str: UUID().uuidString), nickname: TestConstants.testNickname1)
|
||||||
// Create mock services with unique peer IDs to avoid collision with other test suites
|
bob = MockBLEService(peerID: PeerID(str: UUID().uuidString), nickname: TestConstants.testNickname2)
|
||||||
alice = MockBLEService(peerID: "PUB_ALICE__", nickname: TestConstants.testNickname1)
|
charlie = MockBLEService(peerID: PeerID(str: UUID().uuidString), nickname: TestConstants.testNickname3)
|
||||||
bob = MockBLEService(peerID: "PUB_BOB____", nickname: TestConstants.testNickname2)
|
david = MockBLEService(peerID: PeerID(str: UUID().uuidString), nickname: TestConstants.testNickname4)
|
||||||
charlie = MockBLEService(peerID: "PUB_CHARLIE", nickname: TestConstants.testNickname3)
|
|
||||||
david = MockBLEService(peerID: "PUB_DAVID__", nickname: TestConstants.testNickname4)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Basic Broadcasting Tests
|
// MARK: - Basic Broadcasting Tests
|
||||||
|
|||||||
Reference in New Issue
Block a user