Skip to content
Closed
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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ jobs:
-scheme Tests \
-configuration Debug \
-destination '${{ steps.select_sim.outputs.destination }}' \
-parallel-testing-enabled NO \
-enableCodeCoverage YES | xcbeautify && exit ${PIPESTATUS[0]}

- name: Upload coverage to Codecov
Expand Down
8 changes: 8 additions & 0 deletions Tests/UnitTests/AddDownloadHandlersTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ import XCTest
class AddDownloadHandlersTests: XCTestCase {
let crowdinSDKConfig = CrowdinSDKConfig.config().with(crowdinProviderConfig: CrowdinProviderConfig(hashString: "5290b1cfa1eb44bf2581e78106i", sourceLanguage: "en"))

override func setUpWithError() throws {
try super.setUpWithError()
try XCTSkipUnless(
ProcessInfo.processInfo.environment["CROWDIN_LIVE_TESTS"] == "1",
"Requires live Crowdin distribution. Set CROWDIN_LIVE_TESTS=1 to run."
)
}

override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
CrowdinSDK.removeAllDownloadHandlers()
Expand Down
8 changes: 8 additions & 0 deletions Tests/UnitTests/AddErrorHandlersTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ import XCTest
@testable import CrowdinSDK

class AddErrorHandlersTests: XCTestCase {
override func setUpWithError() throws {
try super.setUpWithError()
try XCTSkipUnless(
ProcessInfo.processInfo.environment["CROWDIN_LIVE_TESTS"] == "1",
"Requires live Crowdin distribution. Set CROWDIN_LIVE_TESTS=1 to run."
)
}

override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
CrowdinSDK.removeAllErrorHandlers()
Expand Down
8 changes: 6 additions & 2 deletions Tests/UnitTests/CrowdinSDKTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ import XCTest
@testable import CrowdinSDK

class CrowdinSDKTests: XCTestCase {
override func setUp() {
override func setUpWithError() throws {
try super.setUpWithError()
try XCTSkipUnless(
ProcessInfo.processInfo.environment["CROWDIN_LIVE_TESTS"] == "1",
"Requires live Crowdin distribution. Set CROWDIN_LIVE_TESTS=1 to run."
)
CrowdinSDK.deintegrate()
super.setUp()
}

override func tearDown() {
Expand Down
9 changes: 8 additions & 1 deletion Tests/UnitTests/CrowdinStringTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ import XCTest
class CrowdinStringTestsLocalization: XCTestCase {
let crowdinSDKConfig = CrowdinSDKConfig.config().with(crowdinProviderConfig: CrowdinProviderConfig(hashString: "5290b1cfa1eb44bf2581e78106i", sourceLanguage: "en"))

override func setUpWithError() throws {
try super.setUpWithError()
try XCTSkipUnless(
ProcessInfo.processInfo.environment["CROWDIN_LIVE_TESTS"] == "1",
"Requires live Crowdin distribution. Set CROWDIN_LIVE_TESTS=1 to run."
)
}

override func tearDown() {
CrowdinSDK.removeAllDownloadHandlers()
CrowdinSDK.deintegrate()
Expand Down Expand Up @@ -78,4 +86,3 @@ class CrowdinStringTestsLocalization: XCTestCase {
wait(for: [expectation], timeout: 60.0)
}
}

14 changes: 14 additions & 0 deletions Tests/UnitTests/CrowdinSupportedLanguagesThreadSafetyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ import XCTest

class CrowdinSupportedLanguagesThreadSafetyTests: XCTestCase {

override func setUpWithError() throws {
try super.setUpWithError()
try XCTSkipUnless(
ProcessInfo.processInfo.environment["CROWDIN_LIVE_TESTS"] == "1",
"Requires live Crowdin distribution. Set CROWDIN_LIVE_TESTS=1 to run."
)
}

override func setUp() {
super.setUp()
CrowdinSDK.deintegrate()
Expand Down Expand Up @@ -141,6 +149,8 @@ class CrowdinSupportedLanguagesThreadSafetyTests: XCTestCase {
let initialLoadExpectation = XCTestExpectation(description: "Initial load")
supportedLanguages.downloadSupportedLanguages(completion: {
initialLoadExpectation.fulfill()
}, error: { _ in
initialLoadExpectation.fulfill()
})
wait(for: [initialLoadExpectation], timeout: 60.0)

Expand Down Expand Up @@ -223,6 +233,8 @@ class CrowdinSupportedLanguagesThreadSafetyTests: XCTestCase {
DispatchQueue.global(qos: .background).async {
manifest.crowdinSupportedLanguages.downloadSupportedLanguages(completion: {
expectation.fulfill()
}, error: { _ in
expectation.fulfill()
})
}
}
Expand Down Expand Up @@ -318,6 +330,8 @@ class CrowdinSupportedLanguagesThreadSafetyTests: XCTestCase {
// Write operation through download
supportedLanguages.downloadSupportedLanguages(completion: {
expectation.fulfill()
}, error: { _ in
expectation.fulfill()
})
}
}
Expand Down
8 changes: 6 additions & 2 deletions Tests/UnitTests/CrowdinTesterTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ import XCTest
@testable import CrowdinSDK

class CrowdinTesterTests: XCTestCase {
override func setUp() {
super.setUp()
override func setUpWithError() throws {
try super.setUpWithError()
try XCTSkipUnless(
ProcessInfo.processInfo.environment["CROWDIN_LIVE_TESTS"] == "1",
"Requires live Crowdin distribution. Set CROWDIN_LIVE_TESTS=1 to run."
)
// Put setup code here. This method is called before the invocation of each test method in the class.
let crowdinProviderConfig = CrowdinProviderConfig(hashString: "5290b1cfa1eb44bf2581e78106i",
sourceLanguage: "en")
Expand Down
8 changes: 6 additions & 2 deletions Tests/UnitTests/EnableSDKLocalizationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ import XCTest

class EnableSDKLocalizationTests: XCTestCase {

override func setUp() {
super.setUp()
override func setUpWithError() throws {
try super.setUpWithError()
try XCTSkipUnless(
ProcessInfo.processInfo.environment["CROWDIN_LIVE_TESTS"] == "1",
"Requires live Crowdin distribution. Set CROWDIN_LIVE_TESTS=1 to run."
)
// Put setup code here. This method is called before the invocation of each test method in the class.
let crowdinProviderConfig = CrowdinProviderConfig(hashString: "5290b1cfa1eb44bf2581e78106i",
sourceLanguage: "en")
Expand Down
9 changes: 6 additions & 3 deletions Tests/UnitTests/InfoPlistInitializationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ import XCTest
@testable import CrowdinSDK

class InfoPlistInitializationTests: XCTestCase {
override func setUp() {
super.setUp()
override func setUpWithError() throws {
try super.setUpWithError()
try XCTSkipUnless(
ProcessInfo.processInfo.environment["CROWDIN_LIVE_TESTS"] == "1",
"Requires live Crowdin distribution. Set CROWDIN_LIVE_TESTS=1 to run."
)
CrowdinSDK.deintegrate()
}

Expand Down Expand Up @@ -39,4 +43,3 @@ class InfoPlistInitializationTests: XCTestCase {
CrowdinSDK.removeDownloadHandler(hendlerId)
}
}

8 changes: 8 additions & 0 deletions Tests/UnitTests/InitializationCompletionHandlerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ import XCTest
@testable import CrowdinSDK

class InitializationCompletionHandlerTests: XCTestCase {
override func setUpWithError() throws {
try super.setUpWithError()
try XCTSkipUnless(
ProcessInfo.processInfo.environment["CROWDIN_LIVE_TESTS"] == "1",
"Requires live Crowdin distribution. Set CROWDIN_LIVE_TESTS=1 to run."
)
}

override func tearDown() {
CrowdinSDK.deintegrate()
CrowdinSDK.stop()
Expand Down
Loading