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

Fix #5399: Fix tests in LoggingIdentifierControllerTest #5409

Merged

Conversation

BenHenning
Copy link
Member

@BenHenning BenHenning commented May 26, 2024

Explanation

Fixes #5399

This PR addresses the problems outlined in #5399 by:

  • Ensuring that testGetInstallationId_secondAppOpen_providerReturnsSameInstallationIdValue and testFetchInstallationId_secondAppOpen_returnsSameInstallationIdValue are correctly run in a new TestApplication (as inspired by SplashActivityTest).
  • Adding a new test to verify that session ID correctly regenerates in a new app instance (testGetSessionId_secondAppOpen_returnsNewRandomId) which also has the added benefit of providing confidence that the earlier tests are correctly verifying that the installation ID isn't changing, as expected, on a new app instance.
  • Improved the tests around cache corruption (via emptying) and deletion to ensure they correctly demonstrate the failure fallbacks (empty/null for corruption and reinitialization for deletion in the same way as a new app install).

Essential Checklist

  • The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

For UI-specific PRs only

N/A -- This is fixing a specific test and has no impact on UI behaviors.

Copy link
Member Author

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Self-reviewed changes.

@BenHenning BenHenning marked this pull request as ready for review May 26, 2024 03:06
@BenHenning BenHenning requested a review from a team as a code owner May 26, 2024 03:06
@BenHenning BenHenning requested a review from kkmurerwa May 26, 2024 03:06
@BenHenning
Copy link
Member Author

@adhiamboperes PTAL for codeowners.

@kkmurerwa PTAL to verify that this addresses your points in #5399 as expected. I deviated slightly from the suggestions since installation ID should be retained on app restarts unless the database is deleted, whereas session ID should be regenerated.

@kkmurerwa kkmurerwa assigned kkmurerwa and unassigned kkmurerwa May 26, 2024
Copy link
Collaborator

@kkmurerwa kkmurerwa left a comment

Choose a reason for hiding this comment

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

I have looked at the changes and they address the problems I had highlighted in the issue. The only part not included are the appSessionId tests which are understandably not in the codebase yet. I will add them once this PR is merged.

Copy link

oppiabot bot commented May 26, 2024

Unassigning @kkmurerwa since they have already approved the PR.

Copy link
Collaborator

@adhiamboperes adhiamboperes left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @BenHenning !

@adhiamboperes
Copy link
Collaborator

Updating with latest develop and enabling auto-merge to unblock @kkmurerwa

@adhiamboperes adhiamboperes enabled auto-merge (squash) May 30, 2024 06:40
Copy link

oppiabot bot commented May 30, 2024

Unassigning @adhiamboperes since they have already approved the PR.

@adhiamboperes adhiamboperes merged commit 3c7713d into develop May 30, 2024
25 checks passed
@adhiamboperes adhiamboperes deleted the fix-false-positives-logging-identifier-controller-test branch May 30, 2024 07:05
@BenHenning
Copy link
Member Author

Thanks much for the review @adhiamboperes!

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.

[BUG]: Some tests on the LoggingIdentifierControllerTest file are false positives
3 participants