@@ -67,11 +67,10 @@ func testRefReadFile(t *testing.T, sb integration.Sandbox) {
6767
6868 testcontent := []byte (`foobar` )
6969
70- dir , err := tmpdir (
70+ dir := integration . Tmpdir (
7171 t ,
7272 fstest .CreateFile ("test" , testcontent , 0666 ),
7373 )
74- require .NoError (t , err )
7574
7675 frontend := func (ctx context.Context , c gateway.Client ) (* gateway.Result , error ) {
7776 def , err := llb .Local ("mylocal" ).Marshal (ctx )
@@ -130,7 +129,7 @@ func testRefReadDir(t *testing.T, sb integration.Sandbox) {
130129 require .NoError (t , err )
131130 defer c .Close ()
132131
133- dir , err := tmpdir (
132+ dir := integration . Tmpdir (
134133 t ,
135134 fstest .CreateDir ("somedir" , 0777 ),
136135 fstest .CreateFile ("somedir/foo1.txt" , []byte (`foo1` ), 0666 ),
@@ -139,7 +138,6 @@ func testRefReadDir(t *testing.T, sb integration.Sandbox) {
139138 fstest .Symlink ("bar.log" , "somedir/link.log" ),
140139 fstest .CreateDir ("somedir/baz.dir" , 0777 ),
141140 )
142- require .NoError (t , err )
143141
144142 expMap := make (map [string ]* fstypes.Stat )
145143
@@ -248,11 +246,10 @@ func testRefStatFile(t *testing.T, sb integration.Sandbox) {
248246
249247 testcontent := []byte (`foobar` )
250248
251- dir , err := tmpdir (
249+ dir := integration . Tmpdir (
252250 t ,
253251 fstest .CreateFile ("test" , testcontent , 0666 ),
254252 )
255- require .NoError (t , err )
256253
257254 exp , err := fsutil .Stat (filepath .Join (dir , "test" ))
258255 require .NoError (t , err )
@@ -340,11 +337,3 @@ func testRefEvaluate(t *testing.T, sb integration.Sandbox) {
340337 _ , err = c .Build (ctx , client.SolveOpt {}, "" , frontend , nil )
341338 require .NoError (t , err )
342339}
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