Comments (22)
What does the output of the command "adb devices" say?
Sometimes I've found that stopping all gradle daemons fixes that. Try "./gradlew --stop" to do that. I haven't dug deeper about that issue.
from fork.
adb devices
returns device ids for both of my emulators. I will try stopping the daemons. Also, there is no 1.2.0-SNAPSHOT in maven.
from fork.
There is on the snapshot repo: https://oss.sonatype.org/content/repositories/snapshots/com/shazam/fork/fork/1.2.0-SNAPSHOT/
from fork.
Thanks for clarifying. ./gradlew --stop
did not work.
from fork.
I am getting this error now:
Error when trying to scan for test classes
com.shazam.fork.suite.NoTestClassesFoundException: No tests classes were found in the dex files.
./gradlew --stop
seems to remove the "No devices found" error.
from fork.
That has to do with where Fork scans for tests.
By default it will scan in a package that is the same with your instrumentation APK's package ID. If you haven't specified that in your test AndroidManifest.xml, it will be the same as the app's package ID with the suffix '.test'.
Also, if your instrumentation package ID is something like com.example.test but your tests are in a package that doesn't follow the convention, say com.example.instrumentationtests you need to tell Fork that with the setting:
fork {
testPackage "com.example.instrumentationtests"
}
Please, feel free to add to the doc if you think this is not covered enough (which is probably the case).
Closing this issue for now, I'll raise a separate one to address the No devices found.
from fork.
I thought it might be related to the package name, so I tried using the DSL to give it the right package name. I still get the same error.
from fork.
If you run the grafle command with --debug, you can check what package fork is looking into.
from fork.
It seems to be looking at the right test package. Interestingly the logs say that assembleDebugAndroidTest
has no actions:
09:02:32.190 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Starting to execute task ':app:assembleDebugAndroidTest'
09:02:32.190 [INFO] [org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter] Skipping task ':app:assembleDebugAndroidTest' as it has no actions.
09:02:32.191 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':app:assembleDebugAndroidTest'
09:02:32.191 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :app:assembleDebugAndroidTest (Thread[Daemon worker,5,main]) completed. Took 0.001 secs
These are Robotium tests that are located in an androidTestRobotium
folder instead of the regular androidTest
folder. Would this cause issues?
from fork.
What task are you running?
from fork.
./gradlew forkDebug
. When I do ./gradlew tasks | grep fork
I get fork
and forkDebug
.
from fork.
Curious: which connected*Test
task were you running before applying Fork? I'm not sure how the "Robotium" folder will be picked up if you haven't declared a flavour for it. Any reason you haven't tried androidTest
instead ?
from fork.
I also tried with a simpler project and it didn't work. What would be the process? Do I need to run a task before running fork?
from fork.
If you don't mind sharing the simple project where this is broken, I could have a look.
from fork.
I can when I get home today. I think it would be beneficial if you guys could add a sample project to this repo with fork configured as it should.
from fork.
Sorry for the delay. I created a new Android Studio project that has the default Application Instrumentation test. I still get the same error. You can find the repo here.
from fork.
@iordanis Thanks a lot for all your help. Sorry, I did not pick up what you were saying earlier. I thought that Fork would be set up to run out of the box with a new Android Studio project and did not realize that the BlankActivity template does not put tests inside a test package.
One last question. If I want to run my UATs in two emulators at the same time, but not the whole test suite in both (basically 50% of the tests in one emulator and the other 50% in the other) I need to use the fork.pool.POOL_NAME=(Serial','?) option, correct? Namely I want to have both emulators in the same pool, right?
Once again, thanks a lot for your patience.
from fork.
No problem.
That's probably a good idea, if that's the default AS behaviour. I have to admit I haven't used the wizard recently.
For splitting tests even easier use ./gradle forkDebug -Dfork.computed.sw=all=0
. That will create one pool of all connected devices and split the tests in there. You can use the one you suggested, but if the serial numbers change (say you connected one more device or disconnected another), you have to change the command accordingly, which is more effort.
from fork.
Thanks a lot. This library is going to be of great use for us. We have around 500 Robotium UATs that currently take 1.5hrs to run.
from fork.
That's why we started with this, too. With our current setup they take 4 minutes, so it works well :)
from fork.
Oh and if you use Jenkins as CI, let me know if you can run the Flakiness reporter. That's been also pretty useful. Also, would be easy to migrate to your CI system if it's not Jenkins.
For your reference, I've raised another issue for the default package: #63
from fork.
I will try the Reporter next. I will let you know how it goes. We do use Jenkins.
from fork.
Related Issues (20)
- Output unit style test results HOT 1
- Fork doesn't run any instrumented tests
- Failed to remove a trace when retry test in 3.8.1 HOT 2
- Obsoletion warnings when using the Gradle plugin with Android Gradle Plugin 3.5 HOT 2
- Version 3.8.1 is not deployed HOT 1
- Error AGP 3.6.0-beta01 HOT 5
- Ability to select custom APK names HOT 1
- Pass environment variables
- Build failed with cause test reports not found for excluded tests
- Test run is always fail if excludedAnnotation is used HOT 1
- Beautify Failed/Ignored/Crashed test list
- Parallel test running taking longer than usual time.
- Obsolete documentation in README.md HOT 1
- Standalone Fork command with arguments doesn't work
- java.lang.RuntimeException: bad magic value: 64 65 78 0a 30 33 37 00 HOT 2
- Build error with AGP 4.1.0 HOT 2
- Fork plugin ignores settings
- Update codacy integration HOT 1
- Help: How can I run the standalone command?
- simple-xml XXE vulnerability
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fork.