-
-
Notifications
You must be signed in to change notification settings - Fork 461
Tests/android UI tests #2013
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
Tests/android UI tests #2013
Conversation
added end2end ui tests module with base test class (early version)
added mock relay server with envelope and items assertions
app cache is deleted on test start MockRelay defaults to success response
added comments and javadoc to Benchmark module added a README
*sentry-android-ui-tests -> sentry-uitest *benchmark -> sentry-uitest-android-benchmark *end2end -> sentry-uitest-android Updated root build gradle file to ignore uitest modules from apiValidation, DistributionPlugin and aggregateJavadocs Added comments and javadoc on sentry-uitest-android module
|
@stefanosiano drop us a line once this is ready to be reviewed. What's about addressing the 2 items from the next steps in this PR:
We try to keep tests as clean as possible as well, so we run detekt and friends to all of our tests as well for every other module. |
1 similar comment
|
@stefanosiano drop us a line once this is ready to be reviewed. What's about addressing the 2 items from the next steps in this PR:
We try to keep tests as clean as possible as well, so we run detekt and friends to all of our tests as well for every other module. |
…oad to saucelabs removed dependency between test modules
|
@marandaneto |
Codecov Report
@@ Coverage Diff @@
## 6.x.x #2013 +/- ##
============================================
+ Coverage 80.79% 81.07% +0.27%
- Complexity 3146 3217 +71
============================================
Files 228 230 +2
Lines 11645 11821 +176
Branches 1565 1572 +7
============================================
+ Hits 9409 9584 +175
- Misses 1649 1650 +1
Partials 587 587
Continue to review full report at Codecov.
|
Cool, I'll let this one to @romtsn , Thanks. |
|
@stefanosiano I'm happy to review it, but could you give more context on this please? Was it aligned with someone, did you have any discussions on how this will look like? (e.g. is this just a PoC for profiling or are we going to reuse it later for other benchmarks like app startup time and so on). It's a bit hard to review a big PR without much context. Also, regarding the e2e tests, I believe we actually wanted to run a real/test relay in a docker container alongside the test app and have assertions on their site, so I'm not sure if the current approach with the MockWebServer would actually be valuable, since we just essentially test serialization logic (which is already tested anyway). cc @bruno-garcia |
...oid-benchmark/src/androidTest/java/io/sentry/uitest/android/benchmark/SentryBenchmarkTest.kt
Outdated
Show resolved
Hide resolved
...oid-benchmark/src/androidTest/java/io/sentry/uitest/android/benchmark/SentryBenchmarkTest.kt
Show resolved
Hide resolved
...oid-benchmark/src/androidTest/java/io/sentry/uitest/android/benchmark/SentryBenchmarkTest.kt
Outdated
Show resolved
Hide resolved
...benchmark/src/androidTest/java/io/sentry/uitest/android/benchmark/util/BenchmarkOperation.kt
Outdated
Show resolved
Hide resolved
...benchmark/src/androidTest/java/io/sentry/uitest/android/benchmark/util/BenchmarkOperation.kt
Show resolved
Hide resolved
...ark/src/androidTest/java/io/sentry/uitest/android/benchmark/util/BenchmarkOperationResult.kt
Outdated
Show resolved
Hide resolved
sentry-uitest/sentry-uitest-android-benchmark/src/main/AndroidManifest.xml
Outdated
Show resolved
Hide resolved
sentry-uitest/sentry-uitest-android-benchmark/src/main/AndroidManifest.xml
Outdated
Show resolved
Hide resolved
...test-android-benchmark/src/main/java/io/sentry/uitest/android/benchmark/BenchmarkActivity.kt
Outdated
Show resolved
Hide resolved
...-uitest/sentry-uitest-android/src/androidTest/java/io/sentry/uitest/android/EnvelopeTests.kt
Outdated
Show resolved
Hide resolved
...uitest-android/src/androidTest/java/io/sentry/uitest/android/mockservers/EnvelopeAsserter.kt
Outdated
Show resolved
Hide resolved
sentry-uitest/sentry-uitest-android/src/main/AndroidManifest.xml
Outdated
Show resolved
Hide resolved
sentry-uitest/sentry-uitest-android-benchmark/benchmark-proguard-rules.pro
Show resolved
Hide resolved
sentry-uitest/sentry-uitest-android/src/androidTest/java/io/sentry/uitest/android/BaseUiTest.kt
Outdated
Show resolved
Hide resolved
added ViewBinding few cleanups moved "androidx.test.runner.AndroidJUnitRunner" in Config.TestLibs.androidJUnitRunner
…ts/android-ui-tests
assertEnvelopeItem is now a <reified T>
BooleanIdlingResource is now only in sentry-uitest-android
|
@marandaneto @romtsn |
|
@stefanosiano I've already approved, so nothing is blocking you from merging really ;) |
|
@romtsn yeah, I know. Just wanted a last confirmation :) |
📜 Description
Add some ui tests using Google's Espresso for Android.
There are currently two modules, grouped under
sentry-uitest:This module checks the difference between two operations and check they don't pass a specified threshold.
It's better to keep it separate from the other tests, as it requires the application not to be debuggable.
It contains all Android end2end tests that we are interested in. Right now it contains a mock relay server that allows us to check the envelopes that were sent to relay.
SauceLabs integration was added, too.
Right now we just check that overheads are not over certain relative/absolute thresholds.
In the future we will add a way to compare overheads over sdk releases, but we have to discuss on how to do it.
#skip-changelog
💡 Motivation and Context
We need a benchmark to be sure that profiling overhead is under a certain threshold.
We also needed to start using some ui tests, as they can check things that Unit tests cannot do.
💚 How did you test it?
🤣
📝 Checklist
🔮 Next steps