Commit 7d0faa6b authored by Kamil Trzciński's avatar Kamil Trzciński 🔴

Merge branch 'improvement/restore-cache-before-artifacts' into 'master'

Restore cache before artifacts

Closes #2379

See merge request !577
parents f253ea6a e8b86f18
...@@ -204,10 +204,10 @@ func (b *Build) executeScript(ctx context.Context, executor Executor) error { ...@@ -204,10 +204,10 @@ func (b *Build) executeScript(ctx context.Context, executor Executor) error {
err = b.attemptExecuteStage(ctx, BuildStageGetSources, executor, b.GetGetSourcesAttempts()) err = b.attemptExecuteStage(ctx, BuildStageGetSources, executor, b.GetGetSourcesAttempts())
} }
if err == nil { if err == nil {
err = b.attemptExecuteStage(ctx, BuildStageDownloadArtifacts, executor, b.GetDownloadArtifactsAttempts()) err = b.attemptExecuteStage(ctx, BuildStageRestoreCache, executor, b.GetRestoreCacheAttempts())
} }
if err == nil { if err == nil {
err = b.attemptExecuteStage(ctx, BuildStageRestoreCache, executor, b.GetRestoreCacheAttempts()) err = b.attemptExecuteStage(ctx, BuildStageDownloadArtifacts, executor, b.GetDownloadArtifactsAttempts())
} }
if err == nil { if err == nil {
......
...@@ -245,7 +245,7 @@ func TestArtifactDownloadRunFailure(t *testing.T) { ...@@ -245,7 +245,7 @@ func TestArtifactDownloadRunFailure(t *testing.T) {
// Fail a build script // Fail a build script
e.On("Shell").Return(&ShellScriptInfo{Shell: "script-shell"}) e.On("Shell").Return(&ShellScriptInfo{Shell: "script-shell"})
e.On("Run", mock.Anything).Return(nil).Times(2) e.On("Run", mock.Anything).Return(nil).Times(3)
e.On("Run", mock.Anything).Return(errors.New("build fail")).Times(3) e.On("Run", mock.Anything).Return(errors.New("build fail")).Times(3)
e.On("Finish", errors.New("build fail")).Return().Once() e.On("Finish", errors.New("build fail")).Return().Once()
...@@ -283,7 +283,7 @@ func TestRestoreCacheRunFailure(t *testing.T) { ...@@ -283,7 +283,7 @@ func TestRestoreCacheRunFailure(t *testing.T) {
// Fail a build script // Fail a build script
e.On("Shell").Return(&ShellScriptInfo{Shell: "script-shell"}) e.On("Shell").Return(&ShellScriptInfo{Shell: "script-shell"})
e.On("Run", mock.Anything).Return(nil).Times(3) e.On("Run", mock.Anything).Return(nil).Times(2)
e.On("Run", mock.Anything).Return(errors.New("build fail")).Times(3) e.On("Run", mock.Anything).Return(errors.New("build fail")).Times(3)
e.On("Finish", errors.New("build fail")).Return().Once() e.On("Finish", errors.New("build fail")).Return().Once()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment