@@ -53,7 +53,9 @@ func TestTemplatePull_NoName(t *testing.T) {
53
53
func TestTemplatePull_Stdout (t * testing.T ) {
54
54
t .Parallel ()
55
55
56
- client := coderdtest .New (t , & coderdtest.Options {IncludeProvisionerDaemon : true })
56
+ client := coderdtest .New (t , & coderdtest.Options {
57
+ IncludeProvisionerDaemon : true ,
58
+ })
57
59
user := coderdtest .CreateFirstUser (t , client )
58
60
59
61
// Create an initial template bundle.
@@ -72,7 +74,8 @@ func TestTemplatePull_Stdout(t *testing.T) {
72
74
73
75
// Update the template version so that we can assert that templates
74
76
// are being sorted correctly.
75
- _ = coderdtest .UpdateTemplateVersion (t , client , user .OrganizationID , source2 , template .ID )
77
+ updatedVersion := coderdtest .UpdateTemplateVersion (t , client , user .OrganizationID , source2 , template .ID )
78
+ _ = coderdtest .AwaitTemplateVersionJob (t , client , updatedVersion .ID )
76
79
77
80
inv , root := clitest .New (t , "templates" , "pull" , "--tar" , template .Name )
78
81
clitest .SetupConfig (t , client , root )
@@ -91,7 +94,9 @@ func TestTemplatePull_Stdout(t *testing.T) {
91
94
func TestTemplatePull_ToDir (t * testing.T ) {
92
95
t .Parallel ()
93
96
94
- client := coderdtest .New (t , & coderdtest.Options {IncludeProvisionerDaemon : true })
97
+ client := coderdtest .New (t , & coderdtest.Options {
98
+ IncludeProvisionerDaemon : true ,
99
+ })
95
100
user := coderdtest .CreateFirstUser (t , client )
96
101
97
102
// Create an initial template bundle.
@@ -110,7 +115,8 @@ func TestTemplatePull_ToDir(t *testing.T) {
110
115
111
116
// Update the template version so that we can assert that templates
112
117
// are being sorted correctly.
113
- _ = coderdtest .UpdateTemplateVersion (t , client , user .OrganizationID , source2 , template .ID )
118
+ updatedVersion := coderdtest .UpdateTemplateVersion (t , client , user .OrganizationID , source2 , template .ID )
119
+ _ = coderdtest .AwaitTemplateVersionJob (t , client , updatedVersion .ID )
114
120
115
121
dir := t .TempDir ()
116
122
@@ -138,7 +144,9 @@ func TestTemplatePull_ToDir(t *testing.T) {
138
144
// and writes it to a directory with the name of the template if the path is not implicitly supplied.
139
145
// nolint: paralleltest
140
146
func TestTemplatePull_ToImplicit (t * testing.T ) {
141
- client := coderdtest .New (t , & coderdtest.Options {IncludeProvisionerDaemon : true })
147
+ client := coderdtest .New (t , & coderdtest.Options {
148
+ IncludeProvisionerDaemon : true ,
149
+ })
142
150
user := coderdtest .CreateFirstUser (t , client )
143
151
144
152
// Create an initial template bundle.
@@ -157,7 +165,8 @@ func TestTemplatePull_ToImplicit(t *testing.T) {
157
165
158
166
// Update the template version so that we can assert that templates
159
167
// are being sorted correctly.
160
- _ = coderdtest .UpdateTemplateVersion (t , client , user .OrganizationID , source2 , template .ID )
168
+ updatedVersion := coderdtest .UpdateTemplateVersion (t , client , user .OrganizationID , source2 , template .ID )
169
+ _ = coderdtest .AwaitTemplateVersionJob (t , client , updatedVersion .ID )
161
170
162
171
// create a tempdir and change the working directory to it for the duration of the test (cannot run in parallel)
163
172
dir := t .TempDir ()
@@ -196,7 +205,9 @@ func TestTemplatePull_ToImplicit(t *testing.T) {
196
205
func TestTemplatePull_FolderConflict (t * testing.T ) {
197
206
t .Parallel ()
198
207
199
- client := coderdtest .New (t , & coderdtest.Options {IncludeProvisionerDaemon : true })
208
+ client := coderdtest .New (t , & coderdtest.Options {
209
+ IncludeProvisionerDaemon : true ,
210
+ })
200
211
user := coderdtest .CreateFirstUser (t , client )
201
212
202
213
// Create an initial template bundle.
@@ -215,7 +226,8 @@ func TestTemplatePull_FolderConflict(t *testing.T) {
215
226
216
227
// Update the template version so that we can assert that templates
217
228
// are being sorted correctly.
218
- _ = coderdtest .UpdateTemplateVersion (t , client , user .OrganizationID , source2 , template .ID )
229
+ updatedVersion := coderdtest .UpdateTemplateVersion (t , client , user .OrganizationID , source2 , template .ID )
230
+ _ = coderdtest .AwaitTemplateVersionJob (t , client , updatedVersion .ID )
219
231
220
232
dir := t .TempDir ()
221
233
0 commit comments