-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add more repo search tests and /api/repo/search integration tests #2453
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
Conversation
0815508
to
44e6ba9
Compare
CI failed. |
@lunny I told you it will and why. I've added 8 new repositories to tests, 4 (2x public, 2x private) are owned by user15, 2 (1x public, 1x private) owned by user16 and user15 is collaborator in both of them and 2 repositories (1x public, 1x private) owned by organization which is owned by user15. That means if you search for public repositories accessible (and related) to user15, you should get 4 public repositories (2 owned by user15, 1 owned by user16 and 1 owned by organization he owns). You should get only public (directly owned or accessible + related by any other non-private rules) repositories of user if it is anonymous search or logged user is different to that user. Am I thinking right? |
models/repo_list_test.go
Outdated
|
||
assert.NotNil(t, repos) | ||
assert.NoError(t, err) | ||
assert.Equal(t, int64(3), count) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Orgnization
repositories should be in collaborate
, I think it's right.
Fixed tests and added 2 new tests for pages and pagesize limit |
de6ae2d
to
798be2d
Compare
Tests failed as expected with current implementation of api and repo search function. I've done tests with #2371 and it will pass these new tests (#2371 rebased on this PR can be found in test-repo-search-implementation). |
798be2d
to
712eff4
Compare
44298dc
to
bb42912
Compare
bb42912
to
b9d56db
Compare
Merged to #2371. |
Add some more tests. Also fixes #2446.
Two integration tests will not pass with current implementation of repo search api because it doesn't return all repositories accessible to user if he is not logged or is different from logged user