diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 16ef55c325bf..bad262059d14 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -90,14 +90,6 @@ steps: # notify: # - github_commit_status: # context: "Unit Tests Keystone" - - label: "🔬 WordPressData Unit Tests" - command: .buildkite/commands/run-unit-tests-for-scheme.sh WordPressData - plugins: [$CI_TOOLKIT_PLUGIN] - artifact_paths: - - "build/results/*" - notify: - - github_commit_status: - context: "Unit Tests WordPressData" ################# # Linters diff --git a/AGENTS.md b/AGENTS.md index 21af1a7c7af8..698aeb6be1cb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -49,9 +49,8 @@ WordPress-iOS uses a modular architecture with the main app and separate Swift p - **Localization**: follow best practices from @docs/localization.md ## Xcode Schemes -- `WordPress` builds the WordPress iOS app and runs `WordPressUnitTests.xctestplan` — default for builds and the full unit test suite. +- `WordPress` builds the WordPress iOS app and runs `WordPressUnitTests.xctestplan` — default for builds and the full unit test suite. Use this scheme to run unit tests. - `Jetpack` builds the Jetpack iOS app — switch to it for Jetpack-only work. -- Some test targets (e.g. `WordPressDataTests`) have their own scheme and aren't in `WordPressUnitTests.xctestplan`. If the `WordPress` scheme fails to build because of an unrelated target, fall back to the target's dedicated scheme. ## Simulator Sign-In diff --git a/Modules/Sources/WordPressData/Swift/Bundle+WordPressData.swift b/Modules/Sources/WordPressData/Swift/Bundle+WordPressData.swift index 21c1bd20c359..3388663cb307 100644 --- a/Modules/Sources/WordPressData/Swift/Bundle+WordPressData.swift +++ b/Modules/Sources/WordPressData/Swift/Bundle+WordPressData.swift @@ -2,6 +2,14 @@ import Foundation extension Bundle { @objc public class var wordPressData: Bundle { - .module + #if DEBUG + // Workaround for https://forums.swift.org/t/swift-5-3-swiftpm-resources-in-tests-uses-wrong-bundle-path/37051 + if let testBundlePath = ProcessInfo.processInfo.environment["XCTestBundlePath"], + let bundle = Bundle(path: "\(testBundlePath)/Modules_WordPressData.bundle") + { + return bundle + } + #endif + return .module } } diff --git a/Modules/Tests/WordPressDataTests/WordPressData.xctestplan b/Modules/Tests/WordPressDataTests/WordPressData.xctestplan deleted file mode 100644 index 51423e2a7b8a..000000000000 --- a/Modules/Tests/WordPressDataTests/WordPressData.xctestplan +++ /dev/null @@ -1,24 +0,0 @@ -{ - "configurations" : [ - { - "id" : "1CD15192-2579-4CD8-815F-86BF8B214099", - "name" : "Test Scheme Action", - "options" : { - - } - } - ], - "defaultOptions" : { - "testTimeoutsEnabled" : true - }, - "testTargets" : [ - { - "target" : { - "containerPath" : "container:../Modules", - "identifier" : "WordPressDataTests", - "name" : "WordPressDataTests" - } - } - ], - "version" : 1 -} diff --git a/Tests/KeystoneTests/WordPressUnitTests.xctestplan b/Tests/KeystoneTests/WordPressUnitTests.xctestplan index 7e1fda82d20c..37631fa902df 100644 --- a/Tests/KeystoneTests/WordPressUnitTests.xctestplan +++ b/Tests/KeystoneTests/WordPressUnitTests.xctestplan @@ -115,6 +115,13 @@ "name" : "WordPressMediaLibraryTests" } }, + { + "target" : { + "containerPath" : "container:..\/Modules", + "identifier" : "WordPressDataTests", + "name" : "WordPressDataTests" + } + }, { "target" : { "containerPath" : "container:WordPress.xcodeproj", diff --git a/WordPress/WordPress.xcodeproj/xcshareddata/xcschemes/WordPressData.xcscheme b/WordPress/WordPress.xcodeproj/xcshareddata/xcschemes/WordPressData.xcscheme deleted file mode 100644 index d114bf9d0eea..000000000000 --- a/WordPress/WordPress.xcodeproj/xcshareddata/xcschemes/WordPressData.xcscheme +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -