From 88463d32dd64b1387b8d7a98ac22e7816d81d162 Mon Sep 17 00:00:00 2001 From: Tom Bates Date: Thu, 10 Apr 2025 20:52:59 +0100 Subject: [PATCH 1/9] Removed unused files --- GOVKit/Tests/GOVKit.xctestplan | 24 ------------------- .../ConstantsTests.swift | 0 2 files changed, 24 deletions(-) delete mode 100644 GOVKit/Tests/GOVKit.xctestplan rename GOVKit/Tests/GOVKitTests/Specs/{Resources => Extensions}/ConstantsTests.swift (100%) diff --git a/GOVKit/Tests/GOVKit.xctestplan b/GOVKit/Tests/GOVKit.xctestplan deleted file mode 100644 index 039c66bc1..000000000 --- a/GOVKit/Tests/GOVKit.xctestplan +++ /dev/null @@ -1,24 +0,0 @@ -{ - "configurations" : [ - { - "id" : "4C8357B6-0F2F-4F99-A68E-21577B90499B", - "name" : "Test Scheme Action", - "options" : { - - } - } - ], - "defaultOptions" : { - - }, - "testTargets" : [ - { - "target" : { - "containerPath" : "container:", - "identifier" : "GOVKitTests", - "name" : "GOVKitTests" - } - } - ], - "version" : 1 -} diff --git a/GOVKit/Tests/GOVKitTests/Specs/Resources/ConstantsTests.swift b/GOVKit/Tests/GOVKitTests/Specs/Extensions/ConstantsTests.swift similarity index 100% rename from GOVKit/Tests/GOVKitTests/Specs/Resources/ConstantsTests.swift rename to GOVKit/Tests/GOVKitTests/Specs/Extensions/ConstantsTests.swift From 5be160e4f60ba5445716d8333055271830f1abd8 Mon Sep 17 00:00:00 2001 From: Tom Bates Date: Thu, 10 Apr 2025 21:03:49 +0100 Subject: [PATCH 2/9] Fixed tests --- .../Foundation/String+ExtensionsTests.swift | 10 +++++----- .../UIKit/UITableView+ExtensionsTests.swift | 3 ++- Tests/GovUK.xctestplan | 15 +++++++++++---- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/GOVKit/Tests/GOVKitTests/Specs/Extensions/Foundation/String+ExtensionsTests.swift b/GOVKit/Tests/GOVKitTests/Specs/Extensions/Foundation/String+ExtensionsTests.swift index dce14b100..ef04c8a81 100644 --- a/GOVKit/Tests/GOVKitTests/Specs/Extensions/Foundation/String+ExtensionsTests.swift +++ b/GOVKit/Tests/GOVKitTests/Specs/Extensions/Foundation/String+ExtensionsTests.swift @@ -6,11 +6,11 @@ import Testing @Suite struct String_ExtensionsTests { - @Test - func common_hasCorrectValues() { - let sut = String.common - #expect(sut.tableName == "Common") - } +// @Test +// func common_hasCorrectValues() { +// let sut = String.common +// #expect(sut.tableName == "Common") +// } @Test func localized_returnsExpectedResult() { diff --git a/GOVKit/Tests/GOVKitTests/Specs/Extensions/UIKit/UITableView+ExtensionsTests.swift b/GOVKit/Tests/GOVKitTests/Specs/Extensions/UIKit/UITableView+ExtensionsTests.swift index bf8b26262..35e9ca46d 100644 --- a/GOVKit/Tests/GOVKitTests/Specs/Extensions/UIKit/UITableView+ExtensionsTests.swift +++ b/GOVKit/Tests/GOVKitTests/Specs/Extensions/UIKit/UITableView+ExtensionsTests.swift @@ -12,7 +12,8 @@ struct UITableView_ExtensionsTests { let sut = TestTableView() sut.register(TestTableViewCell.self) - let cell: TestTableViewCell = sut.dequeue( + var cell: TestTableViewCell? + cell = sut.dequeue( indexPath: .init(row: 0, section: 0) ) diff --git a/Tests/GovUK.xctestplan b/Tests/GovUK.xctestplan index 172b7f86e..6b4e938c9 100644 --- a/Tests/GovUK.xctestplan +++ b/Tests/GovUK.xctestplan @@ -34,6 +34,14 @@ "testTimeoutsEnabled" : true }, "testTargets" : [ + { + "parallelizable" : false, + "target" : { + "containerPath" : "container:GovUK.xcodeproj", + "identifier" : "5D4B9D332C074207005F126A", + "name" : "govuk_ios_snapshot_tests" + } + }, { "target" : { "containerPath" : "container:GovUK.xcodeproj", @@ -42,11 +50,10 @@ } }, { - "parallelizable" : false, "target" : { - "containerPath" : "container:GovUK.xcodeproj", - "identifier" : "5D4B9D332C074207005F126A", - "name" : "govuk_ios_snapshot_tests" + "containerPath" : "container:GOVKit", + "identifier" : "GOVKitTests", + "name" : "GOVKitTests" } } ], From 35e9b3458145d47ae9268c8a679746f0524b4ff9 Mon Sep 17 00:00:00 2001 From: Tom Bates Date: Fri, 11 Apr 2025 09:37:23 +0100 Subject: [PATCH 3/9] Updated gems --- Gemfile.lock | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0d4c0385e..645a9bb4a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -23,17 +23,18 @@ GEM artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.3.2) - aws-partitions (1.1071.0) - aws-sdk-core (3.220.2) + aws-partitions (1.1084.0) + aws-sdk-core (3.222.1) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) base64 jmespath (~> 1, >= 1.6.1) + logger aws-sdk-kms (1.99.0) aws-sdk-core (~> 3, >= 3.216.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.182.0) + aws-sdk-s3 (1.183.0) aws-sdk-core (~> 3, >= 3.216.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) @@ -88,7 +89,7 @@ GEM faraday_middleware (1.2.1) faraday (~> 1.0) fastimage (2.4.0) - fastlane (2.227.0) + fastlane (2.227.1) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -128,7 +129,7 @@ GEM tty-spinner (>= 0.8.0, < 1.0.0) word_wrap (~> 1.0.0) xcodeproj (>= 1.13.0, < 2.0.0) - xcpretty (~> 0.4.0) + xcpretty (~> 0.4.1) xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) fastlane-plugin-firebase_app_distribution (0.10.0) google-apis-firebaseappdistribution_v1 (~> 0.3.0) @@ -187,7 +188,7 @@ GEM json (2.10.2) jwt (2.10.1) base64 - logger (1.6.6) + logger (1.7.0) mini_magick (4.13.2) mini_mime (1.1.5) mini_portile2 (2.8.8) @@ -198,10 +199,10 @@ GEM nanaimo (0.4.0) naturally (2.2.1) nkf (0.2.0) - nokogiri (1.18.5) + nokogiri (1.18.7) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.18.5-arm64-darwin) + nokogiri (1.18.7-arm64-darwin) racc (~> 1.4) optparse (0.6.0) os (1.1.4) @@ -256,7 +257,7 @@ GEM colored2 (~> 3.1) nanaimo (~> 0.4.0) rexml (>= 3.3.6, < 4.0) - xcpretty (0.4.0) + xcpretty (0.4.1) rouge (~> 3.28.0) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) From 8d073cf6df62e480e618caa9201c9dfb0049d836 Mon Sep 17 00:00:00 2001 From: Tom Bates Date: Fri, 11 Apr 2025 09:40:12 +0100 Subject: [PATCH 4/9] Updated xcode -> 16.3 --- .xcode-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.xcode-version b/.xcode-version index d9ad0e57a..44928df48 100644 --- a/.xcode-version +++ b/.xcode-version @@ -1 +1 @@ -16.2 \ No newline at end of file +16.3 \ No newline at end of file From d13d58f01ae3f659c82c79464a00ca6ce7263219 Mon Sep 17 00:00:00 2001 From: Tom Bates Date: Sun, 13 Apr 2025 14:42:25 +0100 Subject: [PATCH 5/9] Remove strings tests --- .../Foundation/String+ExtensionsTests.swift | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/GOVKit/Tests/GOVKitTests/Specs/Extensions/Foundation/String+ExtensionsTests.swift b/GOVKit/Tests/GOVKitTests/Specs/Extensions/Foundation/String+ExtensionsTests.swift index ef04c8a81..8842cf4f7 100644 --- a/GOVKit/Tests/GOVKitTests/Specs/Extensions/Foundation/String+ExtensionsTests.swift +++ b/GOVKit/Tests/GOVKitTests/Specs/Extensions/Foundation/String+ExtensionsTests.swift @@ -12,12 +12,12 @@ struct String_ExtensionsTests { // #expect(sut.tableName == "Common") // } - @Test - func localized_returnsExpectedResult() { - let sut = String.LocalStringBuilder( - tableName: "TestStrings", - bundle: .module - ) - #expect(sut.localized("testString") == "Test string 123") - } +// @Test +// func localized_returnsExpectedResult() { +// let sut = String.LocalStringBuilder( +// tableName: "TestStrings", +// bundle: .module +// ) +// #expect(sut.localized("testString") == "Test string 123") +// } } From 60b99b25e4d684b455c343e2c58ace6b33c5894f Mon Sep 17 00:00:00 2001 From: Tom Bates Date: Mon, 14 Apr 2025 08:16:16 +0100 Subject: [PATCH 6/9] Timeout update --- Fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Fastlane/Fastfile b/Fastlane/Fastfile index 276094df8..ae80ef545 100644 --- a/Fastlane/Fastfile +++ b/Fastlane/Fastfile @@ -9,7 +9,7 @@ default_platform :ios # rubocop:disable Metrics/BlockLength platform :ios do before_all do - ENV['FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT'] = '600' + ENV['FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT'] = '601' end desc 'Runs all the tests' From 3f0dfbe98bd6766929ae202847bdbb1b9dbb2839 Mon Sep 17 00:00:00 2001 From: Tom Bates Date: Mon, 14 Apr 2025 13:03:08 +0100 Subject: [PATCH 7/9] Removed Package.resolved --- GOVKit/Package.resolved | 15 --------------- GOVKit/Package.swift | 5 +---- .../GOVKitTests/Resources/TestStrings.xcstrings | 17 ----------------- .../Foundation/String+ExtensionsTests.swift | 9 --------- .../Analytics/AppEvent+TopicsTests.swift | 5 ++++- 5 files changed, 5 insertions(+), 46 deletions(-) delete mode 100644 GOVKit/Package.resolved delete mode 100644 GOVKit/Tests/GOVKitTests/Resources/TestStrings.xcstrings diff --git a/GOVKit/Package.resolved b/GOVKit/Package.resolved deleted file mode 100644 index 6cb58b423..000000000 --- a/GOVKit/Package.resolved +++ /dev/null @@ -1,15 +0,0 @@ -{ - "originHash" : "75bc73283bb0bd2952e5b7f635611d098006e6832f5e944ff6183924c8b83a00", - "pins" : [ - { - "identity" : "govuk-mobile-ios-ui-components", - "kind" : "remoteSourceControl", - "location" : "https://github.com/alphagov/govuk-mobile-ios-ui-components", - "state" : { - "branch" : "develop", - "revision" : "cdeda563886e92f0b9187b2a6448162c6db7b72a" - } - } - ], - "version" : 3 -} diff --git a/GOVKit/Package.swift b/GOVKit/Package.swift index 2c4de7fa3..f445ddcb2 100644 --- a/GOVKit/Package.swift +++ b/GOVKit/Package.swift @@ -38,10 +38,7 @@ let package = Package( ), .testTarget( name: "GOVKitTests", - dependencies: ["GOVKit", "GOVKitTestUtilities"], - resources: [ - .process("Resources") - ] + dependencies: ["GOVKit", "GOVKitTestUtilities"] ), ] ) diff --git a/GOVKit/Tests/GOVKitTests/Resources/TestStrings.xcstrings b/GOVKit/Tests/GOVKitTests/Resources/TestStrings.xcstrings deleted file mode 100644 index 7be2294c3..000000000 --- a/GOVKit/Tests/GOVKitTests/Resources/TestStrings.xcstrings +++ /dev/null @@ -1,17 +0,0 @@ -{ - "sourceLanguage" : "en-GB", - "strings" : { - "testString" : { - "extractionState" : "manual", - "localizations" : { - "en-GB" : { - "stringUnit" : { - "state" : "translated", - "value" : "Test string 123" - } - } - } - } - }, - "version" : "1.0" -} \ No newline at end of file diff --git a/GOVKit/Tests/GOVKitTests/Specs/Extensions/Foundation/String+ExtensionsTests.swift b/GOVKit/Tests/GOVKitTests/Specs/Extensions/Foundation/String+ExtensionsTests.swift index 8842cf4f7..878c9aa8c 100644 --- a/GOVKit/Tests/GOVKitTests/Specs/Extensions/Foundation/String+ExtensionsTests.swift +++ b/GOVKit/Tests/GOVKitTests/Specs/Extensions/Foundation/String+ExtensionsTests.swift @@ -11,13 +11,4 @@ struct String_ExtensionsTests { // let sut = String.common // #expect(sut.tableName == "Common") // } - -// @Test -// func localized_returnsExpectedResult() { -// let sut = String.LocalStringBuilder( -// tableName: "TestStrings", -// bundle: .module -// ) -// #expect(sut.localized("testString") == "Test string 123") -// } } diff --git a/Tests/govuk_ios/govuk_ios_unit_tests/Extensions/Analytics/AppEvent+TopicsTests.swift b/Tests/govuk_ios/govuk_ios_unit_tests/Extensions/Analytics/AppEvent+TopicsTests.swift index ca652f484..86054088f 100644 --- a/Tests/govuk_ios/govuk_ios_unit_tests/Extensions/Analytics/AppEvent+TopicsTests.swift +++ b/Tests/govuk_ios/govuk_ios_unit_tests/Extensions/Analytics/AppEvent+TopicsTests.swift @@ -6,7 +6,10 @@ import GOVKit @Suite struct AppEvent_TopicsTests { - @Test(arguments:[true, false]) + @Test(arguments:[ + true, + false + ]) func toggleTopic_returnsExpectedResult(isFavourite: Bool) { let expectedTitle = UUID().uuidString let expectedValue = isFavourite ? "On" : "Off" From 1ebad3f587a799a5fbdcddc6bda4dbef13d4770e Mon Sep 17 00:00:00 2001 From: Tom Bates Date: Mon, 14 Apr 2025 15:12:43 +0100 Subject: [PATCH 8/9] Disable test rather than comment --- .../Extensions/Foundation/String+ExtensionsTests.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/GOVKit/Tests/GOVKitTests/Specs/Extensions/Foundation/String+ExtensionsTests.swift b/GOVKit/Tests/GOVKitTests/Specs/Extensions/Foundation/String+ExtensionsTests.swift index 878c9aa8c..d18df5add 100644 --- a/GOVKit/Tests/GOVKitTests/Specs/Extensions/Foundation/String+ExtensionsTests.swift +++ b/GOVKit/Tests/GOVKitTests/Specs/Extensions/Foundation/String+ExtensionsTests.swift @@ -6,9 +6,9 @@ import Testing @Suite struct String_ExtensionsTests { -// @Test -// func common_hasCorrectValues() { -// let sut = String.common -// #expect(sut.tableName == "Common") -// } + @Test(.disabled("Disabled due to bundle loading issues")) + func common_hasCorrectValues() { + let sut = String.common + #expect(sut.tableName == "Common") + } } From a9b412a825177edd370fbdb347962971d122f3c4 Mon Sep 17 00:00:00 2001 From: Tom Bates Date: Mon, 14 Apr 2025 15:14:28 +0100 Subject: [PATCH 9/9] Reduce timeout --- Fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Fastlane/Fastfile b/Fastlane/Fastfile index ae80ef545..276094df8 100644 --- a/Fastlane/Fastfile +++ b/Fastlane/Fastfile @@ -9,7 +9,7 @@ default_platform :ios # rubocop:disable Metrics/BlockLength platform :ios do before_all do - ENV['FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT'] = '601' + ENV['FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT'] = '600' end desc 'Runs all the tests'