-
Notifications
You must be signed in to change notification settings - Fork 118
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
feat: Parameterized tests options #2046
Conversation
Timestamp: 2021-07-01 15:44:33 |
@flank-it |
Integration tests succeed for all OSes ✅ |
ce7a1d1
to
f68b059
Compare
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.
It would be also worth to add possible values of --parameterized-test
option in description (AndroidGcloudConfig
)
test_runner/src/main/kotlin/ftl/run/model/AndroidTestContext.kt
Outdated
Show resolved
Hide resolved
test_runner/src/main/kotlin/ftl/run/platform/android/CreateAndroidTestContext.kt
Outdated
Show resolved
Hide resolved
test_runner/src/main/kotlin/ftl/run/platform/android/CreateAndroidTestContext.kt
Outdated
Show resolved
Hide resolved
@@ -119,13 +155,16 @@ internal fun InstrumentationTestContext.getFlankTestMethods( | |||
.filter(testFilter.shouldRun) | |||
.filterNot(parameterizedClasses::belong) | |||
.map(TestMethod::toFlankTestMethod).toList() | |||
.plus(parameterizedClasses.onlyShouldRun(testFilter)) | |||
.plus(parameterizedClasses.onlyShouldRun(testFilter, parameterizedTests.shouldIgnore())) |
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.
#shouldIgnore
is a simple method, I think we can return an empty list here instead of inside onlyShouldRun
method
.plus(parameterizedClasses.onlyShouldRun(testFilter, parameterizedTests.shouldIgnore())) | |
.plus(if (parameterizedTests.shouldIgnore()) emptyList() else parameterizedClasses.onlyShouldRun(testFilter)) |
Not saying it have to look like this, but I'm sure you got the idea.
WDYT?
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.
Looking at simply neatness i think having an if statement in a chained set of function calls looks worse than separating it out like is being done for all the other chained function calls.
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.
Well, it doesn't have to be a chained call. I'm saying that we can avoid passing a boolean parameter that will be used only to decide if we should return an empty list or not. That's all :)
test_runner/src/main/kotlin/ftl/run/platform/android/CreateAndroidTestContext.kt
Show resolved
Hide resolved
test_runner/src/main/kotlin/ftl/run/platform/android/ResolveApks.kt
Outdated
Show resolved
Hide resolved
test_runner/src/main/kotlin/ftl/run/platform/android/ResolveApks.kt
Outdated
Show resolved
Hide resolved
And I think we could also add this option to |
f68b059
to
6ead812
Compare
6894a25
to
45df4cb
Compare
d63a5ac
to
e84901e
Compare
@flank-it |
Integration tests succeed for all OSes ✅ |
Fixes #2023
Test Plan
Need to add parameterized test artifacts to flank.
Checklist