@@ -74,7 +74,7 @@ type Options struct {
74
74
75
75
// New constructs a codersdk client connected to an in-memory API instance.
76
76
func New (t * testing.T , options * Options ) * codersdk.Client {
77
- client , _ := newWithAPI (t , options )
77
+ client , _ := newWithCloser (t , options )
78
78
return client
79
79
}
80
80
@@ -87,13 +87,18 @@ func NewWithProvisionerCloser(t *testing.T, options *Options) (*codersdk.Client,
87
87
options = & Options {}
88
88
}
89
89
options .IncludeProvisionerD = true
90
- client , close := newWithAPI (t , options )
90
+ client , close := newWithCloser (t , options )
91
91
return client , close
92
92
}
93
93
94
- // newWithAPI constructs a codersdk client connected to an in-memory API instance.
94
+ // newWithCloser constructs a codersdk client connected to an in-memory API instance.
95
95
// The returned closer closes a provisioner if it was provided
96
- func newWithAPI (t * testing.T , options * Options ) (* codersdk.Client , io.Closer ) {
96
+ // The API is intentionally not returned here because coderd tests should not
97
+ // require a handle to the API. Do not expose the API or wrath shall descend
98
+ // upon thee. Even the io.Closer that is exposed here shouldn't be exposed
99
+ // and is a temporary measure while the API to register provisioners is ironed
100
+ // out.
101
+ func newWithCloser (t * testing.T , options * Options ) (* codersdk.Client , io.Closer ) {
97
102
if options == nil {
98
103
options = & Options {}
99
104
}
0 commit comments