Skip to content
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 absolute #2077

Merged
merged 50 commits into from
Jun 13, 2022
Merged

Conversation

stefanosiano
Copy link
Member

@stefanosiano stefanosiano commented Jun 3, 2022

📜 Description

We have benchmarks that calculate relative difference between two operations with percentages.
We are now adding absolute difference difference between two operations.

💡 Motivation and Context

We want to make sure that certain operations don't take too long. E.g. the sdk init shouldn't take more than a few milliseconds.

#skip-changelog

💚 How did you test it?

🤣

📝 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

🔮 Next steps

Check other devices we can run the benchmarks on (there is still some issues with android runner on old versions). Will add them in another pr.

stefanosiano and others added 30 commits April 20, 2022 10:51
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
…oad to saucelabs

removed dependency between test modules
removed proguard
fix typo in Hub transactionListener -> transactionProfiler
added a before and after method to optionally invoke in each iteration without being measured
added benchmarking sdk functions
printing the number of cpu cores in benchmark results
pass a Choreographer object instead of the Runner to the BenchmarkOperation
…olute

# Conflicts:
#	sentry-uitest/sentry-uitest-android-benchmark/src/androidTest/java/io/sentry/uitest/android/benchmark/SentryBenchmarkTest.kt
#	sentry-uitest/sentry-uitest-android-benchmark/src/androidTest/java/io/sentry/uitest/android/benchmark/util/BenchmarkOperation.kt
#	sentry-uitest/sentry-uitest-android-benchmark/src/androidTest/java/io/sentry/uitest/android/benchmark/util/BenchmarkOperationResult.kt
…olute

# Conflicts:
#	sentry-uitest/sentry-uitest-android-benchmark/src/androidTest/java/io/sentry/uitest/android/benchmark/SentryBenchmarkTest.kt
added ViewBinding
few cleanups
moved "androidx.test.runner.AndroidJUnitRunner" in Config.TestLibs.androidJUnitRunner
Base automatically changed from 6.x.x to main June 7, 2022 10:10
added a couple jobs to the makefile for integration test apks
added a couple jobs to the makefile for integration test apks
added a couple jobs to the makefile for integration test apks
@marandaneto
Copy link
Contributor

@stefanosiano let us know once this PR is ready to be reviewed since there are still commits going on, thanks.

@marandaneto marandaneto marked this pull request as draft June 8, 2022 12:10
@stefanosiano
Copy link
Member Author

@stefanosiano let us know once this PR is ready to be reviewed since there are still commits going on, thanks.

This pr is ready. I'm just making a few changes for the new github actions, but only on the .yml files

@marandaneto
Copy link
Contributor

@stefanosiano did a review and left a few comments, please address them and make the tests pass, so CI is green, after that we can approve & merge it, thanks for doing this.

removed activityStartedIdlingResource from BenchmarkActivity as Espresso already waits for full activity creation when launching it
changed scrollingIdlingResource from BooleanIdlingResource to CountingIdlingResource to avoid dependency on another module
changed uitest module to "com.android.application", to allow apk creation to upload it to SauceLabs
@stefanosiano stefanosiano marked this pull request as ready for review June 10, 2022 16:45
@stefanosiano
Copy link
Member Author

fixed the tests and now we have them running on SauceLabs!
I had to remove the dependency between sentry-uitest-android-benchmark and sentry-uitest-android.
Also sentry-uitest-android module was moved from com.android.library to com.android.application, so that we can build an apk to upload to Saucelabs

testOptions:
useTestOrchestrator: true

# Commenting for the moment, due to the error "Cannot install test-services-1.4.1.apk on device" on low Android versions
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we get this error? Should we fix or remove the comments?

Copy link
Member Author

Choose a reason for hiding this comment

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

The errors are related to an issue with Android test orchestrator on old versions.
I will fix the issue, but in another pr, so we can understand how the sauce labs runs work with the other commits (adding devices would make the tests take longer)

Copy link
Contributor

@marandaneto marandaneto left a comment

Choose a reason for hiding this comment

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

LGTM

@marandaneto marandaneto merged commit a83efb8 into main Jun 13, 2022
@marandaneto marandaneto deleted the tests/android-ui-tests-absolute branch June 13, 2022 13:18
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.

None yet

4 participants