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

Benchmark tests for view generation and config generation #2677

Merged
merged 51 commits into from
Aug 31, 2023

Conversation

ekigamba
Copy link
Contributor

IMPORTANT: Where possible all PRs must be linked to a Github issue

Fixes #2067

Engineer Checklist

  • I have written Unit tests for any new feature(s) and edge cases for bug fixes
  • I have added any strings visible on UI components to the strings.xml file
  • I have updated the CHANGELOG.md file for any notable changes to the codebase
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the project's style guide
  • I have built and run the FHIRCore app to verify my change fixes the issue and/or does not break the app
  • I have checked that this PR does NOT introduce breaking changes that require an update to Content and/or Configs? If it does add a sample here or a link to exactly what changes need to be made to the content.

Code Reviewer Checklist

  • I have verified Unit tests have been written for any new feature(s) and edge cases
  • I have verified any strings visible on UI components are in the strings.xml file
  • I have verifed the CHANGELOG.md file has any notable changes to the codebase
  • I have verified the solution has been implemented in a configurable and generic way for reuseable components
  • I have built and run the FHIRCore app to verify the change fixes the issue and/or does not break the app

@ekigamba ekigamba force-pushed the issue/2067-profile-ui-generation branch from 4bb693f to 11388eb Compare August 15, 2023 05:47
@codecov
Copy link

codecov bot commented Aug 15, 2023

Codecov Report

Merging #2677 (87d8293) into main (ad3a737) will increase coverage by 1.0%.
Report is 37 commits behind head on main.
The diff coverage is 66.5%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main   #2677     +/-   ##
=========================================
+ Coverage     64.5%   65.5%   +1.0%     
- Complexity    1075    1104     +29     
=========================================
  Files          218     220      +2     
  Lines         9635    9828    +193     
  Branches      1897    1956     +59     
=========================================
+ Hits          6218    6441    +223     
+ Misses        2234    2133    -101     
- Partials      1183    1254     +71     
Flag Coverage Δ
engine 72.8% <72.6%> (+0.1%) ⬆️
geowidget 65.3% <20.0%> (+1.0%) ⬆️
quest 60.5% <64.3%> (+1.6%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...hircore/engine/domain/model/FhirResourceConfigs.kt 43.2% <0.0%> (-1.3%) ⬇️
...rcore/engine/util/extension/BigDecimalExtension.kt 0.0% <0.0%> (ø)
...ore/engine/util/helper/TransformSupportServices.kt 80.0% <0.0%> (-2.8%) ⬇️
...ster/fhircore/quest/ui/profile/ProfileViewModel.kt 44.1% <0.0%> (-1.8%) ⬇️
...quest/ui/report/measure/MeasureReportMainScreen.kt 0.0% <0.0%> (ø)
...rt/measure/models/MeasureReportPopulationResult.kt 25.0% <0.0%> (-12.5%) ⬇️
...fhircore/quest/ui/appsetting/AppSettingActivity.kt 42.8% <14.2%> (-5.6%) ⬇️
...er/fhircore/geowidget/screens/GeoWidgetFragment.kt 36.6% <20.0%> (+2.4%) ⬆️
...ircore/engine/configuration/QuestionnaireConfig.kt 61.0% <30.0%> (-6.4%) ⬇️
...hircore/engine/util/extension/MeasureExtensions.kt 42.5% <31.2%> (-4.6%) ⬇️
... and 24 more

... and 4 files with indirect coverage changes

@ekigamba ekigamba force-pushed the issue/2067-profile-ui-generation branch 9 times, most recently from 7ceb8b8 to 77a404a Compare August 15, 2023 08:13
@ekigamba ekigamba force-pushed the issue/2067-profile-ui-generation branch from 77a404a to 52f1d8e Compare August 15, 2023 10:06
@ekigamba ekigamba force-pushed the issue/2067-profile-ui-generation branch 2 times, most recently from 732549e to b4589a1 Compare August 18, 2023 06:58
@ekigamba ekigamba force-pushed the issue/2067-profile-ui-generation branch from b4589a1 to 5b481a6 Compare August 18, 2023 09:02
@ekigamba ekigamba marked this pull request as ready for review August 30, 2023 12:40
@ekigamba
Copy link
Contributor Author

To run the macrobench instrumentation tests run, open an emulator/device,API 28 (Android 9) and below, and run the following command in terminal in the directory fhircore/android

./gradlew :quest:assembleOpensrpDebug --stacktrace && \
adb install quest/build/outputs/apk/opensrp/debug/quest-opensrp-debug.apk && \
./gradlew :macrobenchmark:connectedBenchmarkAndroidTest && \
cp macrobenchmark/build/outputs/connected_android_test_additional_output/benchmark/connected/*/org.smartregister.opensrp.quest.macrobenchmark-benchmarkData.json macrobenchmark/benchmark-results.json

It is recommended to run these tests on an Android 28 and below devices. To run with higher APIs, an update on the benchmarking library will be required among other updates

@pld pld self-assigned this Aug 30, 2023
@ekigamba ekigamba requested a review from ndegwamartin August 30, 2023 21:47
Copy link
Member

Choose a reason for hiding this comment

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

👍

@pld pld merged commit 3e7a41f into main Aug 31, 2023
@pld pld deleted the issue/2067-profile-ui-generation branch August 31, 2023 01:48
qiarie pushed a commit that referenced this pull request Jan 15, 2025
* Draft: Commit

* Daft commit: Run tests i CI

* code cleanup

* Remove other CI tasks

* Fix performance tests assertion

* Fix performance tests assertion

* Fix performance tests assertion

* Allow SSH debugging

* Rerun SSH debugging

* Breakdown performance testing steps

* Breakdown performance testing steps

* Breakdown performance testing steps

* Breakdown performance testing steps

* Fix instrumentation running

* Fix instrumentation running

* Fix instrumentation running

* Fix instrumentation running

* Fix instrumentation running

* Fix apk install sequence

* List files in the sdcard/Download folder

* Enable JSON output for performance test results

* Enable JSON output for performance test results

* Fix instrumentation running

* Fix instrumentation running

* Fix instrumentation running

* Fix instrumentation running

* Fix instrumentation running

* Fix instrumentation running

* Update performance tests github workflow

- Revert github workflow for CI
- Revert household register page size to 20

* Run quest instrumentation tests before fhircoreJacocoReport task

* Clean up gradle files & performance results evaluation task

* Update the expected performance numbers for HouseholdRegister tests

* Refactor evaluatePerformanceBenchmarkResults

* Add compressed and zipped resources.db for performance testing

* Update performance-tests workflow to extract resources.db

* Ignore the resources.db in quest/androidTest

* Reformat and clean code

* Add macrobenchmark module with benchmark tests

* Add quest:benchmark buildType

* Add macrobenchmark/.gitignore

* Add macrobenchmark tests to performance tests CI check

- Some changes in line endings

* Add macrobenchmark tests to performance CI workflow

* Fix multiline command in perfomance tests workflow

- Fix failing quest build

* Add extra logging for macrobenchmark:connectedBenchmarkAndroidTest

* Add CI SSH-ing capability to troubleshoot

* Remove macrobenchmark from CI and remove SSH debugging

---------

Co-authored-by: Ephraim Kigamba <[email protected]>
Co-authored-by: Peter Lubell-Doughtie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants