Restore cache before artifacts

parent f253ea6a
Pipeline #8239143 passed with stages
in 17 minutes and 14 seconds
......@@ -204,10 +204,10 @@ func (b *Build) executeScript(ctx context.Context, executor Executor) error {
err = b.attemptExecuteStage(ctx, BuildStageGetSources, executor, b.GetGetSourcesAttempts())
}
if err == nil {
err = b.attemptExecuteStage(ctx, BuildStageDownloadArtifacts, executor, b.GetDownloadArtifactsAttempts())
err = b.attemptExecuteStage(ctx, BuildStageRestoreCache, executor, b.GetRestoreCacheAttempts())
}
if err == nil {
err = b.attemptExecuteStage(ctx, BuildStageRestoreCache, executor, b.GetRestoreCacheAttempts())
err = b.attemptExecuteStage(ctx, BuildStageDownloadArtifacts, executor, b.GetDownloadArtifactsAttempts())
}
if err == nil {
......
......@@ -245,7 +245,7 @@ func TestArtifactDownloadRunFailure(t *testing.T) {
// Fail a build script
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("Finish", errors.New("build fail")).Return().Once()
......@@ -283,7 +283,7 @@ func TestRestoreCacheRunFailure(t *testing.T) {
// Fail a build script
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("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