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

Performance tests for loading register data #2592

Merged
merged 50 commits into from
Aug 1, 2023

Conversation

ekigamba
Copy link
Contributor

@ekigamba ekigamba commented Jul 17, 2023

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

Fixes #2066

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/2066-performance-tests-load-data branch from 95b0d34 to fef6ac9 Compare July 17, 2023 10:39
@codecov
Copy link

codecov bot commented Jul 17, 2023

Codecov Report

Merging #2592 (96646bb) into main (d84c2c8) will decrease coverage by 0.1%.
Report is 33 commits behind head on main.
The diff coverage is 67.6%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main   #2592     +/-   ##
=========================================
- Coverage     65.4%   65.4%   -0.1%     
- Complexity    1101    1148     +47     
=========================================
  Files          213     216      +3     
  Lines         9385    9743    +358     
  Branches      1866    1932     +66     
=========================================
+ Hits          6140    6372    +232     
- Misses        2047    2154    +107     
- Partials      1198    1217     +19     
Flag Coverage Δ
engine 73.1% <70.4%> (+<0.1%) ⬆️
geowidget 64.3% <37.5%> (+1.0%) ⬆️
quest 60.3% <65.7%> (-0.2%) ⬇️

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

Files Changed Coverage Δ
...ter/fhircore/engine/configuration/Configuration.kt 25.0% <ø> (ø)
...ngine/configuration/event/EventTriggerCondition.kt 50.0% <0.0%> (ø)
...ircore/engine/configuration/event/EventWorkflow.kt 33.3% <0.0%> (ø)
...ngine/configuration/view/PersonalDataProperties.kt 0.0% <0.0%> (ø)
...hircore/engine/configuration/view/RowProperties.kt 0.0% <ø> (ø)
...ine/configuration/view/ViewPropertiesSerializer.kt 23.8% <0.0%> (ø)
...data/remote/fhir/resource/FhirResourceConverter.kt 100.0% <ø> (ø)
...e/data/remote/fhir/resource/FhirResourceService.kt 0.0% <0.0%> (ø)
...hircore/engine/domain/model/FhirResourceConfigs.kt 44.4% <0.0%> (ø)
...rtregister/fhircore/engine/sync/SyncBroadcaster.kt 33.3% <0.0%> (ø)
... and 135 more

... and 21 files with indirect coverage changes

@ekigamba ekigamba force-pushed the issue/2066-performance-tests-load-data branch 3 times, most recently from 299fece to dd94e2a Compare July 17, 2023 12:38
@ekigamba ekigamba changed the title Draft: Commit Performance tests for loading register data Jul 17, 2023
@ekigamba ekigamba force-pushed the issue/2066-performance-tests-load-data branch 3 times, most recently from 5ae5279 to 2158133 Compare July 17, 2023 13:04
@ekigamba ekigamba force-pushed the issue/2066-performance-tests-load-data branch from 2158133 to 1a79ea0 Compare July 18, 2023 13:48
@@ -361,8 +370,79 @@ dependencies {
androidTestImplementation(libs.ui.test.junit4)
androidTestImplementation(libs.hilt.android.testing)
androidTestImplementation(libs.mockk.android)
androidTestImplementation("androidx.benchmark:benchmark-junit4:1.1.1")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Move this to libs.versions.toml

Copy link
Member

Choose a reason for hiding this comment

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

does this still need to be moved?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

pld
pld previously approved these changes Jul 26, 2023
runs-on: macos-latest
strategy:
matrix:
api-level: [28]
Copy link
Member

Choose a reason for hiding this comment

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

ah I see now, it'd be nice to get this down to 26 or whatever level we say we're supporting, but feels like better for follow-up work not this pr

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

- Run instrumentation tests and pull coverage file into quest directory. Include the coverage file in Jacoco task
- Fixes the class bytecode being different for the instrumentation test and unit tests
@ekigamba ekigamba force-pushed the issue/2066-performance-tests-load-data branch from 3d94700 to a37158a Compare July 31, 2023 21:17
@ekigamba ekigamba marked this pull request as ready for review August 1, 2023 07:42
@ekigamba ekigamba requested a review from pld August 1, 2023 07:42
@ekigamba ekigamba requested a review from Rkareko August 1, 2023 12:52
pld
pld previously approved these changes Aug 1, 2023
@pld pld merged commit 5e54710 into main Aug 1, 2023
@pld pld deleted the issue/2066-performance-tests-load-data branch August 1, 2023 16:42
1. Unit tests
2. UI and integration tests
The OpenSRP Android app includes automated style, coverage, unit, user inteface / integartion, and performance testing. All tests are run through github actions on pull request and must be passed for a pull request to be merged without an admin override.

Copy link
Contributor

Choose a reason for hiding this comment

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

change must be passed to must pass

@ekigamba ekigamba mentioned this pull request Aug 2, 2023
3 tasks
AbdulWahabMemon added a commit that referenced this pull request Aug 7, 2023
* main:
  Make SideMenu items scrollable (#2645)
  Add progress indicator for report generation (#2635)
  CHT measure report result screen (#2624)
  Provide missing QuestionnaireResponse in bundle param for FhirCarePlanGenerator#conditionallyUpdateResourceStatus (#2643)
  Fix resource closure failure after server sync (#2639)
  Fix build
  add more further reading (#2637)
  Refactor questionnaire implementation (#2622)
  Fix Unit Tests + Build 💚
  Fix Unit Tests ✅
  Clean up
  Fix Unit tests ✅
  Updating the login flow to save multiple practitioner details (#2623)
  Disable Dialog Dismiss Incase of Initial Sync Errors (#2608)
  Add the new ecbis production flavor
  Performance tests for loading register data (#2592)
  Fix back navigation for date selection page (#2628)
  Create github release file (#2611)
  Add form authoring consideration documentation (#2618)
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

* Update quest tests to skip performance tests

- Run instrumentation tests and pull coverage file into quest directory. Include the coverage file in Jacoco task

* Run instrumentation tests for opensrp variant instead of ecbis

- Fixes the class bytecode being different for the instrumentation test and unit tests

* Update android/jacoco.gradle.kts

* Update android/quest/build.gradle.kts

* Update performance-tests.yml

* fix multiline comments

* expanding testing section

* add note on coverage and performance

* add change note

---------

Co-authored-by: Ephraim Kigamba <n.kigamba@students.ku.ac.ke>
Co-authored-by: Peter Lubell-Doughtie <peter@ona.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants