mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
Enterprise rbac testing (#3653)
* WIP refactor Auth tests to allow enterprise Signed-off-by: Spike Curtis <spike@coder.com> * enterprise RBAC testing Signed-off-by: Spike Curtis <spike@coder.com> * Fix import ordering Signed-off-by: Spike Curtis <spike@coder.com> Signed-off-by: Spike Curtis <spike@coder.com>
This commit is contained in:
@ -103,6 +103,14 @@ func NewWithProvisionerCloser(t *testing.T, options *Options) (*codersdk.Client,
|
||||
// and is a temporary measure while the API to register provisioners is ironed
|
||||
// out.
|
||||
func newWithCloser(t *testing.T, options *Options) (*codersdk.Client, io.Closer) {
|
||||
client, closer, _ := newWithAPI(t, options)
|
||||
return client, closer
|
||||
}
|
||||
|
||||
// newWithAPI constructs an in-memory API instance and returns a client to talk to it.
|
||||
// Most tests never need a reference to the API, but AuthorizationTest in this module uses it.
|
||||
// Do not expose the API or wrath shall descend upon thee.
|
||||
func newWithAPI(t *testing.T, options *Options) (*codersdk.Client, io.Closer, *coderd.API) {
|
||||
if options == nil {
|
||||
options = &Options{}
|
||||
}
|
||||
@ -216,7 +224,7 @@ func newWithCloser(t *testing.T, options *Options) (*codersdk.Client, io.Closer)
|
||||
_ = provisionerCloser.Close()
|
||||
})
|
||||
|
||||
return codersdk.New(serverURL), provisionerCloser
|
||||
return codersdk.New(serverURL), provisionerCloser, coderAPI
|
||||
}
|
||||
|
||||
// NewProvisionerDaemon launches a provisionerd instance configured to work
|
||||
|
Reference in New Issue
Block a user