From 204f045f0d3010804485271a08d786aae671dd7c Mon Sep 17 00:00:00 2001 From: Tyler Thompson Date: Fri, 3 Feb 2023 22:07:34 -0700 Subject: [PATCH 1/8] [fix-test-discovery] - Maybe exposing it the to the Objc runtime explicitly will help - TT --- Sources/CucumberSwift/Runner/CucumberTest.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/CucumberSwift/Runner/CucumberTest.swift b/Sources/CucumberSwift/Runner/CucumberTest.swift index 6ce773f1..92b29e0a 100644 --- a/Sources/CucumberSwift/Runner/CucumberTest.swift +++ b/Sources/CucumberSwift/Runner/CucumberTest.swift @@ -9,7 +9,7 @@ import Foundation import XCTest -public final class CucumberTest: XCTestCase { +@objc open class CucumberTest: XCTestCase { override public class var defaultTestSuite: XCTestSuite { Cucumber.shared.reporters.forEach { $0.testSuiteStarted(at: Date()) } From f48025b089044188a3261199a8eb8ea29285017b Mon Sep 17 00:00:00 2001 From: Tyler Thompson Date: Fri, 3 Feb 2023 22:12:57 -0700 Subject: [PATCH 2/8] [fix-test-discovery] - My swizzler probably does not work - TT --- Sources/CucumberSwift/Runner/Cucumber.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/CucumberSwift/Runner/Cucumber.swift b/Sources/CucumberSwift/Runner/Cucumber.swift index 4e1f6bd1..09138e88 100644 --- a/Sources/CucumberSwift/Runner/Cucumber.swift +++ b/Sources/CucumberSwift/Runner/Cucumber.swift @@ -91,6 +91,7 @@ import CucumberSwift_ObjC } @objc public static func Load() { + print("LOAD METHOD CALLED") guard let testSuiteInit = class_getClassMethod(XCTestSuite.self, #selector(XCTestSuite.init(forTestCaseWithName:))), let swizzledInit = class_getClassMethod(self, #selector(Cucumber.testCaseWith(name:))) else { return From 81030f2d9496fc9024a02b0d3f00d2a355c345ea Mon Sep 17 00:00:00 2001 From: Tyler Thompson Date: Fri, 3 Feb 2023 22:19:19 -0700 Subject: [PATCH 3/8] [fix-test-discovery] - Can I get clever with globals? - TT --- Sources/CucumberSwift/Runner/Cucumber.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/CucumberSwift/Runner/Cucumber.swift b/Sources/CucumberSwift/Runner/Cucumber.swift index 09138e88..852869dc 100644 --- a/Sources/CucumberSwift/Runner/Cucumber.swift +++ b/Sources/CucumberSwift/Runner/Cucumber.swift @@ -14,9 +14,11 @@ import CucumberSwiftExpressions import CucumberSwift_ObjC #endif +let sharedCucumber = Cucumber() + @objc public class Cucumber: NSObject { static var shared: Cucumber = { - Cucumber() + sharedCucumber }() var features = [Feature]() @@ -91,7 +93,6 @@ import CucumberSwift_ObjC } @objc public static func Load() { - print("LOAD METHOD CALLED") guard let testSuiteInit = class_getClassMethod(XCTestSuite.self, #selector(XCTestSuite.init(forTestCaseWithName:))), let swizzledInit = class_getClassMethod(self, #selector(Cucumber.testCaseWith(name:))) else { return From 8059d1109566d3f941a77567a990315eff69891e Mon Sep 17 00:00:00 2001 From: Tyler Thompson Date: Fri, 3 Feb 2023 22:20:46 -0700 Subject: [PATCH 4/8] [fix-test-discovery] - print so I know if it worked - TT --- Sources/CucumberSwift/Runner/Cucumber.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/CucumberSwift/Runner/Cucumber.swift b/Sources/CucumberSwift/Runner/Cucumber.swift index 852869dc..2e0c4bfd 100644 --- a/Sources/CucumberSwift/Runner/Cucumber.swift +++ b/Sources/CucumberSwift/Runner/Cucumber.swift @@ -85,6 +85,7 @@ let sharedCucumber = Cucumber() override public init() { super.init() XCTestObservationCenter.shared.addTestObserver(self) + print("INIT CALLED") } init(withString string: String) { From 951bdd3a48900e24d528f0ac65814e2a06dbfdb5 Mon Sep 17 00:00:00 2001 From: Tyler Thompson Date: Fri, 3 Feb 2023 22:48:27 -0700 Subject: [PATCH 5/8] [fix-test-discovery] - Force test discovery by inheriting from CucumberTest - TT --- CucumberSwift.xcodeproj/project.pbxproj | 36 ------------------- Package.swift | 11 ++---- Sources/CucumberSwift/CucumberSwift.h | 17 --------- Sources/CucumberSwift/Runner/Cucumber.swift | 16 +-------- .../CucumberSwift/Runner/CucumberTest.swift | 2 +- Sources/Obj-C BS/Include/NSObjectLoadable.h | 19 ---------- Sources/Obj-C BS/Include/XCTestHooks.h | 17 --------- Sources/Obj-C BS/NSObjectLoadable.m | 18 ---------- Sources/Obj-C BS/XCTestHooks.m | 20 ----------- .../CucumberSwiftConsumerTests.swift | 7 ++-- .../Extensions/CucumberExtensions.swift | 1 + 11 files changed, 7 insertions(+), 157 deletions(-) delete mode 100644 Sources/CucumberSwift/CucumberSwift.h delete mode 100644 Sources/Obj-C BS/Include/NSObjectLoadable.h delete mode 100644 Sources/Obj-C BS/Include/XCTestHooks.h delete mode 100644 Sources/Obj-C BS/NSObjectLoadable.m delete mode 100644 Sources/Obj-C BS/XCTestHooks.m diff --git a/CucumberSwift.xcodeproj/project.pbxproj b/CucumberSwift.xcodeproj/project.pbxproj index b36f84ff..d294870a 100644 --- a/CucumberSwift.xcodeproj/project.pbxproj +++ b/CucumberSwift.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 1D1648DB245A7549000CA612 /* XCTestHooks.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D1648DA245A7549000CA612 /* XCTestHooks.m */; }; 1DA7619923933BCB001CBA5B /* RunWithLineNumberTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DA7619823933BCB001CBA5B /* RunWithLineNumberTests.swift */; }; 1DA7619B23933F18001CBA5B /* Positionable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DA7619A23933F18001CBA5B /* Positionable.swift */; }; 1DA7619D2393C5AB001CBA5B /* DocString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DA7619C2393C5AB001CBA5B /* DocString.swift */; }; @@ -52,7 +51,6 @@ AD9E15CD21176FC500FB5B6C /* StringReaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD9E15CC21176FC500FB5B6C /* StringReaderTests.swift */; }; AD9EB46A2079CF87002494C0 /* CucumberSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD9EB4602079CF87002494C0 /* CucumberSwift.framework */; }; AD9EB46F2079CF87002494C0 /* CucumberSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD9EB46E2079CF87002494C0 /* CucumberSwiftTests.swift */; }; - AD9EB4712079CF87002494C0 /* CucumberSwift.h in Headers */ = {isa = PBXBuildFile; fileRef = AD9EB4632079CF87002494C0 /* CucumberSwift.h */; settings = {ATTRIBUTES = (Public, ); }; }; AD9EB47B2079CFA1002494C0 /* Cucumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD9EB47A2079CFA1002494C0 /* Cucumber.swift */; }; AD9EB47D2079D280002494C0 /* Feature.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD9EB47C2079D280002494C0 /* Feature.swift */; }; AD9EB47F2079D28E002494C0 /* Step.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD9EB47E2079D28E002494C0 /* Step.swift */; }; @@ -112,9 +110,6 @@ CAB20B3E24CCF6B20024C703 /* DSLRuleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAB20B3D24CCF6B20024C703 /* DSLRuleTests.swift */; }; CADD26DD265B1D1F00EE8707 /* JSONReporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = CADD26DC265B1D1F00EE8707 /* JSONReporter.swift */; }; CAEE41EE28B324BF000D4703 /* CucumberSwiftExpressions in Frameworks */ = {isa = PBXBuildFile; productRef = CAEE41ED28B324BF000D4703 /* CucumberSwiftExpressions */; }; - CAF51ED2255874D20095A5C4 /* XCTestHooks.h in Headers */ = {isa = PBXBuildFile; fileRef = CAF51EC5255873E90095A5C4 /* XCTestHooks.h */; settings = {ATTRIBUTES = (Public, ); }; }; - CAF51ED9255877FC0095A5C4 /* NSObjectLoadable.m in Sources */ = {isa = PBXBuildFile; fileRef = CAF51ED8255877FC0095A5C4 /* NSObjectLoadable.m */; }; - CAF51EE2255878C80095A5C4 /* NSObjectLoadable.h in Headers */ = {isa = PBXBuildFile; fileRef = CAF51ED7255877ED0095A5C4 /* NSObjectLoadable.h */; settings = {ATTRIBUTES = (Public, ); }; }; CAF87A55281453EF00F7946A /* CucumberSwift.docc in Sources */ = {isa = PBXBuildFile; fileRef = CAF87A54281453EF00F7946A /* CucumberSwift.docc */; }; /* End PBXBuildFile section */ @@ -143,7 +138,6 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 1D1648DA245A7549000CA612 /* XCTestHooks.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XCTestHooks.m; sourceTree = ""; }; 1DA7619823933BCB001CBA5B /* RunWithLineNumberTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunWithLineNumberTests.swift; sourceTree = ""; }; 1DA7619A23933F18001CBA5B /* Positionable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Positionable.swift; sourceTree = ""; }; 1DA7619C2393C5AB001CBA5B /* DocString.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DocString.swift; sourceTree = ""; }; @@ -186,7 +180,6 @@ AD9E15CA21176F8D00FB5B6C /* StringReader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringReader.swift; sourceTree = ""; }; AD9E15CC21176FC500FB5B6C /* StringReaderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringReaderTests.swift; sourceTree = ""; }; AD9EB4602079CF87002494C0 /* CucumberSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CucumberSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - AD9EB4632079CF87002494C0 /* CucumberSwift.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CucumberSwift.h; sourceTree = ""; }; AD9EB4642079CF87002494C0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; AD9EB4692079CF87002494C0 /* CucumberSwiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CucumberSwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; AD9EB46E2079CF87002494C0 /* CucumberSwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CucumberSwiftTests.swift; sourceTree = ""; }; @@ -252,9 +245,6 @@ CABED02C256A17F2001E92C1 /* CucumberSwift.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = CucumberSwift.xctestplan; sourceTree = ""; }; CADD26DC265B1D1F00EE8707 /* JSONReporter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONReporter.swift; sourceTree = ""; }; CAF51EA42557B1C70095A5C4 /* Package.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = SOURCE_ROOT; }; - CAF51EC5255873E90095A5C4 /* XCTestHooks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XCTestHooks.h; sourceTree = ""; }; - CAF51ED7255877ED0095A5C4 /* NSObjectLoadable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSObjectLoadable.h; sourceTree = ""; }; - CAF51ED8255877FC0095A5C4 /* NSObjectLoadable.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NSObjectLoadable.m; sourceTree = ""; }; CAF87A54281453EF00F7946A /* CucumberSwift.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = CucumberSwift.docc; sourceTree = ""; }; /* End PBXFileReference section */ @@ -397,7 +387,6 @@ AD9EB4622079CF87002494C0 /* Sources */ = { isa = PBXGroup; children = ( - CAF51EEB25587AFC0095A5C4 /* Obj-C BS */, CAF51EAE2557B35C0095A5C4 /* CucumberSwift */, CAF51EA42557B1C70095A5C4 /* Package.swift */, ); @@ -639,32 +628,12 @@ CA5A7C3720FC2B0A00F4564A /* Extensions */, CA5A7C3620FC2AF600F4564A /* Gherkin */, CA612FAD24CD298D00A7BBCD /* Generated */, - AD9EB4632079CF87002494C0 /* CucumberSwift.h */, AD9EB4642079CF87002494C0 /* Info.plist */, AD73CEF72222ECD8002BF7C0 /* TestingExtensions.swift */, ); path = CucumberSwift; sourceTree = ""; }; - CAF51EEB25587AFC0095A5C4 /* Obj-C BS */ = { - isa = PBXGroup; - children = ( - 1D1648DA245A7549000CA612 /* XCTestHooks.m */, - CAF51ED8255877FC0095A5C4 /* NSObjectLoadable.m */, - CAF51EEC25587B4C0095A5C4 /* Include */, - ); - path = "Obj-C BS"; - sourceTree = ""; - }; - CAF51EEC25587B4C0095A5C4 /* Include */ = { - isa = PBXGroup; - children = ( - CAF51EC5255873E90095A5C4 /* XCTestHooks.h */, - CAF51ED7255877ED0095A5C4 /* NSObjectLoadable.h */, - ); - path = Include; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -672,9 +641,6 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - AD9EB4712079CF87002494C0 /* CucumberSwift.h in Headers */, - CAF51ED2255874D20095A5C4 /* XCTestHooks.h in Headers */, - CAF51EE2255878C80095A5C4 /* NSObjectLoadable.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -919,7 +885,6 @@ CA1C47F32634C6D9008D8E12 /* FeatureHook.swift in Sources */, AD017234211671D200FBC9AF /* Method.swift in Sources */, ADAA738E20A9356000D2344C /* CollectionExtensions.swift in Sources */, - CAF51ED9255877FC0095A5C4 /* NSObjectLoadable.m in Sources */, 1DA761A2239A7A74001CBA5B /* ASTToken.swift in Sources */, AD9EB47B2079CFA1002494C0 /* Cucumber.swift in Sources */, AD9EB4832079D606002494C0 /* Scenario.swift in Sources */, @@ -945,7 +910,6 @@ AD9EB47F2079D28E002494C0 /* Step.swift in Sources */, 5AE2C0C120FEA958000DDD48 /* ScenarioOutlineParser.swift in Sources */, CA097281264F4D5100573DA5 /* CucumberTestObserver.swift in Sources */, - 1D1648DB245A7549000CA612 /* XCTestHooks.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Package.swift b/Package.swift index fc33e95d..9befbdd2 100644 --- a/Package.swift +++ b/Package.swift @@ -10,7 +10,7 @@ let package = Package( // Products define the executables and libraries a package produces, and make them visible to other packages. .library( name: "CucumberSwift", - targets: ["CucumberSwift_ObjC", "CucumberSwift"]) + targets: ["CucumberSwift"]) ], dependencies: [ .package(url: "https://github.com/Tyler-Keith-Thompson/CucumberSwiftExpressions.git", from: "0.0.8"), @@ -19,17 +19,10 @@ let package = Package( targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages this package depends on. - .target( - name: "CucumberSwift_ObjC", - dependencies: [], - path: "Sources/Obj-C BS", - exclude: ["Gherkin/XCode-Specific"], // SPM shouldn't vend the syntax highlighting files - publicHeadersPath: "Include"), .target( name: "CucumberSwift", dependencies: [ - "CucumberSwiftExpressions", - "CucumberSwift_ObjC" + "CucumberSwiftExpressions" ], path: "Sources/CucumberSwift", exclude: ["Info.plist"], diff --git a/Sources/CucumberSwift/CucumberSwift.h b/Sources/CucumberSwift/CucumberSwift.h deleted file mode 100644 index 689c74da..00000000 --- a/Sources/CucumberSwift/CucumberSwift.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// CucumberSwift.h -// CucumberSwift -// -// Created by Tyler Thompson on 4/7/18. -// Copyright © 2018 Tyler Thompson. All rights reserved. -// - -#import -#import "XCTestHooks.h" -#import "NSObjectLoadable.h" - -//! Project version number for CucumberSwift. -FOUNDATION_EXPORT double CucumberSwiftVersionNumber; - -//! Project version string for CucumberSwift. -FOUNDATION_EXPORT const unsigned char CucumberSwiftVersionString[]; diff --git a/Sources/CucumberSwift/Runner/Cucumber.swift b/Sources/CucumberSwift/Runner/Cucumber.swift index 2e0c4bfd..5b30bf53 100644 --- a/Sources/CucumberSwift/Runner/Cucumber.swift +++ b/Sources/CucumberSwift/Runner/Cucumber.swift @@ -10,16 +10,8 @@ import Foundation import XCTest import CucumberSwiftExpressions -#if canImport(CucumberSwift_ObjC) -import CucumberSwift_ObjC -#endif - -let sharedCucumber = Cucumber() - @objc public class Cucumber: NSObject { - static var shared: Cucumber = { - sharedCucumber - }() + static var shared = Cucumber() var features = [Feature]() var currentStep: Step? @@ -276,9 +268,3 @@ let sharedCucumber = Cucumber() } } } - -@nonobjc extension XCTestCase { - @objc override public class func beforeParallelization() { - Cucumber.Load() - } -} diff --git a/Sources/CucumberSwift/Runner/CucumberTest.swift b/Sources/CucumberSwift/Runner/CucumberTest.swift index 92b29e0a..def171d9 100644 --- a/Sources/CucumberSwift/Runner/CucumberTest.swift +++ b/Sources/CucumberSwift/Runner/CucumberTest.swift @@ -9,7 +9,7 @@ import Foundation import XCTest -@objc open class CucumberTest: XCTestCase { +open class CucumberTest: XCTestCase { override public class var defaultTestSuite: XCTestSuite { Cucumber.shared.reporters.forEach { $0.testSuiteStarted(at: Date()) } diff --git a/Sources/Obj-C BS/Include/NSObjectLoadable.h b/Sources/Obj-C BS/Include/NSObjectLoadable.h deleted file mode 100644 index 6df5a0f3..00000000 --- a/Sources/Obj-C BS/Include/NSObjectLoadable.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// NSObjectLoadable.h -// CucumberSwift -// -// Created by Tyler Thompson on 11/8/20. -// Copyright © 2020 Tyler Thompson. All rights reserved. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface NSObject (NSObjectLoadable) - -+ (void) beforeParallelization; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Sources/Obj-C BS/Include/XCTestHooks.h b/Sources/Obj-C BS/Include/XCTestHooks.h deleted file mode 100644 index eeb30876..00000000 --- a/Sources/Obj-C BS/Include/XCTestHooks.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// XCTestHooks.h -// CucumberSwift -// -// Created by Tyler Thompson on 11/8/20. -// Copyright © 2020 Tyler Thompson. All rights reserved. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface TestLoader : XCTestSuite - + (void) load; -@end - -NS_ASSUME_NONNULL_END diff --git a/Sources/Obj-C BS/NSObjectLoadable.m b/Sources/Obj-C BS/NSObjectLoadable.m deleted file mode 100644 index 1ec84d16..00000000 --- a/Sources/Obj-C BS/NSObjectLoadable.m +++ /dev/null @@ -1,18 +0,0 @@ -// -// NSObjectLoadable.m -// CucumberSwift -// -// Created by Tyler Thompson on 11/8/20. -// Copyright © 2020 Tyler Thompson. All rights reserved. -// - -#import -#import "NSObjectLoadable.h" - -@implementation NSObject (NSObjectLoadable) - -+ (void) beforeParallelization -{ -} - -@end diff --git a/Sources/Obj-C BS/XCTestHooks.m b/Sources/Obj-C BS/XCTestHooks.m deleted file mode 100644 index dce4b6e3..00000000 --- a/Sources/Obj-C BS/XCTestHooks.m +++ /dev/null @@ -1,20 +0,0 @@ -// -// XCTestHooks.m -// CucumberSwift -// -// Created by Tyler Thompson on 4/29/20. -// Copyright © 2020 Tyler Thompson. All rights reserved. -// - -#import - -#import "XCTestHooks.h" -#import "NSObjectLoadable.h" - -@implementation TestLoader - -+ (void)load { - [self beforeParallelization]; -} - -@end diff --git a/Tests/CucumberSwiftConsumerTests/CucumberSwiftConsumerTests.swift b/Tests/CucumberSwiftConsumerTests/CucumberSwiftConsumerTests.swift index d672531f..64be2db9 100644 --- a/Tests/CucumberSwiftConsumerTests/CucumberSwiftConsumerTests.swift +++ b/Tests/CucumberSwiftConsumerTests/CucumberSwiftConsumerTests.swift @@ -59,11 +59,8 @@ extension CucumberTest { extension Cucumber: StepImplementation { public var bundle: Bundle { - #if canImport(CucumberSwift_ObjC) - return Bundle(url: Bundle.module.bundleURL.deletingLastPathComponent().appendingPathComponent("CucumberSwift_CucumberSwiftConsumerTests.bundle"))! - #else - return Bundle(for: Me.self) - #endif + class TestDiscovery: CucumberTest { } + return Bundle(for: TestDiscovery.self) } public func setupSteps() { diff --git a/Tests/CucumberSwiftTests/Extensions/CucumberExtensions.swift b/Tests/CucumberSwiftTests/Extensions/CucumberExtensions.swift index 4dd52b63..9bedd909 100644 --- a/Tests/CucumberSwiftTests/Extensions/CucumberExtensions.swift +++ b/Tests/CucumberSwiftTests/Extensions/CucumberExtensions.swift @@ -7,6 +7,7 @@ // import Foundation +import XCTest @testable import CucumberSwift extension Cucumber { From 1c8a9c8588c94f9a0687078ccb045d89f1b7b781 Mon Sep 17 00:00:00 2001 From: Tyler Thompson Date: Fri, 3 Feb 2023 22:52:20 -0700 Subject: [PATCH 6/8] [fix-test-discovery] - Update docs to show new requirement of inheriting from CucumberTest - TT --- .../Resources/Installation/SetupSteps.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/CucumberSwift/CucumberSwift.docc/Resources/Installation/SetupSteps.swift b/Sources/CucumberSwift/CucumberSwift.docc/Resources/Installation/SetupSteps.swift index 375a80db..8f40ee09 100644 --- a/Sources/CucumberSwift/CucumberSwift.docc/Resources/Installation/SetupSteps.swift +++ b/Sources/CucumberSwift/CucumberSwift.docc/Resources/Installation/SetupSteps.swift @@ -3,8 +3,8 @@ import CucumberSwift extension Cucumber: StepImplementation { public var bundle: Bundle { - class Findme { } - return Bundle(for: Findme.self) //This is just my shortcut way of identifying the test bundle, you do you. This bundle needs to contain the folder reference we added + class TestExplorer: CucumberTest { } // !! Make sure to inherit from CucumberTest + return Bundle(for: TestExplorer.self) // !! Important, this is what allows Cucumber Tests to be discovered. } public func setupSteps() { From 32493f88ed4371c534072897e22fc401cd18b35d Mon Sep 17 00:00:00 2001 From: Tyler Thompson Date: Fri, 3 Feb 2023 22:55:26 -0700 Subject: [PATCH 7/8] [fix-test-discovery] - Rev major version and update a couple more docs - TT --- CucumberSwift.podspec | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CucumberSwift.podspec b/CucumberSwift.podspec index 6b759c8a..f3d6cdbf 100644 --- a/CucumberSwift.podspec +++ b/CucumberSwift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'CucumberSwift' - s.version = '3.3.26' + s.version = '4.0.0' s.summary = 'A lightweight swift only cucumber implementation.' s.description = <<-DESC diff --git a/README.md b/README.md index 6db60714..08ad6403 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ CucumberSwift is a lightweight Swift only Cucumber implementation for iOS, tvOS, NOTE: WatchOS support coming soon! -* [Installation](https://github.com/Tyler-Keith-Thompson/CucumberSwift/wiki/installation) -* [Getting Started](https://github.com/Tyler-Keith-Thompson/CucumberSwift/wiki) +* [Docs](https://tyler-keith-thompson.github.io/CucumberSwift/documentation/cucumberswift/) +* [Getting Started](https://tyler-keith-thompson.github.io/CucumberSwift/tutorials/tutorial-table-of-contents/) * [XCTest Integration](https://github.com/Tyler-Keith-Thompson/CucumberSwift/wiki/xctest-integration) * [Contributing](/CONTRIBUTING.md) From 3b11df305a604bb33f41db73a480f5887454502e Mon Sep 17 00:00:00 2001 From: Tyler Thompson Date: Fri, 3 Feb 2023 22:57:33 -0700 Subject: [PATCH 8/8] [fix-test-discovery] - Because codecov is broken, do not fail CI if upload fails - TT --- .github/workflows/PR_CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PR_CI.yml b/.github/workflows/PR_CI.yml index e71d4848..9d457201 100644 --- a/.github/workflows/PR_CI.yml +++ b/.github/workflows/PR_CI.yml @@ -12,7 +12,7 @@ jobs: - uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true + fail_ci_if_error: false build_for_package_managers: needs: test