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 #3090: Removing context initialization from test setup #3111

Merged

Conversation

sierisimo
Copy link
Contributor

@sierisimo sierisimo commented Apr 21, 2021

Fix #3090:

Explanation

In the ExplorationActivityTest dagger has been setup and the context is now injected, the line in the setup is unnecessary as noted in #3090

Screenshot of tests

image

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The PR follows the style guide.
  • The PR does not contain any unnecessary auto-generated code from Android Studio.
  • The PR is made from a branch that's not called "develop".
  • The PR is made from a branch that is up-to-date with "develop".
  • The PR's branch is based on "develop" and not on any other branch.
  • The PR is assigned to an appropriate reviewer in both the Assignees and the Reviewers sections.

The Context is being setup manually in the setup method but this is unnecessary as it is already inject using Dagger.
@anandwana001
Copy link
Contributor

anandwana001 commented Apr 22, 2021

Thanks, @sierisimo for sending your first PR.
Few suggestions:

  1. Follow the checklist in the PR description and mark done if it is completed or done in the PR.
  2. PR title should be in the format Fix #bugnum: ...
  3. PR description should have format Fixes #bugnum: ...
  4. Branch name looks good to me.
  5. For the screenshot, could you confirm if this is an espresso test result or a robolectric test result? What we actually looking for is an espresso test result screenshot.
  6. As you are a new contributor, you can simply mention the issue author in the comment in your PR once the PR is ready for review.
  7. You can join our Gitter channel where we have all the communication with all other contributors - https://gitter.im/oppia/oppia-android
  8. Also, you need to comment on issue, that you want to work on it so the issue author can assign the issue to you.

@sierisimo sierisimo changed the title Fix #3090 - Removing context initialization from test setup Fix #3090: Removing context initialization from test setup Apr 22, 2021
@sierisimo
Copy link
Contributor Author

Sorry for the inconvenience, I originally checked the checklist options I though I satisfied but later though it was something the reviewer will mark.

For the espresso part, how can I show/confirm the test is espresso test? Sharing screenshot of the adb instruction run by android studio or maybe running a concrete gradle task?

Thanks for your comment!

@anandwana001
Copy link
Contributor

As from the Icon in your screenshot, I can confirm this is the espresso test only. But, I think this will be helpful and learning too if you check here on how to run espresso test - https://developer.android.com/codelabs/advanced-android-kotlin-training-testing-basics#4
and Robolectric test - https://github.com/oppia/oppia-android/wiki/Oppia-Android-Testing#running-robolectric-tests

Copy link
Contributor

@anandwana001 anandwana001 left a comment

Choose a reason for hiding this comment

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

LGTM

@anandwana001 anandwana001 assigned BenHenning and unassigned sierisimo Apr 26, 2021
@sierisimo
Copy link
Contributor Author

Thanks for those resources, I'm used to running tests but seeing the @Config and @LooperMode confused me about it.

Thanks for your review! I'll wait for @BenHenning

Copy link
Sponsor Member

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

Thanks @sierisimo. LGTM.

@BenHenning BenHenning merged commit d285fe9 into oppia:develop Apr 27, 2021
@sierisimo sierisimo deleted the remove-context-exploration-activity branch May 26, 2021 18:34
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.

Remove context initialization in ExplorationActivityTest
3 participants