Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:Tests/YosemiteTests/YosemiteTests.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand Down
28 changes: 15 additions & 13 deletions Modules/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,21 @@ let package = Package(
dependencies: [.target(name: "WordPressShared")],
resources: [.process("Resources")]
),
.testTarget(
name: "YosemiteTests",
dependencies: [
"Codegen",
"Fakes",
"TestKit",
"WooFoundation",
"WordPressShared",
"Yosemite"
],
resources: [
.process("Resources"),
.process("../NetworkingTests/Responses")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See also #15796 description regarding sharing the Responses assets

]
)
]
)

Expand Down Expand Up @@ -298,7 +313,6 @@ enum XcodeTargetNames {
static let wooCommerceWatchApp = "Woo Watch App"
static let wordPressAuthenticator = "WordPressAuthenticator"
static let wordPressAuthenticatorTests = "WordPressAuthenticatorTests"
static let yosemiteTests = "YosemiteTests"
}

enum XcodeSupport {
Expand All @@ -314,7 +328,6 @@ enum XcodeSupport {
XcodeTargetNames.wooCommerceWatchApp,
XcodeTargetNames.wordPressAuthenticator,
XcodeTargetNames.wordPressAuthenticatorTests,
XcodeTargetNames.yosemiteTests
].map { .supportingProduct(forXcodeTarget: $0) }
}

Expand Down Expand Up @@ -441,17 +454,6 @@ enum XcodeSupport {
XcodeTargetNames.wordPressAuthenticator.asDependency,
]
),
.xcodeTarget(
XcodeTargetNames.yosemiteTests,
dependencies: [
"Codegen",
"Fakes",
"TestKit",
"WooFoundation",
"WordPressShared",
"Yosemite"
]
)
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import XCTest
/// Mock constants
///
private struct TestConstants {
static let fileURL = Bundle(for: AppSettingsStoreTests.self)
static let fileURL = Bundle.module
.url(forResource: "shipment-provider", withExtension: "plist")
static let customFileURL = Bundle(for: AppSettingsStoreTests.self)
static let customFileURL = Bundle.module
.url(forResource: "custom-shipment-provider", withExtension: "plist")
static let siteID: Int64 = 156590080
static let providerName = "post.at"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import UniformTypeIdentifiers
final class MediaImageExporterTests: XCTestCase {
func testExportingAnImageWithTypeHint() throws {
// Loads the test image into png data.
let mockData = UIImage(named: "image", in: Bundle(for: type(of: self)), compatibleWith: nil)!.pngData()
let mockData = UIImage(named: "image", in: .module, compatibleWith: nil)!.pngData()
let filename = "test"
let typeHint = UTType.jpeg.identifier
let mockImageSourceWriter = MockImageSourceWriter()
Expand All @@ -33,7 +33,7 @@ final class MediaImageExporterTests: XCTestCase {

func testExportingAnImageWithAnUnknownTypeHintUsesTheImageDataType() throws {
// Loads the test image into png data.
let mockData = UIImage(named: "image", in: Bundle(for: type(of: self)), compatibleWith: nil)!.pngData()
let mockData = UIImage(named: "image", in: .module, compatibleWith: nil)!.pngData()
let filename = "test"
let mockImageSourceWriter = MockImageSourceWriter()
let exporter = MediaImageExporter(data: mockData!,
Expand Down Expand Up @@ -81,7 +81,7 @@ final class MediaImageExporterTests: XCTestCase {

func test_export_sets_filename_and_altText_in_output_media() throws {
// Loads the test image into png data.
let mockData = UIImage(named: "image", in: Bundle(for: type(of: self)), compatibleWith: nil)!.pngData()
let mockData = UIImage(named: "image", in: .module, compatibleWith: nil)!.pngData()
let exporter = MediaImageExporter(data: mockData!,
filename: "test.png",
altText: "cool-image",
Expand Down
24 changes: 24 additions & 0 deletions Modules/Tests/YosemiteTests/YosemiteTests.xctestplan
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"configurations" : [
{
"id" : "8DE1C0FE-4F0F-4DFD-81F2-488314FE5B8B",
"name" : "Configuration 1",
"options" : {

}
}
],
"defaultOptions" : {

},
"testTargets" : [
{
"target" : {
"containerPath" : "container:",
"identifier" : "YosemiteTests",
"name" : "YosemiteTests"
}
}
],
"version" : 1
}
3 changes: 0 additions & 3 deletions WooCommerce.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions WooCommerce/WooCommerce.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -4087,7 +4087,7 @@
207823E22C5D18CE00025A59 /* PointOfSaleCardPresentPaymentConnectionSuccessAlertViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PointOfSaleCardPresentPaymentConnectionSuccessAlertViewModel.swift; sourceTree = "<group>"; };
207823E42C5D1B2F00025A59 /* PointOfSaleCardPresentPaymentConnectionSuccessAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PointOfSaleCardPresentPaymentConnectionSuccessAlertView.swift; sourceTree = "<group>"; };
207823E82C5D3A1700025A59 /* POSErrorExclamationMark.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = POSErrorExclamationMark.swift; sourceTree = "<group>"; };
207D2D222CFDCCBF00F79204 /* MockPOSOrderableItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MockPOSOrderableItem.swift; path = ../Yosemite/YosemiteTests/Mocks/MockPOSOrderableItem.swift; sourceTree = SOURCE_ROOT; };
207D2D222CFDCCBF00F79204 /* MockPOSOrderableItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MockPOSOrderableItem.swift; path = ../Modules/Tests/YosemiteTests/Mocks/MockPOSOrderableItem.swift; sourceTree = SOURCE_ROOT; };
207E71CA2C60F765008540FC /* MockPOSOrderService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockPOSOrderService.swift; sourceTree = "<group>"; };
2084B7A12C77693600EFBD2E /* CardPresentPaymentsModalButtonViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardPresentPaymentsModalButtonViewModelTests.swift; sourceTree = "<group>"; };
2084B7A32C776A6900EFBD2E /* XCTestCase+PropertyCount.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCTestCase+PropertyCount.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4988,8 +4988,8 @@
95B6C60D2D9DA99200E1A661 /* WPComMagicLinkRequestViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WPComMagicLinkRequestViewModel.swift; sourceTree = "<group>"; };
95B6C60F2D9DAD9600E1A661 /* WPComLoginGravatarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WPComLoginGravatarView.swift; sourceTree = "<group>"; };
95B6C6132DA18E3A00E1A661 /* WPComMagicLinkRequestViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WPComMagicLinkRequestViewModelTests.swift; sourceTree = "<group>"; };
A650BE842578E76600C655E0 /* MockStorageManager+Sample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "MockStorageManager+Sample.swift"; path = "../../../Yosemite/YosemiteTests/Mocks/MockStorageManager+Sample.swift"; sourceTree = "<group>"; };
A650BE852578E76600C655E0 /* MockStorageManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MockStorageManager.swift; path = ../../../Yosemite/YosemiteTests/Mocks/MockStorageManager.swift; sourceTree = "<group>"; };
A650BE842578E76600C655E0 /* MockStorageManager+Sample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "MockStorageManager+Sample.swift"; path = "../../../Modules/Tests/YosemiteTests/Mocks/MockStorageManager+Sample.swift"; sourceTree = "<group>"; };
A650BE852578E76600C655E0 /* MockStorageManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MockStorageManager.swift; path = ../../../Modules/Tests/YosemiteTests/Mocks/MockStorageManager.swift; sourceTree = "<group>"; };
A6557217258B7510008AE7CA /* OrderListCellViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderListCellViewModel.swift; sourceTree = "<group>"; };
A655725C258B91AE008AE7CA /* OrderListCellViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderListCellViewModelTests.swift; sourceTree = "<group>"; };
ABC35055F8AC8C8EB649F421 /* InPersonPaymentsUnavailableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InPersonPaymentsUnavailableView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -5049,7 +5049,7 @@
B5290ED8219B3FA900A6AF7F /* Date+Woo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Date+Woo.swift"; sourceTree = "<group>"; };
B53A569621123D3B000776C9 /* ResultsControllerUIKitTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultsControllerUIKitTests.swift; sourceTree = "<group>"; };
B53A569A21123E8E000776C9 /* MockTableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockTableView.swift; sourceTree = "<group>"; };
B53A56A32112483D000776C9 /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Constants.swift; path = ../../Yosemite/YosemiteTests/Settings/Constants.swift; sourceTree = "<group>"; };
B53A56A32112483D000776C9 /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Constants.swift; path = ../../Modules/Tests/YosemiteTests/Settings/Constants.swift; sourceTree = "<group>"; };
B53B3F36219C75AC00DF1EB6 /* OrderLoaderViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderLoaderViewController.swift; sourceTree = "<group>"; };
B53B3F38219C817800DF1EB6 /* UIStoryboard+Woo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIStoryboard+Woo.swift"; sourceTree = "<group>"; };
B53B898820D450AF00EDB467 /* SessionManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionManagerTests.swift; sourceTree = "<group>"; };
Expand Down
54 changes: 27 additions & 27 deletions WooCommerce/WooCommerceTests/UnitTests.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,8 @@
{
"target" : {
"containerPath" : "container:..\/Modules",
"identifier" : "WooFoundationTests",
"name" : "WooFoundationTests"
}
},
{
"target" : {
"containerPath" : "container:..\/Modules",
"identifier" : "NetworkingTests",
"name" : "NetworkingTests"
}
},
{
"target" : {
"containerPath" : "container:..\/Modules",
"identifier" : "ExperimentsTests",
"name" : "ExperimentsTests"
"identifier" : "WordPressSharedTests",
"name" : "WordPressSharedTests"
}
},
{
Expand All @@ -60,8 +46,8 @@
{
"target" : {
"containerPath" : "container:..\/Modules",
"identifier" : "WordPressSharedTests",
"name" : "WordPressSharedTests"
"identifier" : "WordPressSharedObjCTests",
"name" : "WordPressSharedObjCTests"
}
},
{
Expand All @@ -79,13 +65,6 @@
"name" : "WordPressAuthenticatorTests"
}
},
{
"target" : {
"containerPath" : "container:..\/Modules",
"identifier" : "WordPressSharedObjCTests",
"name" : "WordPressSharedObjCTests"
}
},
{
"skippedTests" : [
"InAppPurchaseStoreTests",
Expand All @@ -110,8 +89,29 @@
},
{
"target" : {
"containerPath" : "container:..\/Yosemite\/Yosemite.xcodeproj",
"identifier" : "B5C9DDFD2087FEC0006B910A",
"containerPath" : "container:..\/Modules",
"identifier" : "WooFoundationTests",
"name" : "WooFoundationTests"
}
},
{
"target" : {
"containerPath" : "container:..\/Modules",
"identifier" : "NetworkingTests",
"name" : "NetworkingTests"
}
},
{
"target" : {
"containerPath" : "container:..\/Modules",
"identifier" : "ExperimentsTests",
"name" : "ExperimentsTests"
}
},
{
"target" : {
"containerPath" : "container:..\/Modules",
"identifier" : "YosemiteTests",
"name" : "YosemiteTests"
}
}
Expand Down
Loading