@@ -67,11 +67,10 @@ func testRefReadFile(t *testing.T, sb integration.Sandbox) {
67
67
68
68
testcontent := []byte (`foobar` )
69
69
70
- dir , err := tmpdir (
70
+ dir := integration . Tmpdir (
71
71
t ,
72
72
fstest .CreateFile ("test" , testcontent , 0666 ),
73
73
)
74
- require .NoError (t , err )
75
74
76
75
frontend := func (ctx context.Context , c gateway.Client ) (* gateway.Result , error ) {
77
76
def , err := llb .Local ("mylocal" ).Marshal (ctx )
@@ -130,7 +129,7 @@ func testRefReadDir(t *testing.T, sb integration.Sandbox) {
130
129
require .NoError (t , err )
131
130
defer c .Close ()
132
131
133
- dir , err := tmpdir (
132
+ dir := integration . Tmpdir (
134
133
t ,
135
134
fstest .CreateDir ("somedir" , 0777 ),
136
135
fstest .CreateFile ("somedir/foo1.txt" , []byte (`foo1` ), 0666 ),
@@ -139,7 +138,6 @@ func testRefReadDir(t *testing.T, sb integration.Sandbox) {
139
138
fstest .Symlink ("bar.log" , "somedir/link.log" ),
140
139
fstest .CreateDir ("somedir/baz.dir" , 0777 ),
141
140
)
142
- require .NoError (t , err )
143
141
144
142
expMap := make (map [string ]* fstypes.Stat )
145
143
@@ -248,11 +246,10 @@ func testRefStatFile(t *testing.T, sb integration.Sandbox) {
248
246
249
247
testcontent := []byte (`foobar` )
250
248
251
- dir , err := tmpdir (
249
+ dir := integration . Tmpdir (
252
250
t ,
253
251
fstest .CreateFile ("test" , testcontent , 0666 ),
254
252
)
255
- require .NoError (t , err )
256
253
257
254
exp , err := fsutil .Stat (filepath .Join (dir , "test" ))
258
255
require .NoError (t , err )
@@ -340,11 +337,3 @@ func testRefEvaluate(t *testing.T, sb integration.Sandbox) {
340
337
_ , err = c .Build (ctx , client.SolveOpt {}, "" , frontend , nil )
341
338
require .NoError (t , err )
342
339
}
343
-
344
- func tmpdir (t * testing.T , appliers ... fstest.Applier ) (string , error ) {
345
- tmpdir := t .TempDir ()
346
- if err := fstest .Apply (appliers ... ).Apply (tmpdir ); err != nil {
347
- return "" , err
348
- }
349
- return tmpdir , nil
350
- }
0 commit comments