@@ -974,7 +974,6 @@ func testSecurityModeErrors(t *testing.T, sb integration.Sandbox) {
974
974
}
975
975
976
976
func testFrontendImageNaming (t * testing.T , sb integration.Sandbox ) {
977
- integration .CheckFeatureCompat (t , sb , integration .FeatureOCIExporter , integration .FeatureDirectPush )
978
977
requiresLinux (t )
979
978
c , err := New (sb .Context (), sb .Address ())
980
979
require .NoError (t , err )
@@ -1083,12 +1082,15 @@ func testFrontendImageNaming(t *testing.T, sb integration.Sandbox) {
1083
1082
1084
1083
switch exp {
1085
1084
case ExporterOCI :
1085
+ integration .CheckFeatureCompat (t , sb , integration .FeatureOCIExporter )
1086
1086
t .Skip ("oci exporter does not support named images" )
1087
1087
case ExporterDocker :
1088
+ integration .CheckFeatureCompat (t , sb , integration .FeatureOCIExporter )
1088
1089
outW , err := os .Create (out )
1089
1090
require .NoError (t , err )
1090
1091
so .Exports [0 ].Output = fixedWriteCloser (outW )
1091
1092
case ExporterImage :
1093
+ integration .CheckFeatureCompat (t , sb , integration .FeatureDirectPush )
1092
1094
imageName = registry + "/" + imageName
1093
1095
so .Exports [0 ].Attrs ["push" ] = "true"
1094
1096
}
@@ -3747,7 +3749,11 @@ func testBuildPushAndValidate(t *testing.T, sb integration.Sandbox) {
3747
3749
}
3748
3750
3749
3751
func testStargzLazyRegistryCacheImportExport (t * testing.T , sb integration.Sandbox ) {
3750
- integration .CheckFeatureCompat (t , sb , integration .FeatureCacheExport , integration .FeatureCacheImport , integration .FeatureCacheBackendRegistry )
3752
+ integration .CheckFeatureCompat (t , sb ,
3753
+ integration .FeatureCacheExport ,
3754
+ integration .FeatureCacheBackendRegistry ,
3755
+ integration .FeatureOCIExporter ,
3756
+ )
3751
3757
requiresLinux (t )
3752
3758
cdAddress := sb .ContainerdAddress ()
3753
3759
if cdAddress == "" || sb .Snapshotter () != "stargz" {
@@ -3807,6 +3813,7 @@ func testStargzLazyRegistryCacheImportExport(t *testing.T, sb integration.Sandbo
3807
3813
3808
3814
// clear all local state out
3809
3815
ensurePruneAll (t , c , sb )
3816
+ integration .CheckFeatureCompat (t , sb , integration .FeatureCacheImport , integration .FeatureDirectPush )
3810
3817
3811
3818
// stargz layers should be lazy even for executing something on them
3812
3819
def , err = baseDef .
@@ -4456,12 +4463,7 @@ func testZstdLocalCacheExport(t *testing.T, sb integration.Sandbox) {
4456
4463
}
4457
4464
4458
4465
func testCacheExportIgnoreError (t * testing.T , sb integration.Sandbox ) {
4459
- integration .CheckFeatureCompat (t , sb ,
4460
- integration .FeatureCacheExport ,
4461
- integration .FeatureCacheBackendS3 ,
4462
- integration .FeatureCacheBackendLocal ,
4463
- integration .FeatureCacheBackendRegistry ,
4464
- )
4466
+ integration .CheckFeatureCompat (t , sb , integration .FeatureCacheExport )
4465
4467
c , err := New (sb .Context (), sb .Address ())
4466
4468
require .NoError (t , err )
4467
4469
defer c .Close ()
@@ -4544,12 +4546,21 @@ func testCacheExportIgnoreError(t *testing.T, sb integration.Sandbox) {
4544
4546
for _ , ignoreError := range ignoreErrorValues {
4545
4547
ignoreErrStr := strconv .FormatBool (ignoreError )
4546
4548
for n , test := range tests {
4549
+ n := n
4547
4550
require .Equal (t , 1 , len (test .Exports ))
4548
4551
require .Equal (t , 1 , len (test .CacheExports ))
4549
4552
require .NotEmpty (t , test .CacheExports [0 ].Attrs )
4550
4553
test .CacheExports [0 ].Attrs ["ignore-error" ] = ignoreErrStr
4551
4554
testName := fmt .Sprintf ("%s-%s" , n , ignoreErrStr )
4552
4555
t .Run (testName , func (t * testing.T ) {
4556
+ switch n {
4557
+ case "local-ignore-error" :
4558
+ integration .CheckFeatureCompat (t , sb , integration .FeatureCacheBackendLocal )
4559
+ case "registry-ignore-error" :
4560
+ integration .CheckFeatureCompat (t , sb , integration .FeatureCacheBackendRegistry )
4561
+ case "s3-ignore-error" :
4562
+ integration .CheckFeatureCompat (t , sb , integration .FeatureCacheBackendS3 )
4563
+ }
4553
4564
_ , err = c .Solve (sb .Context (), def , SolveOpt {
4554
4565
Exports : test .Exports ,
4555
4566
CacheExports : test .CacheExports ,
@@ -4568,7 +4579,11 @@ func testCacheExportIgnoreError(t *testing.T, sb integration.Sandbox) {
4568
4579
}
4569
4580
4570
4581
func testUncompressedLocalCacheImportExport (t * testing.T , sb integration.Sandbox ) {
4571
- integration .CheckFeatureCompat (t , sb , integration .FeatureCacheExport , integration .FeatureCacheImport , integration .FeatureCacheBackendLocal )
4582
+ integration .CheckFeatureCompat (t , sb ,
4583
+ integration .FeatureCacheExport ,
4584
+ integration .FeatureCacheImport ,
4585
+ integration .FeatureCacheBackendLocal ,
4586
+ )
4572
4587
dir := t .TempDir ()
4573
4588
im := CacheOptionsEntry {
4574
4589
Type : "local" ,
@@ -4588,7 +4603,11 @@ func testUncompressedLocalCacheImportExport(t *testing.T, sb integration.Sandbox
4588
4603
}
4589
4604
4590
4605
func testUncompressedRegistryCacheImportExport (t * testing.T , sb integration.Sandbox ) {
4591
- integration .CheckFeatureCompat (t , sb , integration .FeatureCacheExport , integration .FeatureCacheImport , integration .FeatureCacheBackendRegistry )
4606
+ integration .CheckFeatureCompat (t , sb ,
4607
+ integration .FeatureCacheExport ,
4608
+ integration .FeatureCacheImport ,
4609
+ integration .FeatureCacheBackendRegistry ,
4610
+ )
4592
4611
registry , err := sb .NewRegistry ()
4593
4612
if errors .Is (err , integration .ErrRequirements ) {
4594
4613
t .Skip (err .Error ())
@@ -4613,7 +4632,11 @@ func testUncompressedRegistryCacheImportExport(t *testing.T, sb integration.Sand
4613
4632
}
4614
4633
4615
4634
func testZstdLocalCacheImportExport (t * testing.T , sb integration.Sandbox ) {
4616
- integration .CheckFeatureCompat (t , sb , integration .FeatureCacheExport , integration .FeatureCacheImport , integration .FeatureCacheBackendLocal )
4635
+ integration .CheckFeatureCompat (t , sb ,
4636
+ integration .FeatureCacheExport ,
4637
+ integration .FeatureCacheImport ,
4638
+ integration .FeatureCacheBackendLocal ,
4639
+ )
4617
4640
dir := t .TempDir ()
4618
4641
im := CacheOptionsEntry {
4619
4642
Type : "local" ,
@@ -4634,7 +4657,11 @@ func testZstdLocalCacheImportExport(t *testing.T, sb integration.Sandbox) {
4634
4657
}
4635
4658
4636
4659
func testZstdRegistryCacheImportExport (t * testing.T , sb integration.Sandbox ) {
4637
- integration .CheckFeatureCompat (t , sb , integration .FeatureCacheExport , integration .FeatureCacheImport , integration .FeatureCacheBackendRegistry )
4660
+ integration .CheckFeatureCompat (t , sb ,
4661
+ integration .FeatureCacheExport ,
4662
+ integration .FeatureCacheImport ,
4663
+ integration .FeatureCacheBackendRegistry ,
4664
+ )
4638
4665
registry , err := sb .NewRegistry ()
4639
4666
if errors .Is (err , integration .ErrRequirements ) {
4640
4667
t .Skip (err .Error ())
@@ -4722,7 +4749,11 @@ func testBasicCacheImportExport(t *testing.T, sb integration.Sandbox, cacheOptio
4722
4749
}
4723
4750
4724
4751
func testBasicRegistryCacheImportExport (t * testing.T , sb integration.Sandbox ) {
4725
- integration .CheckFeatureCompat (t , sb , integration .FeatureCacheExport , integration .FeatureCacheImport , integration .FeatureCacheBackendRegistry )
4752
+ integration .CheckFeatureCompat (t , sb ,
4753
+ integration .FeatureCacheExport ,
4754
+ integration .FeatureCacheImport ,
4755
+ integration .FeatureCacheBackendRegistry ,
4756
+ )
4726
4757
registry , err := sb .NewRegistry ()
4727
4758
if errors .Is (err , integration .ErrRequirements ) {
4728
4759
t .Skip (err .Error ())
@@ -4739,7 +4770,11 @@ func testBasicRegistryCacheImportExport(t *testing.T, sb integration.Sandbox) {
4739
4770
}
4740
4771
4741
4772
func testMultipleRegistryCacheImportExport (t * testing.T , sb integration.Sandbox ) {
4742
- integration .CheckFeatureCompat (t , sb , integration .FeatureCacheExport , integration .FeatureCacheImport , integration .FeatureCacheBackendRegistry )
4773
+ integration .CheckFeatureCompat (t , sb ,
4774
+ integration .FeatureCacheExport ,
4775
+ integration .FeatureCacheImport ,
4776
+ integration .FeatureCacheBackendRegistry ,
4777
+ )
4743
4778
registry , err := sb .NewRegistry ()
4744
4779
if errors .Is (err , integration .ErrRequirements ) {
4745
4780
t .Skip (err .Error ())
@@ -4762,7 +4797,11 @@ func testMultipleRegistryCacheImportExport(t *testing.T, sb integration.Sandbox)
4762
4797
}
4763
4798
4764
4799
func testBasicLocalCacheImportExport (t * testing.T , sb integration.Sandbox ) {
4765
- integration .CheckFeatureCompat (t , sb , integration .FeatureCacheExport , integration .FeatureCacheImport , integration .FeatureCacheBackendLocal )
4800
+ integration .CheckFeatureCompat (t , sb ,
4801
+ integration .FeatureCacheExport ,
4802
+ integration .FeatureCacheImport ,
4803
+ integration .FeatureCacheBackendLocal ,
4804
+ )
4766
4805
dir := t .TempDir ()
4767
4806
im := CacheOptionsEntry {
4768
4807
Type : "local" ,
@@ -4780,7 +4819,11 @@ func testBasicLocalCacheImportExport(t *testing.T, sb integration.Sandbox) {
4780
4819
}
4781
4820
4782
4821
func testBasicS3CacheImportExport (t * testing.T , sb integration.Sandbox ) {
4783
- integration .CheckFeatureCompat (t , sb , integration .FeatureCacheExport , integration .FeatureCacheImport , integration .FeatureCacheBackendS3 )
4822
+ integration .CheckFeatureCompat (t , sb ,
4823
+ integration .FeatureCacheExport ,
4824
+ integration .FeatureCacheImport ,
4825
+ integration .FeatureCacheBackendS3 ,
4826
+ )
4784
4827
4785
4828
opts := integration.MinioOpts {
4786
4829
Region : "us-east-1" ,
@@ -4818,7 +4861,11 @@ func testBasicS3CacheImportExport(t *testing.T, sb integration.Sandbox) {
4818
4861
}
4819
4862
4820
4863
func testBasicAzblobCacheImportExport (t * testing.T , sb integration.Sandbox ) {
4821
- integration .CheckFeatureCompat (t , sb , integration .FeatureCacheExport , integration .FeatureCacheImport , integration .FeatureCacheBackendAzblob )
4864
+ integration .CheckFeatureCompat (t , sb ,
4865
+ integration .FeatureCacheExport ,
4866
+ integration .FeatureCacheImport ,
4867
+ integration .FeatureCacheBackendAzblob ,
4868
+ )
4822
4869
4823
4870
opts := integration.AzuriteOpts {
4824
4871
AccountName : "azblobcacheaccount" ,
@@ -4854,9 +4901,7 @@ func testBasicInlineCacheImportExport(t *testing.T, sb integration.Sandbox) {
4854
4901
integration .CheckFeatureCompat (t , sb ,
4855
4902
integration .FeatureDirectPush ,
4856
4903
integration .FeatureCacheExport ,
4857
- integration .FeatureCacheImport ,
4858
4904
integration .FeatureCacheBackendInline ,
4859
- integration .FeatureCacheBackendRegistry ,
4860
4905
)
4861
4906
requiresLinux (t )
4862
4907
registry , err := sb .NewRegistry ()
@@ -4909,6 +4954,7 @@ func testBasicInlineCacheImportExport(t *testing.T, sb integration.Sandbox) {
4909
4954
require .NoError (t , err )
4910
4955
4911
4956
ensurePruneAll (t , c , sb )
4957
+ integration .CheckFeatureCompat (t , sb , integration .FeatureCacheImport , integration .FeatureCacheBackendRegistry )
4912
4958
4913
4959
resp , err = c .Solve (sb .Context (), def , SolveOpt {
4914
4960
// specifying inline cache exporter is needed for reproducing containerimage.digest
@@ -5017,7 +5063,11 @@ func testBasicInlineCacheImportExport(t *testing.T, sb integration.Sandbox) {
5017
5063
}
5018
5064
5019
5065
func testBasicGhaCacheImportExport (t * testing.T , sb integration.Sandbox ) {
5020
- integration .CheckFeatureCompat (t , sb , integration .FeatureCacheExport , integration .FeatureCacheImport , integration .FeatureCacheBackendGha )
5066
+ integration .CheckFeatureCompat (t , sb ,
5067
+ integration .FeatureCacheExport ,
5068
+ integration .FeatureCacheImport ,
5069
+ integration .FeatureCacheBackendGha ,
5070
+ )
5021
5071
runtimeToken := os .Getenv ("ACTIONS_RUNTIME_TOKEN" )
5022
5072
cacheURL := os .Getenv ("ACTIONS_CACHE_URL" )
5023
5073
if runtimeToken == "" || cacheURL == "" {
0 commit comments