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

display last 3 achievements #1134

Merged
merged 4 commits into from
Jul 22, 2021

Conversation

diananova
Copy link
Contributor

@diananova diananova commented Jul 19, 2021

Description

The achievements list retrieved from /home endpoint retrieves the latest three achievements, instead of the first three.

Fixes #393

Type of Change:

  • Code
  • Quality Assurance

Code/Quality Assurance Only

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • I added a new test in test_api_home_statistics.py
  • I also tested it manually by creating 5 tasks (and set them to complete). The result at GET /home should be the last three achievements (ex. id 5,4,3 instead of 1,2,3).
    image

Checklist:

  • My PR follows the style guidelines of this project
  • I have performed a self-review of my own code or materials
  • I have commented my code or provided relevant documentation, particularly in hard-to-understand areas

Code/Quality Assurance Only

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@diananova diananova marked this pull request as ready for review July 20, 2021 00:11
@diananova
Copy link
Contributor Author

I'm not sure why the build/coverage report is failing. It doesn't seem related to my changes.
I'm also getting a different error locally.
Local:
FAILED tests/mentorship_relation/test_dao_creation.py::TestMentorshipRelationCreationDAO::test_dao_create_mentorship_relation_with_good_args_but_invalid_timestamp
Github:
FAILED tests/task_comments/test_api_get_task_comments.py::TestGetTaskCommentsApi::test_task_comment_listing_api_with_task_not_existing

@epicadk epicadk added the Status: Needs Review PR needs an additional review or a maintainer's review. label Jul 20, 2021
epicadk
epicadk previously approved these changes Jul 20, 2021
@epicadk
Copy link
Member

epicadk commented Jul 20, 2021

I think you need to make a change to the existing test.

@codecov
Copy link

codecov bot commented Jul 20, 2021

Codecov Report

Merging #1134 (8d4fe3b) into develop (4193589) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1134   +/-   ##
========================================
  Coverage    92.91%   92.91%           
========================================
  Files           38       38           
  Lines         2062     2062           
========================================
  Hits          1916     1916           
  Misses         146      146           
Impacted Files Coverage Δ
app/api/dao/user.py 85.82% <100.00%> (ø)

@diananova
Copy link
Contributor Author

diananova commented Jul 20, 2021

@epicadk @isabelcosta Ready for review. I didn't make any changes, the tests are flaky.

@diananova diananova requested a review from epicadk July 20, 2021 14:18
@epicadk
Copy link
Member

epicadk commented Jul 20, 2021

@epicadk @isabelcosta Ready for review. I didn't make any changes, the tests are flaky.

Which one exactly? This seems to be the first time it's happened.

@diananova
Copy link
Contributor Author

@epicadk @isabelcosta Ready for review. I didn't make any changes, the tests are flaky.

Which one exactly? This seems to be the first time it's happened.

tests/task_comments/test_api_get_task_comments.py::TestGetTaskCommentsApi::test_task_comment_listing_api_with_task_not_existing.
It's an assertion error (we get code 403 instead of 404). Might have been a one time problem.
image

@isabelcosta
Copy link
Member

Interesting 🤔 I saw your changes yesterday, and thought you fixed the tests when you added str(i) while concatenating a string. The coverage report steps have been failing at times. So I would not worry about that, this should be an issue to fix aside from your PR @diananova :)

Copy link
Member

@isabelcosta isabelcosta left a comment

Choose a reason for hiding this comment

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

Great work @diananova 👏🏾
Thank you for adding tests and following our guidelines!

@epicadk epicadk added Status: Needs Testing Work has been reviewed and needs the code tested by the quality assurance team. and removed Status: Needs Review PR needs an additional review or a maintainer's review. labels Jul 21, 2021
@isabelcosta isabelcosta temporarily deployed to ms-backend-review-pr-1134 July 22, 2021 21:06 Inactive
@isabelcosta
Copy link
Member

The changes made in this PR were tested locally. Following are the results:

  1. Code review - Done

  2. All possible responses (positive and negative tests) were tested as below:

    • GET /home endpoint
      Screenshot/gif: left (this branch deployed) / right (develop branch deployed)
      image

      Expected Result: tasks returned are the oldest ones
      Actual Result: tasks returned are the most recent ones

  3. Additional Comments: Tested on https://ms-backend-review-pr-1134.herokuapp.com/

  4. Status of PR Changed to: Ready to Merge.

@isabelcosta isabelcosta added Status: Ready to Merge Work has been tested and needs a final review and merge from a repo maintainer. and removed Status: Needs Testing Work has been reviewed and needs the code tested by the quality assurance team. labels Jul 22, 2021
@isabelcosta isabelcosta merged commit 4a15a3f into anitab-org:develop Jul 22, 2021
@devkapilbansal
Copy link
Member

I'm not sure why the build/coverage report is failing. It doesn't seem related to my changes.
I'm also getting a different error locally.
Local:
FAILED tests/mentorship_relation/test_dao_creation.py::TestMentorshipRelationCreationDAO::test_dao_create_mentorship_relation_with_good_args_but_invalid_timestamp
Github:
FAILED tests/task_comments/test_api_get_task_comments.py::TestGetTaskCommentsApi::test_task_comment_listing_api_with_task_not_existing

@diananova consider opening an issue for both errors including the build id in which they occur. If tests are flaky, we need to fix them too. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Ready to Merge Work has been tested and needs a final review and merge from a repo maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recent achievements retrieving the first three achievements.
4 participants