-
-
Notifications
You must be signed in to change notification settings - Fork 126
[iOS] Added Support for XCResult #686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
553ca79
1f09d59
4794292
c0c66c3
7d64884
e5f73c9
40361b2
fe05703
dcbb081
668ff5f
66d5239
ac5aeab
8488d9f
2e86c53
8630afe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,11 +55,23 @@ class ConfigurationFactory( | |
| is VendorConfiguration.IOSConfiguration -> { | ||
| // Any relative path specified in Marathonfile should be resolved against the directory Marathonfile is in | ||
| val resolvedDerivedDataDir = marathonfileDir.resolve(configuration.vendorConfiguration.derivedDataDir) | ||
| val finalXCTestRunPath = configuration.vendorConfiguration.xctestrunPath?.resolveAgainst(marathonfileDir) | ||
| ?: fileListProvider | ||
| val resolvedResultBundlePath = marathonfileDir.resolve(configuration.vendorConfiguration.xcResultBundlePath) | ||
|
|
||
| // Adding support for Test Plan | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove the comment. It doesn't make sense after we merge this. |
||
| val testPlanName = configuration.vendorConfiguration.xcTestPlan | ||
|
|
||
| var finalXCTestRunPath = if(!testPlanName.isNullOrEmpty()) { | ||
| fileListProvider | ||
| .fileList(resolvedDerivedDataDir) | ||
| .firstOrNull { it.extension == "xctestrun" } | ||
| ?: throw ConfigurationException("Unable to find an xctestrun file in derived data folder") | ||
| .firstOrNull { it.extension == "xctestrun" && it.name.contains("$testPlanName") } ?: throw ConfigurationException("Unable to find matching TestPlan. Please recheck if testplan is enabled") | ||
|
||
| } else { | ||
| configuration.vendorConfiguration.xctestrunPath?.resolveAgainst(marathonfileDir) | ||
| ?: fileListProvider | ||
| .fileList(resolvedDerivedDataDir) | ||
| .firstOrNull { it.extension == "xctestrun" } | ||
| ?: throw ConfigurationException("Unable to find an xctestrun file in derived data folder") | ||
| } | ||
|
|
||
| val optionalSourceRoot = configuration.vendorConfiguration.sourceRoot.resolveAgainst(marathonfileDir) | ||
| val optionalDevices = configuration.vendorConfiguration.devicesFile?.resolveAgainst(marathonfileDir) | ||
| ?: marathonfileDir.resolve("Marathondevices") | ||
|
|
@@ -71,6 +83,7 @@ class ConfigurationFactory( | |
| sourceRoot = optionalSourceRoot, | ||
| devicesFile = optionalDevices, | ||
| knownHostsPath = optionalKnownHostsPath, | ||
| xcResultBundlePath = resolvedResultBundlePath | ||
| ) | ||
| } | ||
| VendorConfiguration.StubVendorConfiguration -> configuration.vendorConfiguration | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ import com.malinskiy.marathon.analytics.internal.pub.Track | |
| import com.malinskiy.marathon.analytics.internal.sub.TrackerInternal | ||
| import com.malinskiy.marathon.config.Configuration | ||
| import com.malinskiy.marathon.config.LogicalConfigurationValidator | ||
| import com.malinskiy.marathon.config.vendor.VendorConfiguration | ||
| import com.malinskiy.marathon.device.DeviceProvider | ||
| import com.malinskiy.marathon.exceptions.NoDevicesException | ||
| import com.malinskiy.marathon.exceptions.NoTestCasesFoundException | ||
|
|
@@ -79,6 +80,10 @@ class Marathon( | |
| val tests = applyTestFilters(parsedTests) | ||
| val shard = prepareTestShard(tests, analytics) | ||
|
|
||
| log.info("\n\n\n **** Marathon File Params **** \n") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a no-no: configuration might contain sensitive credentials, and we can't print them to the stdout
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you really want to do this then we need to implement some kind of masking for sensitive fields |
||
| log.info("${configuration}") | ||
| log.info("\n\n\n") | ||
|
|
||
| log.info("Scheduling ${tests.size} tests") | ||
| log.debug(tests.joinToString(", ") { it.toTestName() }) | ||
| val currentCoroutineContext = coroutineContext | ||
|
|
@@ -146,7 +151,9 @@ class Marathon( | |
| } | ||
| configuration.filteringConfiguration.allowlist.forEach { tests = it.toTestFilter().filter(tests) } | ||
| configuration.filteringConfiguration.blocklist.forEach { tests = it.toTestFilter().filterNot(tests) } | ||
| return tests | ||
| val iosConfig = configuration.vendorConfiguration as? VendorConfiguration.IOSConfiguration | ||
|
|
||
| return tests.filter { it.tags.contains(iosConfig?.xcTestRunnerTag) } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should just be an annotation filter, no vendor-specific logic in the core |
||
| } | ||
|
|
||
| private fun prepareTestShard(tests: List<Test>, analytics: Analytics): TestShard { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,8 @@ data class Test( | |
| val pkg: String, | ||
| val clazz: String, | ||
| val method: String, | ||
| val metaProperties: Collection<MetaProperty> | ||
| val metaProperties: Collection<MetaProperty>, | ||
| val tags: Collection<String> = emptyList() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MetaProprety is an abstraction over tags, annotations and so on. We should just reuse MetaProperty here
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refer: |
||
| ) { | ||
| override fun equals(other: Any?): Boolean { | ||
| if (this === other) return true | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| { | ||
| "configurations" : [ | ||
| { | ||
| "id" : "F89CABE9-488A-423F-9C0B-ABBA5860F98F", | ||
| "name" : "Configuration 1", | ||
| "options" : { | ||
|
|
||
| } | ||
| } | ||
| ], | ||
| "defaultOptions" : { | ||
| "codeCoverage" : false, | ||
| "targetForVariableExpansion" : { | ||
| "containerPath" : "container:sample-app.xcodeproj", | ||
| "identifier" : "1271DC9521351C6D002B8D3E", | ||
| "name" : "sample-app" | ||
| } | ||
| }, | ||
| "testTargets" : [ | ||
| { | ||
| "skippedTests" : [ | ||
| "MoreTests\/testDismissModal()", | ||
| "SkippedSuite", | ||
| "StoryboardTests\/testDisabledButton()" | ||
| ], | ||
| "target" : { | ||
| "containerPath" : "container:sample-app.xcodeproj", | ||
| "identifier" : "1271DCB421351C6D002B8D3E", | ||
| "name" : "sample-appUITests" | ||
| } | ||
| } | ||
| ], | ||
| "version" : 1 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "configurations" : [ | ||
| { | ||
| "id" : "BD75184A-5BEE-4C42-A2E2-3B453AFFCC77", | ||
| "name" : "Configuration 1", | ||
| "options" : { | ||
|
|
||
| } | ||
| } | ||
| ], | ||
| "defaultOptions" : { | ||
|
|
||
| }, | ||
| "testTargets" : [ | ||
| { | ||
| "target" : { | ||
| "containerPath" : "container:sample-app.xcodeproj", | ||
| "identifier" : "686DC94628E1DAA800A49EC9", | ||
| "name" : "sample-appTests" | ||
| } | ||
| } | ||
| ], | ||
| "version" : 1 | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move the docs info to the https://github.com/MarathonLabs/marathon/blob/develop/docs/_posts/2018-11-19-ios.md. They're automatically published at https://marathonlabs.github.io/marathon/