Skip to content

chore: e2e Android #474

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

Merged
merged 9 commits into from
Nov 22, 2020
Merged

chore: e2e Android #474

merged 9 commits into from
Nov 22, 2020

Conversation

krizzu
Copy link
Member

@krizzu krizzu commented Oct 24, 2020

Summary:

Bringing back Android e2e tests. Had to do some in-depth testing for environment, and ended up with different macos versions for e2e android and ios (due to different JDK versions).

Additionally, pods caching, to speedup iOS builds and tests.

Test Plan:

Green CI.

@krizzu krizzu force-pushed the chore/e2e-android branch 30 times, most recently from 72839b4 to 955221f Compare October 25, 2020 16:38
@krizzu krizzu force-pushed the chore/e2e-android branch 11 times, most recently from a95e889 to 743aec6 Compare October 26, 2020 19:55
@krizzu krizzu marked this pull request as ready for review October 26, 2020 21:58
@krizzu krizzu requested a review from tido64 October 26, 2020 21:58
Comment on lines +28 to +63
allprojects {
repositories {
maven {
url("$rootDir/../../node_modules/detox/Detox-android")
}
}
afterEvaluate { project ->
def androidExtension = project.extensions.findByName('android')

if(androidExtension != null && project.name == 'app') {
// android extension from test-app pacakge
androidExtension.defaultConfig {
ndk {
abiFilters 'arm64-v8a', 'x86', 'x86_64'
}
}

androidExtension.signingConfigs {
test {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}

androidExtension.buildTypes.release.signingConfig = androidExtension.signingConfigs.test
androidExtension.testBuildType = 'release'

androidExtension.sourceSets.androidTest.java.srcDirs += "$rootDir/app/src/androidTest/java"

project.dependencies {
androidTestImplementation('com.wix:detox:+')
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

@arazabishov: Do you think we can simplify how devs can customize react-native-test-app? Not sure if this is normal as far as Gradle configs go but it seems a bit cumbersome to add signingConfigs and Detox specific things, imo.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is fine to leverage the flexibility of Gradle when needed, like in this case. If we were about to parameterize all of the things above, we will find ourselves trying to replicate AGP's API. What we can do is provide a convenient way to tap into androidExtension, so users don't have to search for it themselves.

Copy link
Member

Choose a reason for hiding this comment

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

If this is normal, then I think it's probably fine. We can add a "recipe" in our wiki and point people in that direction when they need to add stuff.

@krizzu krizzu merged commit 63bef8f into master Nov 22, 2020
@krizzu krizzu deleted the chore/e2e-android branch November 22, 2020 11:27
@krizzu
Copy link
Member Author

krizzu commented Jan 18, 2021

🎉 This PR is included in version 1.13.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

3 participants