@@ -397,9 +397,8 @@ copy Dockerfile .
397
397
Level : 1 ,
398
398
},
399
399
},
400
- StreamBuildErr : "failed to solve: lint violation found for rules: FromAsCasing" ,
401
- UnmarshalBuildErr : "lint violation found for rules: FromAsCasing" ,
402
- BuildErrLocation : 2 ,
400
+ BuildErr : "lint violation found for rules: FromAsCasing" ,
401
+ BuildErrLocation : 2 ,
403
402
})
404
403
405
404
dockerfile = []byte (`#check=skip=all
@@ -418,9 +417,8 @@ copy Dockerfile .
418
417
Level : 1 ,
419
418
},
420
419
},
421
- StreamBuildErr : "failed to solve: lint violation found for rules: FromAsCasing" ,
422
- UnmarshalBuildErr : "lint violation found for rules: FromAsCasing" ,
423
- BuildErrLocation : 2 ,
420
+ BuildErr : "lint violation found for rules: FromAsCasing" ,
421
+ BuildErrLocation : 2 ,
424
422
FrontendAttrs : map [string ]string {
425
423
"build-arg:BUILDKIT_DOCKERFILE_CHECK" : "skip=ConsistentInstructionCasing;error=true" ,
426
424
},
@@ -858,9 +856,8 @@ BADCMD
858
856
Line : 3 ,
859
857
},
860
858
},
861
- StreamBuildErr : "failed to solve: dockerfile parse error on line 4: unknown instruction: BADCMD" ,
862
- UnmarshalBuildErr : "dockerfile parse error on line 4: unknown instruction: BADCMD" ,
863
- BuildErrLocation : 4 ,
859
+ BuildErr : "dockerfile parse error on line 4: unknown instruction: BADCMD" ,
860
+ BuildErrLocation : 4 ,
864
861
})
865
862
}
866
863
@@ -922,9 +919,8 @@ COPY Dockerfile .
922
919
Line : 2 ,
923
920
},
924
921
},
925
- StreamBuildErr : "failed to solve: empty platform value from expression $BULIDPLATFORM (did you mean BUILDPLATFORM?)" ,
926
- UnmarshalBuildErr : "empty platform value from expression $BULIDPLATFORM (did you mean BUILDPLATFORM?)" ,
927
- BuildErrLocation : 2 ,
922
+ BuildErr : "empty platform value from expression $BULIDPLATFORM (did you mean BUILDPLATFORM?)" ,
923
+ BuildErrLocation : 2 ,
928
924
})
929
925
930
926
osName := integration .UnixOrWindows ("linux" , "windows" )
@@ -939,10 +935,7 @@ COPY Dockerfile .
939
935
osName , osName , baseImg ))
940
936
941
937
osStr := integration .UnixOrWindows ("linux" , "windows" )
942
- streamBuildErr := fmt .Sprintf (
943
- "failed to solve: failed to parse platform %s/${MYARCH}: \" \" is an invalid component of \" %s/\" : platform specifier component must match \" ^[A-Za-z0-9_.-]+$\" : invalid argument (did you mean MY_ARCH?)" ,
944
- osStr , osStr )
945
- unmarshalBuildErr := fmt .Sprintf (
938
+ buildErr := fmt .Sprintf (
946
939
"failed to parse platform %s/${MYARCH}: \" \" is an invalid component of \" %s/\" : platform specifier component must match \" ^[A-Za-z0-9_.-]+$\" : invalid argument (did you mean MY_ARCH?)" ,
947
940
osStr , osStr )
948
941
checkLinterWarnings (t , sb , & lintTestParams {
@@ -957,9 +950,8 @@ COPY Dockerfile .
957
950
Line : 4 ,
958
951
},
959
952
},
960
- StreamBuildErr : streamBuildErr ,
961
- UnmarshalBuildErr : unmarshalBuildErr ,
962
- BuildErrLocation : 4 ,
953
+ BuildErr : buildErr ,
954
+ BuildErrLocation : 4 ,
963
955
})
964
956
965
957
dockerfile = []byte (fmt .Sprintf (
@@ -1470,12 +1462,12 @@ func checkUnmarshal(t *testing.T, sb integration.Sandbox, lintTest *lintTestPara
1470
1462
lintResults , err := unmarshalLintResults (res )
1471
1463
require .NoError (t , err )
1472
1464
1473
- if lintTest .UnmarshalBuildErr == "" && lintTest .UnmarshalBuildErrRegexp == nil {
1465
+ if lintTest .BuildErr == "" && lintTest .UnmarshalBuildErrRegexp == nil {
1474
1466
require .Nil (t , lintResults .Error )
1475
1467
} else {
1476
1468
require .NotNil (t , lintResults .Error )
1477
- if lintTest .UnmarshalBuildErr != "" {
1478
- require .Equal (t , lintTest .UnmarshalBuildErr , lintResults .Error .Message )
1469
+ if lintTest .BuildErr != "" {
1470
+ require .Equal (t , lintTest .BuildErr , lintResults .Error .Message )
1479
1471
} else if ! lintTest .UnmarshalBuildErrRegexp .MatchString (lintResults .Error .Message ) {
1480
1472
t .Fatalf ("error %q does not match %q" , lintResults .Error .Message , lintTest .UnmarshalBuildErrRegexp .String ())
1481
1473
}
@@ -1562,14 +1554,14 @@ func checkProgressStream(t *testing.T, sb integration.Sandbox, lintTest *lintTes
1562
1554
dockerui .DefaultLocalNameContext : lintTest .TmpDir ,
1563
1555
},
1564
1556
}, status )
1565
- if lintTest .StreamBuildErr == "" && lintTest .StreamBuildErrRegexp == nil {
1557
+ if lintTest .BuildErr == "" && lintTest .StreamBuildErrRegexp == nil {
1566
1558
if err != nil {
1567
1559
t .Logf ("expected no error, received: %v" , err )
1568
1560
}
1569
1561
require .NoError (t , err )
1570
1562
} else {
1571
- if lintTest .StreamBuildErr != "" {
1572
- require .EqualError (t , err , lintTest .StreamBuildErr )
1563
+ if lintTest .BuildErr != "" {
1564
+ require .ErrorContains (t , err , lintTest .BuildErr )
1573
1565
} else if ! lintTest .StreamBuildErrRegexp .MatchString (err .Error ()) {
1574
1566
t .Fatalf ("error %q does not match %q" , err .Error (), lintTest .StreamBuildErrRegexp .String ())
1575
1567
}
@@ -1695,9 +1687,8 @@ type lintTestParams struct {
1695
1687
DockerIgnore []byte
1696
1688
Warnings []expectedLintWarning
1697
1689
UnmarshalWarnings []expectedLintWarning
1698
- StreamBuildErr string
1690
+ BuildErr string
1699
1691
StreamBuildErrRegexp * regexp.Regexp
1700
- UnmarshalBuildErr string
1701
1692
UnmarshalBuildErrRegexp * regexp.Regexp
1702
1693
BuildErrLocation int32
1703
1694
FrontendAttrs map [string ]string
0 commit comments