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