-
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
Conversation
release_notes.md
Outdated
@@ -1,5 +1,6 @@ | |||
## next (unreleased) | |||
- [#952](https://github.com/Flank/flank/pull/952) Fix version printing on Flank release | |||
- [#937](https://github.com/Flank/flank/pull/968) ([sloox](https://github.com/Sloox)) |
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.
Missing message inside
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.
@@ -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(this.xctestrunFile.isNullOrBlank() or this.xctestrunZip.isNullOrBlank()) |
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.
you could skip this
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.
release_notes.md
Outdated
@@ -1,5 +1,6 @@ | |||
## next (unreleased) | |||
- [#952](https://github.com/Flank/flank/pull/952) Fix version printing on Flank release | |||
- [#937](https://github.com/Flank/flank/pull/968) Improve error message on IOS when test or xctestrun-file not found ([sloox](https://github.com/Sloox)) |
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.
- [#937](https://github.com/Flank/flank/pull/968) Improve error message on IOS when test or xctestrun-file not found ([sloox](https://github.com/Sloox)) | |
- [#937](https://github.com/Flank/flank/pull/968) Improve error message on iOS when test or xctestrun-file not found ([sloox](https://github.com/Sloox)) |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
xctestrunFile is not nullable so .orEmpty()
is redundant here.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
isBlank()
should be enough in both cases
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
👍 @adamfilipow92 we can consider it in another issue. This PR name is Improve error message on IOS
not Android
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.
Right, my mistake. I update my comment to iOS version.
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.
Shall i create a ticket for this @jan-gogo @adamfilipowicz92 ?
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.
@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.
Improve error message on IOS when test or xctestrun-file not found
Fixes #937
Test Plan
Checklist