Skip to content

Commit 4e7b2c4

Browse files
authored
fix: avoid running cachedir mount commands via script (chainguard-dev#2070)
* Avoid running cachedir mount commands via script Signed-off-by: egibs <[email protected]> * Modify pipeline config TestRun field after runner is initialized Signed-off-by: egibs <[email protected]> * Fix tests Signed-off-by: egibs <[email protected]> --------- Signed-off-by: egibs <[email protected]>
1 parent 0b9efdc commit 4e7b2c4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pkg/build/test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ func (t *Test) TestPackage(ctx context.Context) error {
334334
}
335335

336336
log.Infof("running the main test pipeline")
337+
338+
pr.config.TestRun = true
337339
if err := pr.runPipelines(ctx, t.Configuration.Test.Pipeline); err != nil {
338340
return fmt.Errorf("unable to run pipeline: %w", err)
339341
}
@@ -388,6 +390,7 @@ func (t *Test) TestPackage(ctx context.Context) error {
388390
}()
389391
}
390392

393+
pr.config.TestRun = true
391394
if err := pr.runPipelines(ctx, sp.Test.Pipeline); err != nil {
392395
return fmt.Errorf("unable to run pipeline: %w", err)
393396
}
@@ -452,7 +455,6 @@ func (t *Test) buildWorkspaceConfig(ctx context.Context, imgRef, pkgName string,
452455
Environment: map[string]string{},
453456
RunAsUID: runAsUID(imgcfg.Accounts),
454457
RunAs: runAs(imgcfg.Accounts),
455-
TestRun: true,
456458
}
457459
if t.Configuration.Capabilities.Add != nil {
458460
cfg.Capabilities.Add = t.Configuration.Capabilities.Add

pkg/build/test_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ func TestBuildWorkspaceConfig(t *testing.T) {
7878
PackageName: testPkgName,
7979
ImgRef: testImgRef,
8080
WorkspaceDir: "/workspace",
81-
TestRun: true,
8281
Capabilities: container.Capabilities{Networking: true},
8382
Mounts: []container.BindMount{
8483
{Source: testWorkspaceDir, Destination: homeBuild},

0 commit comments

Comments
 (0)