Repository navigation
Fix #6190: Add tests for ApplicationLifecycleLogger - #6491
Aranya0811 wants to merge 8 commits into
Conversation
… ID updates, startup latency, feature flag logging, and foreground/background events
…ed directly by ApplicationLifecycleLoggerTest
|
@Aranya0811 this PR is being marked as draft because the PR description must contain 'Fixes #' or 'Fixes part of #' for each issue the PR is changing, and each one on its own line with no other text. |
Coverage ReportResultsCoverage Analysis: SKIP ⏭️ This PR did not introduce any changes to Kotlin source or test files.
|
|
Greetings @Neer-rn @adhiamboperes |
|
@Aranya0811 Please look at the PR description and make sure its following the PR template. Also assign it to someone if you think its ready for review. |
|
Hi @Aranya0811, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
|
Greetings @Neer-rn, thanks for the feedback! I've fixed the PR description to follow the template and pushed a new commit to re-run the checks. |
…ation-lifecycle-logger
Fixes #6190
Explaination
Adds tests for
ApplicationLifecycleLogger, which didn't have its own tests after it was split out ofApplicationLifecycleObserver.I created
ApplicationLifecycleLoggerTest(and its test target inBUILD.bazel). It calls the logger's methods directly, without going through a real activity. The tests check that:IllegalStateException.I also removed the
ApplicationLifecycleLogger.ktentry fromscripts/assets/test_file_exemptions.textproto. That entry exempted the file from needing a test, and now that it has a test file, the Testfile Presence Check requires the exemption to be removed.As part of the issue, I also updated
ApplicationLifecycleObserverTestand removed two tests that were testing the logger rather than the observer, since the new logger tests now cover them:testObserver_getCurrentScreen_verifyInitialValueIsUnspecifiedtestObserver_onAppInForeground_doesNotLogCpuUsageThe remaining observer tests were kept because they run through a real activity and therefore verify the interaction between the observer and logger.
I also removed the
TODO(#6190): Add tests for this class.comment fromApplicationLifecycleLogger, since the tests now exist.Testing performed locally:
ApplicationLifecycleLoggerTest— 20 tests passedApplicationLifecycleObserverTest— 19 tests passedEssential Checklist
Disclosure of LLM Usage
ApplicationLifecycleLoggerimplementation, its record keeper, and the existing observer and CPU snapshotter tests.CpuPerformanceSnapshotterimplementation and existing snapshotter tests and learned that it handles changes through a queue, so the test neededrunCurrent()before moving time forward.I ran both test targets myself and made the final decisions on what to include.