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

Add an Authoriser interface and use it to add mocks for testing #98

Merged
merged 5 commits into from
Feb 14, 2025

Conversation

kjsanger
Copy link
Member

The Authoriser interface implements a small subset of the go-irodsclient API sufficient to create mocks to emulate having users and groups from federated zones.

go-irodsclient doesn't have full federation support, but nevertheless federated users are detected and reported by its API. The aim is to allow some level of testing against them without requiring a real federated iRODS servers.

This commit also includes some refactoring to reduce the number of parameters used by some functions, particularly where user/group names and zones are being passed seperately, but are actually related.

@kjsanger
Copy link
Member Author

I think this may be failing because of a bug in go-irodsclient; a first run of the tests fails, while subsequent runs on the same iRODS succeed and the incorrect values seem to be coming up from the go-irodsclient API.

@kjsanger kjsanger force-pushed the feature/mocks-and-tests branch from 7aef239 to 3beb2f1 Compare February 13, 2025 12:35
@kjsanger
Copy link
Member Author

I think this may be failing because of a bug in go-irodsclient

This wasn't the issue, although there is a bug in go-irodsclient because it reports a group as being a member of itself.

@kjsanger kjsanger requested a review from dkj February 13, 2025 12:37
@kjsanger kjsanger force-pushed the feature/mocks-and-tests branch 2 times, most recently from f7c5d5e to 0f5141d Compare February 13, 2025 12:49
The Authoriser interface implements a small subset of the
go-irodsclient API sufficient to create mocks to emulate having users
and groups from federated zones.

go-irodsclient doesn't have full federation support, but nevertheless
federated users are detected and reported by its API. The aim is to
allow some level of testing against them without requiring a real
federated iRODS servers.

This commit also includes some refactoring to reduce the number of
parameters used by some functions, particularly where user/group names
and zones are being passed seperately, but are actually related.
@kjsanger kjsanger force-pushed the feature/mocks-and-tests branch from 0f5141d to f3a61f3 Compare February 13, 2025 12:52
Copy link
Member

@dkj dkj left a comment

Choose a reason for hiding this comment

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

Minor comment changes would be good (unless I've got them wrong of course). One of them is a comment I failed to update on a code change...

Quite keen test server stays off until actually used (possible when I fix-up #97 )

server/handlers.go Outdated Show resolved Hide resolved
server/irods.go Outdated Show resolved Hide resolved
server/irods.go Outdated Show resolved Hide resolved
server/server_suite_test.go Outdated Show resolved Hide resolved
@kjsanger kjsanger merged commit 7a0c056 into wtsi-npg:devel Feb 14, 2025
5 checks passed
@kjsanger kjsanger deleted the feature/mocks-and-tests branch February 14, 2025 18:12
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.

2 participants