Skip to content
This repository has been archived by the owner on Jul 25, 2019. It is now read-only.

Running tests from IDE does not recompile test classes #34

Open
gbegen opened this issue Jan 2, 2015 · 6 comments
Open

Running tests from IDE does not recompile test classes #34

gbegen opened this issue Jan 2, 2015 · 6 comments

Comments

@gbegen
Copy link

gbegen commented Jan 2, 2015

Android Studio: 1.0.1
android-unit-test: 2.1.1
android-studio-unit-test-plugin: 1.4.0

It appears that recent changes to this plugin have attempted to add a make task before running the unit tests that should run with a goal of testDebugClasses, but it only seems to be running with a goal of assembleDebug anyway.

Therefore, after a project cleaning, I get the ClassNotFound error until I build from the command line.

Also, if I make changes to the tests, they don't get recompiled when I run the tests from the IDE.

@coreydowning
Copy link

Noticing this as well. If I have some time I'll dig into the plugin to see if I can come up with a fix.

@clemp6r
Copy link

clemp6r commented Jan 30, 2015

Is there a workaround until this is fixed?

@evant
Copy link
Owner

evant commented Jan 30, 2015

You can try some of the workarounds from before the latest update.
One of:

  1. Add tasks.findByName("assembleDebug").dependsOn("testDebugClasses") to your build.gradle to force the test classes to be compiled whenever your project is compiled.
  2. Go to Edit Configurations and add a new gradle configuration that runs the task testClasses. Then in your junit configuration, below Before launch, click + -> Run Another Configuration and add the gradle configuration you just created.

@jsotuyod
Copy link

jsotuyod commented Feb 6, 2015

Alternative 1 ends in an error due to circular dependencies of tasks.

The second one works, but needs to be done for each test you run.... Any timeline on getting this fixed? Any way I can help?

@evant
Copy link
Owner

evant commented Feb 6, 2015

I'm not quite experiencing this issue (it fails the first time after a clean but then works correctly after that). So I'd need more info about your project setup. Honestly though, I'm not really invested on working on this anymore since google is releasing a proper solution.

@clemp6r
Copy link

clemp6r commented Feb 6, 2015

Official solution: that's good news!

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

No branches or pull requests

5 participants