-
Notifications
You must be signed in to change notification settings - Fork 119
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
Improve error message on IOS #968
Changes from 5 commits
4258f24
1a5ad2b
367d6ce
73ac521
e6af1f5
ec63b20
9dfbb82
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 |
---|---|---|
|
@@ -62,7 +62,7 @@ IosArgs | |
private fun IosArgs.calculateShardChunks() = if (disableSharding) | ||
listOf(emptyList()) else | ||
ArgsHelper.calculateShards( | ||
filteredTests = filterTests(findTestNames(xctestrunFile), testTargets) | ||
filteredTests = filterTests(findTestNames(xctestrunFile.orEmpty()), testTargets) | ||
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. xctestrunFile is not nullable so |
||
.distinct() | ||
.map { FlankTestMethod(it, ignored = false) }, | ||
args = this | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ import ftl.util.IncompatibleTestDimensionError | |
fun IosArgs.validate() { | ||
assertXcodeSupported() | ||
assertDevicesSupported() | ||
assertTestTypes() | ||
assertMaxTestShards() | ||
} | ||
private fun IosArgs.assertMaxTestShards() { this.maxTestShards | ||
|
@@ -17,6 +18,10 @@ private fun IosArgs.assertMaxTestShards() { this.maxTestShards | |
"max-test-shards must be >= ${IArgs.AVAILABLE_PHYSICAL_SHARD_COUNT_RANGE.first} and <= ${IArgs.AVAILABLE_PHYSICAL_SHARD_COUNT_RANGE.last}, or -1. But current is $maxTestShards" | ||
) | ||
} | ||
private fun IosArgs.assertTestTypes() { | ||
if (xctestrunFile.isNullOrBlank() or xctestrunZip.isNullOrBlank()) | ||
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.
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. In this file, we have two logic operator convention now. Look: private fun IosArgs.assertMaxTestShards() { this.maxTestShards
if (
maxTestShards !in IArgs.AVAILABLE_PHYSICAL_SHARD_COUNT_RANGE &&
maxTestShards != -1
) throw FlankConfigurationError(
"max-test-shards must be >= ${IArgs.AVAILABLE_PHYSICAL_SHARD_COUNT_RANGE.first} and <= ${IArgs.AVAILABLE_PHYSICAL_SHARD_COUNT_RANGE.last}, or -1. But current is $maxTestShards"
)
}
private fun IosArgs.assertTestTypes() {
if (xctestrunFile.isNullOrBlank() or xctestrunZip.isNullOrBlank())
throw FlankConfigurationError("Both of following options must be specified [test, xctestrun-file].")
}
private fun IosArgs.assertXcodeSupported() = when {
xcodeVersion == null -> Unit
IosCatalog.supportedXcode(xcodeVersion, project) -> Unit
else -> throw IncompatibleTestDimensionError(("Xcode $xcodeVersion is not a supported Xcode version"))
}
Maybe we should decide and keep only one? 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. 👍 @adamfilipow92 we can consider it in another issue. This PR name is 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. Right, my mistake. I update my comment to iOS version. 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. Shall i create a ticket for this @jan-gogo @adamfilipowicz92 ? 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. @Sloox hehe, ofc not if it is only about style convention ;). It is minor for me, you can leave it as-is if you find it readable or fix if you want. |
||
throw FlankConfigurationError("Both of following options must be specified [test, xctestrun-file].") | ||
} | ||
private fun IosArgs.assertXcodeSupported() = when { | ||
xcodeVersion == null -> Unit | ||
IosCatalog.supportedXcode(xcodeVersion, project) -> Unit | ||
|
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.