Skip to content

Commit 1e31797

Browse files
committed
Review comments
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent a61814e commit 1e31797

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cli/templatepull_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ func TestTemplatePull_LatestStdout(t *testing.T) {
230230

231231
// ToDir tests that 'templates pull' pulls down the active template
232232
// and writes it to the correct directory.
233+
//
234+
// nolint: tparallel // The subtests cannot be run in parallel; see the inner loop.
233235
func TestTemplatePull_ToDir(t *testing.T) {
234236
t.Parallel()
235237

@@ -270,8 +272,14 @@ func TestTemplatePull_ToDir(t *testing.T) {
270272
t.Run(tc.name, func(t *testing.T) {
271273
// Use a different working directory to not interfere with actual directory when using relative paths.
272274
newWD := t.TempDir()
275+
cwd, err := os.Getwd()
276+
require.NoError(t, err)
273277
require.NoError(t, os.Chdir(newWD))
274278

279+
t.Cleanup(func() {
280+
require.NoError(t, os.Chdir(cwd))
281+
})
282+
275283
t.Cleanup(func() {
276284
_ = os.RemoveAll(tc.givenPath)
277285
_ = os.RemoveAll(expectedDest)

0 commit comments

Comments
 (0)