From 3c9baced7deb1d2c37701f5b8cb231d75807d095 Mon Sep 17 00:00:00 2001 From: Adam Young Date: Wed, 3 Apr 2024 21:04:21 +0100 Subject: [PATCH] Tidy --- Makefile | 27 +++++++++---------- .../HTTPClient/MockURLProtocol.swift | 10 +++---- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 43a24412..5b58e8e6 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,6 @@ IOS_DESTINATION = 'platform=iOS Simulator,name=iPhone 15,OS=17.2' WATCHOS_DESINTATION = 'platform=watchOS Simulator,name=Apple Watch Series 9 (45mm),OS=10.2' TVOS_DESTINATION = 'platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=17.2' VISIONOS_DESTINATION = 'platform=visionOS Simulator,name=Apple Vision Pro,OS=1.1' -BUILD_JOB_COUNT = 4 SWIFT_CONTAINER_IMAGE = swift:5.9.2-jammy @@ -36,7 +35,7 @@ build: .PHONY: build-linux build-linux: - docker run --rm -v "$${PWD}:/workspace" -w /workspace $(SWIFT_CONTAINER_IMAGE) /bin/bash -cl "swift build --jobs $(BUILD_JOB_COUNT) -Xswiftc -warnings-as-errors -Xswiftc -strict-concurrency=complete" + docker run --rm -v "$${PWD}:/workspace" -w /workspace $(SWIFT_CONTAINER_IMAGE) /bin/bash -cl "swift build -Xswiftc -warnings-as-errors -Xswiftc -strict-concurrency=complete" .PHONY: build-release build-release: @@ -44,7 +43,7 @@ build-release: .PHONY: build-linux-release build-linux-release: - docker run --rm -v "$${PWD}:/workspace" -w /workspace $(SWIFT_CONTAINER_IMAGE) /bin/bash -cl "swift build -c release --jobs $(BUILD_JOB_COUNT) -Xswiftc -warnings-as-errors -Xswiftc -strict-concurrency=complete" + docker run --rm -v "$${PWD}:/workspace" -w /workspace $(SWIFT_CONTAINER_IMAGE) /bin/bash -cl "swift build -c release -Xswiftc -warnings-as-errors -Xswiftc -strict-concurrency=complete" .PHONY: build-docs build-docs: @@ -66,28 +65,28 @@ generate-docs: .PHONY: test test: - swift build --build-tests --jobs $(BUILD_JOB_COUNT) -Xswiftc -warnings-as-errors -Xswiftc -strict-concurrency=complete - swift test --skip-build --parallel --filter $(TEST_TARGET) -Xswiftc -strict-concurrency=complete + swift build --build-tests -Xswiftc -warnings-as-errors -Xswiftc -strict-concurrency=complete + swift test --skip-build --filter $(TEST_TARGET) -Xswiftc -strict-concurrency=complete .PHONY: test-ios test-ios: - set -o pipefail && NSUnbufferedIO=YES xcodebuild clean build-for-testing -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(IOS_DESTINATION) -parallelizeTargets 2>&1 | xcbeautify - set -o pipefail && NSUnbufferedIO=YES xcodebuild test-without-building -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(IOS_DESTINATION) -parallel-testing-enabled YES 2>&1 | xcbeautify + set -o pipefail && NSUnbufferedIO=YES xcodebuild clean build-for-testing -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(IOS_DESTINATION) | xcbeautify + set -o pipefail && NSUnbufferedIO=YES xcodebuild test-without-building -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(IOS_DESTINATION) | xcbeautify .PHONY: test-watchos test-watchos: - set -o pipefail && NSUnbufferedIO=YES xcodebuild build-for-testing -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(WATCHOS_DESINTATION) -parallelizeTargets 2>&1 | xcbeautify - set -o pipefail && NSUnbufferedIO=YES xcodebuild test-without-building -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(WATCHOS_DESINTATION) -parallel-testing-enabled YES 2>&1 | xcbeautify + set -o pipefail && NSUnbufferedIO=YES xcodebuild build-for-testing -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(WATCHOS_DESINTATION) | xcbeautify + set -o pipefail && NSUnbufferedIO=YES xcodebuild test-without-building -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(WATCHOS_DESINTATION) | xcbeautify .PHONY: test-tvos test-tvos: - set -o pipefail && NSUnbufferedIO=YES xcodebuild build-for-testing -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(TVOS_DESTINATION) -parallelizeTargets 2>&1 | xcbeautify - set -o pipefail && NSUnbufferedIO=YES xcodebuild test-without-building -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(TVOS_DESTINATION) -parallel-testing-enabled YES 2>&1 | xcbeautify + set -o pipefail && NSUnbufferedIO=YES xcodebuild build-for-testing -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(TVOS_DESTINATION) | xcbeautify + set -o pipefail && NSUnbufferedIO=YES xcodebuild test-without-building -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(TVOS_DESTINATION) | xcbeautify .PHONY: test-visionos test-visionos: - set -o pipefail && NSUnbufferedIO=YES xcodebuild build-for-testing -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(VISIONOS_DESTINATION) -parallelizeTargets 2>&1 | xcbeautify - set -o pipefail && NSUnbufferedIO=YES xcodebuild test-without-building -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(VISIONOS_DESTINATION) -parallel-testing-enabled YES 2>&1 | xcbeautify + set -o pipefail && NSUnbufferedIO=YES xcodebuild build-for-testing -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(VISIONOS_DESTINATION) | xcbeautify + set -o pipefail && NSUnbufferedIO=YES xcodebuild test-without-building -scheme $(TARGET) -only-testing $(TEST_TARGET) -destination $(VISIONOS_DESTINATION) | xcbeautify .PHONY: test-linux test-linux: @@ -95,7 +94,7 @@ test-linux: .PHONY: integration-test integration-test: .check-env-vars - swift build --build-tests --jobs $(BUILD_JOB_COUNT) -Xswiftc -strict-concurrency=complete + swift build --build-tests -Xswiftc -strict-concurrency=complete swift test --skip-build --filter $(INTEGRATION_TEST_TARGET) -Xswiftc -strict-concurrency=complete .PHONY: ci diff --git a/Tests/TMDbTests/Mocks/Networking/HTTPClient/MockURLProtocol.swift b/Tests/TMDbTests/Mocks/Networking/HTTPClient/MockURLProtocol.swift index b1d08f7c..7b9baf7f 100644 --- a/Tests/TMDbTests/Mocks/Networking/HTTPClient/MockURLProtocol.swift +++ b/Tests/TMDbTests/Mocks/Networking/HTTPClient/MockURLProtocol.swift @@ -22,12 +22,12 @@ import Foundation import FoundationNetworking #endif -final class MockURLProtocol: URLProtocol { +final class MockURLProtocol: URLProtocol, @unchecked Sendable{ - nonisolated(unsafe) static var data: Data? - nonisolated(unsafe) static var failError: Error? - nonisolated(unsafe) static var responseStatusCode: Int? - private(set) nonisolated(unsafe) static var lastRequest: URLRequest? + static var data: Data? + static var failError: Error? + static var responseStatusCode: Int? + private(set) static var lastRequest: URLRequest? override class func canInit(with _: URLRequest) -> Bool { true