@@ -218,6 +218,7 @@ var allTests = []func(t *testing.T, sb integration.Sandbox){
218218 testOCIIndexMediatype ,
219219 testLayerLimitOnMounts ,
220220 testFrontendVerifyPlatforms ,
221+ testFrontendLintSkipVerifyPlatforms ,
221222 testRunValidExitCodes ,
222223 testFileOpSymlink ,
223224}
@@ -10414,6 +10415,52 @@ func testFrontendVerifyPlatforms(t *testing.T, sb integration.Sandbox) {
1041410415 require .Contains (t , string (warnings [0 ].Short ), "do not match result platforms linux/amd64,linux/arm64" )
1041510416}
1041610417
10418+ func testFrontendLintSkipVerifyPlatforms (t * testing.T , sb integration.Sandbox ) {
10419+ c , err := New (sb .Context (), sb .Address ())
10420+ require .NoError (t , err )
10421+ defer c .Close ()
10422+
10423+ frontend := func (ctx context.Context , c gateway.Client ) (* gateway.Result , error ) {
10424+ dockerfile := `
10425+ FROM scratch
10426+ COPY foo /foo
10427+ `
10428+ st := llb .Scratch ().File (
10429+ llb .Mkfile ("Dockerfile" , 0600 , []byte (dockerfile )).
10430+ Mkfile ("foo" , 0600 , []byte ("data" )))
10431+
10432+ def , err := st .Marshal (sb .Context ())
10433+ if err != nil {
10434+ return nil , err
10435+ }
10436+
10437+ return c .Solve (ctx , gateway.SolveRequest {
10438+ FrontendInputs : map [string ]* pb.Definition {
10439+ "context" : def .ToPB (),
10440+ "dockerfile" : def .ToPB (),
10441+ },
10442+ FrontendOpt : map [string ]string {
10443+ "requestid" : "frontend.lint" ,
10444+ "frontend.caps" : "moby.buildkit.frontend.subrequests" ,
10445+ },
10446+ })
10447+ }
10448+
10449+ wc := newWarningsCapture ()
10450+ _ , err = c .Build (sb .Context (), SolveOpt {
10451+ FrontendAttrs : map [string ]string {
10452+ "platform" : "linux/amd64,linux/arm64" ,
10453+ },
10454+ }, "" , frontend , wc .status )
10455+ require .NoError (t , err )
10456+ warnings := wc .wait ()
10457+
10458+ for _ , w := range warnings {
10459+ t .Logf ("warning: %s" , string (w .Short ))
10460+ }
10461+ require .Len (t , warnings , 0 )
10462+ }
10463+
1041710464type warningsCapture struct {
1041810465 status chan * SolveStatus
1041910466 statusDone chan struct {}
@@ -10876,7 +10923,8 @@ func testClientCustomGRPCOpts(t *testing.T, sb integration.Sandbox) {
1087610923 reply interface {},
1087710924 cc * grpc.ClientConn ,
1087810925 invoker grpc.UnaryInvoker ,
10879- opts ... grpc.CallOption ) error {
10926+ opts ... grpc.CallOption ,
10927+ ) error {
1088010928 interceptedMethods = append (interceptedMethods , method )
1088110929 return invoker (ctx , method , req , reply , cc , opts ... )
1088210930 }
0 commit comments