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

test: seed data for permission and roles e2e tests #4173

Merged
merged 21 commits into from
Aug 13, 2024

Conversation

novakzaballa
Copy link
Contributor

@novakzaballa novakzaballa commented Jun 17, 2024

Thanks for submitting a PR! Please check the boxes below:

  • I have run pre-commit to check linting
  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

  • Seed data for permission and roles e2e tests

How did you test this code?

  • Unit tests added

Copy link

vercel bot commented Jun 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Aug 12, 2024 4:45pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Aug 12, 2024 4:45pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Aug 12, 2024 4:45pm

@github-actions github-actions bot added the api Issue related to the REST API label Jun 17, 2024
@novakzaballa novakzaballa changed the title Test/seed data for permission and roles e2e tests test: seed data for permission and roles e2e tests Jun 17, 2024
Copy link
Contributor

github-actions bot commented Jun 17, 2024

Uffizzi Preview deployment-53106 was deleted.

@novakzaballa novakzaballa requested review from a team and matthewelwell and removed request for a team June 17, 2024 21:15
@novakzaballa novakzaballa marked this pull request as ready for review June 17, 2024 21:16
@github-actions github-actions bot added testing and removed testing labels Jun 17, 2024
Copy link

codecov bot commented Jun 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.91%. Comparing base (b7c4f5f) to head (bcd05b7).
Report is 193 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4173      +/-   ##
==========================================
+ Coverage   96.50%   96.91%   +0.41%     
==========================================
  Files        1177     1177              
  Lines       38217    39412    +1195     
==========================================
+ Hits        36883    38198    +1315     
+ Misses       1334     1214     -120     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot added testing and removed testing labels Jun 18, 2024
@github-actions github-actions bot added testing and removed testing labels Jun 18, 2024
@github-actions github-actions bot removed the testing label Jun 18, 2024
@github-actions github-actions bot added testing and removed testing labels Jul 30, 2024
@matthewelwell matthewelwell force-pushed the test/seed-data-for-permission-and-roles-e2e-tests branch from 3e964dc to 9e06563 Compare July 30, 2024 13:23
@github-actions github-actions bot added testing and removed testing labels Jul 30, 2024
zachaysan
zachaysan previously approved these changes Jul 30, 2024
@github-actions github-actions bot added testing and removed testing labels Aug 6, 2024
Comment on lines 40 to 44
elif (
super().has_permission(request, view)
and getattr(request, "is_e2e", False) is True
):
return True
Copy link
Contributor

@matthewelwell matthewelwell Aug 9, 2024

Choose a reason for hiding this comment

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

@novakzaballa even if this was necessary, the call to super() is quite clearly unnecessary as we're early returning on the line above if it's not true.

In general though, this is exactly the job that the E2ETestPermissionMixin is trying to achieve. Can you have another look at this please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You’re right, the call to super() was no longer necessary and has been corrected.

There was an issue with this part of the code that was validating the number of projects and returning False, I moved part of the logic exclusively to this validation.

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, I don't think the mixin is actually doing anything? I would rather see the mixin used, or removed if we can't get it working.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed it since it doesn't do what we expect.

@matthewelwell matthewelwell dismissed zachaysan’s stale review August 9, 2024 10:23

Found issue with subsequent commit.

@github-actions github-actions bot added testing and removed testing labels Aug 12, 2024
@novakzaballa novakzaballa added this pull request to the merge queue Aug 13, 2024
Merged via the queue into main with commit 69994eb Aug 13, 2024
35 checks passed
@novakzaballa novakzaballa deleted the test/seed-data-for-permission-and-roles-e2e-tests branch August 13, 2024 17:43
@novakzaballa novakzaballa linked an issue Aug 15, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add e2e tests for permissions and roles
3 participants