Skip to content
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

Add additional-app-test-apks support #542

Merged
merged 6 commits into from
May 1, 2019
Merged

Add additional-app-test-apks support #542

merged 6 commits into from
May 1, 2019

Conversation

bootstraponline
Copy link
Contributor

Fix #511

@bootstraponline bootstraponline force-pushed the modules branch 2 times, most recently from 09c92a7 to 44d0b39 Compare April 10, 2019 16:12
@codecov-io
Copy link

codecov-io commented Apr 10, 2019

Codecov Report

Merging #542 into master will increase coverage by 0.04%.
The diff coverage is 87.71%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #542      +/-   ##
============================================
+ Coverage      79.4%   79.45%   +0.04%     
- Complexity      566      576      +10     
============================================
  Files            77       79       +2     
  Lines          2122     2146      +24     
  Branches        279      277       -2     
============================================
+ Hits           1685     1705      +20     
+ Misses          266      263       -3     
- Partials        171      178       +7

## Include additional app/test apk pairs in the run. If app is omitted, then the top level app is used for that pair.
# additional-app-test-apks:
# - app: ../test_app/apks/app-debug.apk
# test: ../test_app/apks/app-debug-androidTest.apk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you thought of making test a list, so you don't have a bunch of usages without app?

Something like

- app: ../app.apk
  test:
    - testapk1.apk
    - testapk2.apk

- app: app2.apk
  test:
     - testfinal.apk

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that idea.

Copy link
Contributor Author

@bootstraponline bootstraponline May 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prototyped adding list support, in particular this complicated the code when parsing from CLI.

I think for the first version of this feature, the more verbose format is easier to maintain. The test run loop also becomes more complex as we have yet another list to iterate through.

- app: ../app.apk
  test: test1.apk
- app: ../app.apk
  test: test2.apk

I'm open to revisiting this based on feedback in the future.

@doodla
Copy link
Contributor

doodla commented Apr 10, 2019

Did firebase add support for multiple test apks?

@bootstraponline
Copy link
Contributor Author

Did firebase add support for multiple test apks?

Nope. We talked with the FTL team and this isn't a roadmap priority for them.

I think modules on Android are a good use case for this feature. I've been working with American Express to add support for this use case directly in Flank to unblock them.

@doodla
Copy link
Contributor

doodla commented Apr 10, 2019

Haven't gone through the code, but are you merging all test apks into a single one?

@bootstraponline
Copy link
Contributor Author

Haven't gone through the code, but are you merging all test apks into a single one?

Previously flank only allowed one test/app apk. In the new design, Flank accepts an array of test/app apks. The apks aren't merged. If you have one app and a dozen test apks for that single app, now you can get the results within a single flank run.

@doodla
Copy link
Contributor

doodla commented Apr 10, 2019

Oh of course. You can just trigger multiple test lab runs, each with a different test APK.

@carlospaulino
Copy link

carlospaulino commented Apr 23, 2019

I tested these changes locally, and flank is not working as expected.

Most of the shard results are reporting no tests, and I don't think it is an issue with my apks because I ran all additional apks individually with the current version and the run yields the right results.

<?xml version='1.0' encoding='UTF-8' ?>
<testsuite name="" tests="1" failures="1" errors="0" skipped="0" time="0.544" timestamp="2019-04-23T17:16:05" hostname="localhost">
  <properties />
  <testcase name="" classname="no tests found" time="0.0">
    <failure>java.lang.ClassNotFoundException: Invalid name: no tests found
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:324)
at androidx.test.internal.runner.TestLoader.doCreateRunner(TestLoader.java:72)
at androidx.test.internal.runner.TestLoader.getRunnersFor(TestLoader.java:104)
at androidx.test.internal.runner.TestRequestBuilder.build(TestRequestBuilder.java:789)
at androidx.test.runner.AndroidJUnitRunner.buildRequest(AndroidJUnitRunner.java:543)
at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:386)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1879)
</failure>
  </testcase>
</testsuite>

@bootstraponline
Copy link
Contributor Author

Thanks. I'll look into it

@bootstraponline
Copy link
Contributor Author

I'm unable to reproduce the failure using my apks. Pinged on Slack with more details on how to debug the problem.

@carlospaulino
Copy link

@bootstraponline I found the problem. The Matrix is receiving test targets that are not part of the test apk.

See here: https://github.com/TestArmada/flank/pull/542/files#diff-1e35d5e13a5fd960dfea32faa4b6e6e0R41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Execute Additional Test apks
4 participants