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

Fixes part of #4302 - Introducing a JUnit annotation & rule for overriding Platform Parameters and Feature Flags #5565

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

Rd4dev
Copy link
Collaborator

@Rd4dev Rd4dev commented Nov 4, 2024

Explanation

Fixes part of #4302

This PR includes

A draft implementation for overriding platform parameters and feature flags in the tests using the PlatformParameterModule at class and functional level.

Validation Details

  • Feature flags on Function level & Class level

    • Enable Feature flag performed on SpotlightFragmentTest.kt
    • Disable Feature flag and Reset Feature flag with the above class level validation, feature disabled only for testSpotlightFragment_disableSpotlights_requestSpotlight_shouldNotShowSpotlight
  • Repeatable Annotation

    • Performed on ProfileAndDeviceIdFragmentTest.kt with testFragment_multipleProfiles_clickShareIdsAndLogs_sendsIntentWithIdsAndLogsText that required enabling both
      • android_enable_logging_learner_study_ids
      • android_enable_learner_study_analytics
  • Overriding PlatformParameter value

    • Performed on StateFragmentTest.kt with testStateFragment_mathInteractions_numericExp_validAns_submissionDisplaysLatex while the default "cache_latex_rendering" was switched off, with @OverrideBoolParameter("cache_latex_rendering", true) annotation.

Todo on approval / feedback:

  • Alter the implementation based on feedback received from the review process.
  • Once approved, the final version will replace the old module with the new functionality across all applicable tests.
  • Remove debugging statements.
  • KDocs will be added.

Note:

  • Any altered parameter values in this draft are solely for testing and validating the functionality.
  • These changes will be reverted to their original states once the PR is out of draft.
  • Current tests may fail due to the temporary removal of TestPlatformParameterModule in certain test classes.
  • This setup is intended to validate the overridden values in the new implementation.

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).

…ameters

Initial commit, this works with individual overrides while having multiple enable / diasable annotations mess with the overriding and cause the default value to be thrown even with a dummy feature flag name and this commit doesn't address platform parameter value overrides and doesnot check for Oppia Test Rule to be present on all tests.
…or both feature flags and parameter value overrides
@Rd4dev
Copy link
Collaborator Author

Rd4dev commented Nov 4, 2024

@BenHenning @adhiamboperes Would it be possible to provide a draft review or approval on the implementation to ensure things are on the right track before I proceed with the rest? I would like to confirm if the mentioned

"Updating all tests to use the production module instead of the test or a custom module, and adding OppiaTestRule/test annotations where needed to ensure overrides are still happening."

is done right. If not then will rework based on the feedback.

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.

3 participants