You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.
Currently, nearly all of our tests are located in the androidTest source set. Therefore, many tests which could be run as unit tests are executed as integration tests, considerably slowing down the builds. Out of the 250+ tests which we currently have, at least 125 could be run as unit tests.
This issue contains a suggestion of some gradual steps to make the migration as smooth as possible. Each step could be performed in a separate PR, to make the migration process smoother.
Migration path
1. Rename the unit test main package from ch.epfl.sdp.mobile to ch.epfl.sdp.mobile.test.
2. Rename the integration test main package from ch.epfl.sdp.mobile.test to ch.epfl.sdp.mobile.androidTest. This is an important change that might require solving some merge conflicts !
3. Add support for a sharedTest source set to Gradle and to CodeClimate.
4. Move the fake Auth and the fake Store implementations to the sharedTest folder, and change their current package names to ch.epfl.sdp.mobile.sharedTest.xxx.
5. Move all the tests from ch.epfl.sdp.mobile.androidTest.application from the integration tests source set to the unit test source set, in ch.epfl.sdp.mobile.test.application.
6. Move some of the remaining state tests to the ch.epfl.sdp.mobile.test.state package in the unit test source set.
The final result will be that we have four source sets :
main, with the app code.
sharedTest, with all its code in the package ch.epfl.sdp.mobile.sharedTest and which contains some code used by both test and androidTest.
test, with all its code in the package ch.epfl.sdp.mobile.test and which contains some unit tests.
androidTest, with all its code in the package ch.epfl.sdp.mobile.androidTest and which contains some integration tests.
Questions & Answers
Why should we use different package names for each source set ?
Android Studio has an issue where, if you have two files in the same package and with the same name in the main and androidTest source sets, it won't compile properly when you run some integration tests. This is the reason for which we currently have the .test package suffix for our integration tests. However, with the introduction of some additional source sets, it makes sense to better distinguish in the package name tests and code which is meant for integration, unit, or both kinds of tests.
The text was updated successfully, but these errors were encountered:
Context
Currently, nearly all of our tests are located in the
androidTest
source set. Therefore, many tests which could be run as unit tests are executed as integration tests, considerably slowing down the builds. Out of the 250+ tests which we currently have, at least 125 could be run as unit tests.This issue contains a suggestion of some gradual steps to make the migration as smooth as possible. Each step could be performed in a separate PR, to make the migration process smoother.
Migration path
ch.epfl.sdp.mobile
toch.epfl.sdp.mobile.test
.ch.epfl.sdp.mobile.test
toch.epfl.sdp.mobile.androidTest
. This is an important change that might require solving some merge conflicts !sharedTest
source set to Gradle and to CodeClimate.Auth
and the fakeStore
implementations to thesharedTest
folder, and change their current package names toch.epfl.sdp.mobile.sharedTest.xxx
.ch.epfl.sdp.mobile.androidTest.application
from the integration tests source set to the unit test source set, inch.epfl.sdp.mobile.test.application
.state
tests to thech.epfl.sdp.mobile.test.state
package in the unit test source set.The final result will be that we have four source sets :
main
, with the app code.sharedTest
, with all its code in the packagech.epfl.sdp.mobile.sharedTest
and which contains some code used by bothtest
andandroidTest
.test
, with all its code in the packagech.epfl.sdp.mobile.test
and which contains some unit tests.androidTest
, with all its code in the packagech.epfl.sdp.mobile.androidTest
and which contains some integration tests.Questions & Answers
Android Studio has an issue where, if you have two files in the same package and with the same name in the
main
andandroidTest
source sets, it won't compile properly when you run some integration tests. This is the reason for which we currently have the.test
package suffix for our integration tests. However, with the introduction of some additional source sets, it makes sense to better distinguish in the package name tests and code which is meant for integration, unit, or both kinds of tests.The text was updated successfully, but these errors were encountered: