-
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
feat: Merge test method duration for parameterized classes #2062
Conversation
Timestamp: 2021-07-09 11:26:22 |
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.
@jan-gogo ignore that. This is for corellium
8065ea0
to
1ebb01b
Compare
Because of comment "@jan-gogo ignore that. This is for corellium"
916937d
to
1c0863f
Compare
Fixes #2051 Requires #2055 Enchanted by #2062 ## Changes * Add test targets argument for filtering test cases. * Add filtering option to Apk.ParseTestCases. * Log AndroidTestPlan.Config on ExecuteTests start. * Refactor `:tool:apk` module ## Test Plan > How do we know the code works? build flank ```shell . .env flankScripts assemble flank -d ``` and run ```shell flank corellium test android run -c="./test_configs/flank-corellium.yml" ``` using configuration ```yml auth: "test_configs/corellium_auth.yml" apks: - path: "test_artifacts/master/apk/app-debug.apk" tests: - path: "test_artifacts/master/apk/app-multiple-flaky-debug-androidTest.apk" test-targets: - "package com.example.test_app.parametrized" - "notClass com.example.test_app.parametrized.EspressoParametrizedClassTestParameterized" - "package com.example.test_app.foo" - "class com.example.test_app.InstrumentedTest#test0" max-test-shards: 3 ``` As a results Flank should execute only test cases restricted by test targets. ## Checklist - [x] Documented - [x] Unit tested - [x] Integrated with a filtering tool
f6d8fd2
to
b8e186e
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.
Seems alright. Minor comment :)
JUnit.TestResult( | ||
suiteName = suite.name, | ||
testName = case.name, | ||
className = case.classname, | ||
startAt = 0, | ||
endsAt = (case.time * 1000).toLong(), | ||
startAt = startAt.also { startAt = endAt }, |
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.
wont this simply result in
endAt = endAt
&
startAt = endAt?
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.
I don't understand your suggestion, but it's reminded me that I had forgotten to add a proper test (Thx for that 👍). So, I added a small update. If you see a shorter solution, feel free to check out the branch and test it using StructuralKtTest.mapToTestResultsTest
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, this part .also { startAt = endAt }
was redundant.
bcfc0b9
to
4d9b334
Compare
5af09f6
to
2c7bf3e
Compare
Fixes #2052
Changes
:tool:junit
function for merging test methods into test-class with accumulated duration.Test Plan
Build flank:
. .env flankScripts assemble flank -d
Run the following command twice:
The second run should calculate durations for parameterized classes.
Check generated
android-shards.json
each parameterized class should have a duration different than the default (120).Checklist