Add expected queries and enhance tests for Repository access queries.

Review Request #13409 — Created Nov. 8, 2023 and updated

Information

Review Board
release-5.0.x

Reviewers

This adds pre-built expected queries for:

  • Repository.objects.accessible()
  • Repository.objects.accessible_ids()

These functions live in reviewboard.scmtools.testing.queries, and can
be reused throughout our test suite. It's written in a verbose manner
that ensures we only ever test against finalized Q expressions, to
minimize chances of regressions or unexpected behavior.

The unit tests for .accessible() and .accessible_ids() have been
completely rewritten. They now check against these expected queries, but
they've also been expanded considerably to more thoroughly check access
with positive and negative test data, to better catch regressions. The
approach being used here will be carried over to other accessibility
tests for the next batch of this peformance work.

Unit tests pass.

Summary ID
Add expected queries and enhance tests for Repository access queries.
This adds pre-built expected queries for: * `Repository.objects.accessible()` * `Repository.objects.accessible_ids()` These functions live in `reviewboard.scmtools.testing.queries`, and can be reused throughout our test suite. It's written in a verbose manner that ensures we only ever test against finalized Q expressions, to minimize chances of regressions or unexpected behavior. The unit tests for `.accessible()` and `.accessible_ids()` have been completely rewritten. They now check against these expected queries, but they've also been expanded considerably to more thoroughly check access with positive and negative test data, to better catch regressions. The approach being used here will be carried over to other accessibility tests for the next batch of this peformance work.
c9d92274c8bd4324b397be9aaacca4ba12864433
Description From Last Updated

'typing.Optional' imported but unused Column: 1 Error code: F401

reviewbotreviewbot

'django.contrib.auth.models.Permission' imported but unused Column: 1 Error code: F401

reviewbotreviewbot

'reviewboard.accounts.models.LocalSiteProfile' imported but unused Column: 1 Error code: F401

reviewbotreviewbot

'reviewboard.accounts.models.Profile' imported but unused Column: 1 Error code: F401

reviewbotreviewbot

'reviewboard.reviews.models.Group' imported but unused Column: 1 Error code: F401

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Change Summary:

Added missing __note__ values.

Commits:

Summary ID
Add expected queries and enhance tests for Repository access queries.
This adds pre-built expected queries for: * `Repository.objects.accessible()` * `Repository.objects.accessible_ids()` These functions live in `reviewboard.scmtools.testing.queries`, and can be reused throughout our test suite. It's written in a verbose manner that ensures we only ever test against finalized Q expressions, to minimize chances of regressions or unexpected behavior. The unit tests for `.accessible()` and `.accessible_ids()` have been completely rewritten. They now check against these expected queries, but they've also been expanded considerably to more thoroughly check access with positive and negative test data, to better catch regressions. The approach being used here will be carried over to other accessibility tests for the next batch of this peformance work.
9f6633a53ca2bd96e587880e8b15b26d80ddb5ce
Add expected queries and enhance tests for Repository access queries.
This adds pre-built expected queries for: * `Repository.objects.accessible()` * `Repository.objects.accessible_ids()` These functions live in `reviewboard.scmtools.testing.queries`, and can be reused throughout our test suite. It's written in a verbose manner that ensures we only ever test against finalized Q expressions, to minimize chances of regressions or unexpected behavior. The unit tests for `.accessible()` and `.accessible_ids()` have been completely rewritten. They now check against these expected queries, but they've also been expanded considerably to more thoroughly check access with positive and negative test data, to better catch regressions. The approach being used here will be carried over to other accessibility tests for the next batch of this peformance work.
c9d92274c8bd4324b397be9aaacca4ba12864433

Diff:

Revision 3 (+3124 -618)

Show changes

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
david
  1. Ship It!
  2. 
      
maubin
  1. Ship It!
  2. 
      
Loading...