Skip to content

Commit

Permalink
feat : GH-47 Add people details module (#48)
Browse files Browse the repository at this point in the history
* feat : GH-47 Add people details module

* feat : GH-47 Add people details module
       Add performance and metrics
       Add BaselineProfileRule
  • Loading branch information
jerryOkafor authored Jan 2, 2024
1 parent e66d4d9 commit 7e3fad9
Show file tree
Hide file tree
Showing 156 changed files with 5,952 additions and 1,166 deletions.
40 changes: 11 additions & 29 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,34 +1,16 @@
[*.{kt,kts}]
ktlint_code_style = intellij_idea
end_of_line = lf
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true
ij_kotlin_imports_layout = *, java.**, javax.**, kotlin.**, ^
ij_kotlin_packages_to_use_import_on_demand = java.util.*, kotlinx.android.synthetic.**
indent_size = 4
indent_style = space
ktlint_code_style = ktlint_official
insert_final_newline = true
ktlint_chain_method_rule_force_multiline_when_chain_operator_count_greater_or_equal_than = unset
ktlint_class_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = unset
ktlint_code_style = intellij_idea
ktlint_function_naming_ignore_when_annotated_with = unset
ktlint_function_signature_body_expression_wrapping = default
ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = unset
max_line_length = 100
ktlint_function_naming_ignore_when_annotated_with = Composable
ktlint_ignore_back_ticked_identifier = false
max_line_length = off
ktlint_standard_multiline-expression-wrapping = disabled
ktlint_standard_string-template-indent = disabled
ktlint_function_signature_wrapping_rule_always_with_minimum_parameters = 3
ktlint_function_signature_body_expression_wrapping = default

[**/generated/**/*]
ktlint = disabled

# end_of_line = lf
# ij_kotlin_allow_trailing_comma = false
# ij_kotlin_allow_trailing_comma_on_call_site = false
# ij_kotlin_imports_layout = *, java.**, javax.**, kotlin.**, ^
# ij_kotlin_packages_to_use_import_on_demand = unset
# indent_size = 4
# indent_style = space
# ktlint_chain_method_rule_force_multiline_when_chain_operator_count_greater_or_equal_than = unset
# ktlint_class_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = 1
# ktlint_function_signature_body_expression_wrapping = default
# ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = 2
# ktlint_function_signature_wrapping_rule_always_with_minimum_parameters = 3
# ktlint_ignore_back_ticked_identifier = false
# max_line_length = 140
[**/generated-sources/**/*]
ktlint = disabled
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Thanks for submitting a pull request. Please include the following information.

**What I have done and why**
Include a summary of what your pull request contains, and why you have made these changes.

Fixes #<issue_number_goes_here>

**Do tests pass?**
- [ ] Run local tests on `Debug` variant: `./gradlew testDebugUnitTest`
- [ ] Check formatting: `./gradlew detekt ktlintCheck`


51 changes: 40 additions & 11 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,51 @@ jobs:
- name: Setup Gradle
uses: gradle/gradle-build-action@v2

# Replace task exclusions with `-Pandroidx.baselineprofile.skipgeneration` when
# https://android-review.googlesource.com/c/platform/frameworks/support/+/2602790 landed in a
# release build
- name: Build all build type and flavor permutations
run: ./gradlew assemble

# - name: Run all local screenshot tests (Roborazzi)
# id: screenshotsverify
# continue-on-error: true
# run: ./gradlew :screenshotTest:verifyRoborazziDebug

#Add more codes

- name: Check lint
run: ./gradlew lintDebug
run: |
./gradlew :app:assemble :benchmark:assemble \
-x pixel6Api33NonMinifiedReleaseAndroidTest \
-x pixel6Api33NonMinifiedBenchmarkAndroidTest \
-x collectNonMinifiedReleaseBaselineProfile \
-x collectNonMinifiedBenchmarkBaselineProfile
- name: Run all local screenshot tests (Roborazzi)
id: verifyScreenshot
continue-on-error: true
run: ./gradlew verifyRoborazziDebug

- name: Prevent pushing new screenshots if this is a fork
id: checkIsFork
continue-on-error: false
if: steps.verifyScreenshot.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository
run: |
echo "::error::Screenshot tests failed, please create a PR in your fork first." && exit 1
# Runs if previous job failed
- name: Generate new screenshots if verification failed and it's a PR
id: recordScreenshot
if: steps.verifyScreenshot.outcome == 'failure' && github.event_name == 'pull_request'
run: |
./gradlew recordRoborazziDebug
- name: Push new screenshots if available
uses: stefanzweifel/git-auto-commit-action@v5
if: steps.recordScreenshot.outcome == 'success'
with:
file_pattern: '*/*.png'
disable_globbing: true
commit_message: "🤖 Updates screenshots"

- name: Run local tests with coverage
if: always()
run: ./gradlew testDebugUnitTest

- name: Check lint
run: ./gradlew :app:lintRelease

- name: Generate androidTest Coverage Report
run: ./gradlew jacocoTestCoverageReport

Expand Down
52 changes: 52 additions & 0 deletions .idea/androidTestResultsUserPreferences.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions .idea/appInsightsSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 52 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ tests using robolectric instead of a real device or an emulator
- [Robolectric Shadows](https://robolectric.org/extending/) - use shadow objects to simulate Android
behavior in a non-Android environment.

#### Performance and Qaulity

- [ProfileInstaller](https://developer.android.com/jetpack/androidx/releases/profileinstaller) -
Enables libraries to prepopulate ahead of time compilation traces to be read by ART
- [JankStats Library](https://developer.android.com/topic/performance/jankstats) - The JankStats
library helps you track and analyze performance problems in your applications

# Modularization

IheNkiri is completely modularised based on the approach using
Expand Down Expand Up @@ -180,7 +187,6 @@ Generate Lint baseline
./gradlew lintDebug -Dlint.baselines.continue=true
````


We have the following tests on **IheNkiri**

- Unit tests - Runs all the local JVM tests, this can be invoked as follows:
Expand All @@ -202,10 +208,18 @@ We have the following tests on **IheNkiri**
System components
and other components, save them, and subsequently verifies them against new records.This helps
detect obvious changes in the Pixels which might indicate a deviation in the core dependencies or
something the developer needs to take care of. This has been said to tbe faste and better than
something the developer needs to take care of. This has been said to tbe fast and better than
doing multiple assertions for a given UI component. The screenshot tests lives in
the `screenshotTest` module and can be invoked using the following command:

## Compose

### Compose debugging

```bash
./gradlew assembleDebugRelease -PcomposeCompilerReports=true
```

Generate screenshots

```bash
Expand Down Expand Up @@ -236,9 +250,43 @@ Verify & record screenshots

We use Roborazzi to achieve this screenshot testing.

## Performance & Quality

App uses Jank Stats and ProfilerInstaller for performance checks
When delivering through Google Play, the baseline profile is compiled during installation.
In this case you will see the correct state logged without any further action necessary.
To verify baseline profile installation locally, you need to manually trigger baseline
profile installation.

For immediate compilation, call:

```bash
adb shell cmd package compile -f -m speed-profile me.jerryokafor.ihenkiri
```

You can also trigger background optimizations:

```bash
adb shell pm bg-dexopt-job
```

Both jobs run asynchronously and might take some time complete.
To see quick turnaround of the ProfileVerifier, we recommend using `speed-profile`.
If you don't do either of these steps, you might only see the profile status reported as
"enqueued for compilation" when running the sample locally.

Generate the Baseline Profile

```bash
./gradlew :app:generateBaselineProfile
```

# Architecture

[Todo]
# Todo

- [ ] Performance (Baseline Profile + R8)
- [ ] Different Screen Sizes

## References

Expand All @@ -257,7 +305,7 @@ We use Roborazzi to achieve this screenshot testing.
- [Testing Kotlin flows on Android](https://developer.android.com/kotlin/flow/test)
- [Testing Kotlin coroutines on Android](https://developer.android.com/kotlin/coroutines/test)
- [Best practices for coroutines in Android](https://developer.android.com/kotlin/coroutines/coroutines-best-practices)

- [Distinguishing between the different ProGuard “-keep” directives](https://jebware.com/blog/?p=418)

# License

Expand Down
2 changes: 1 addition & 1 deletion androidTest/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ dependencies {
}

implementation(project(":feature:movies"))
debugImplementation(project(":ui-test-hilt-manifest"))
// debugImplementation(project(":ui-test-hilt-manifest"))

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
Expand Down
Loading

0 comments on commit 7e3fad9

Please sign in to comment.