fix ut case failures

Signed-off-by: Steven Zou <szou@vmware.com>
This commit is contained in:
Steven Zou 2019-07-30 11:56:17 +08:00
parent 1e7f51615f
commit f29d50e6dd
3 changed files with 13 additions and 10 deletions

View File

@ -15,15 +15,15 @@
package action
import (
"testing"
"time"
"github.com/goharbor/harbor/src/pkg/retention/dep"
"github.com/goharbor/harbor/src/pkg/retention/policy/lwp"
"github.com/goharbor/harbor/src/pkg/retention/res"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"testing"
"time"
)
// TestPerformerSuite tests the performer related function
@ -106,7 +106,7 @@ func (frc *fakeRetentionClient) Delete(candidate *res.Candidate) error {
return nil
}
// SubmitTask ...
func (frc *fakeRetentionClient) SubmitTask(taskID int64, repository *res.Repository, meta *lwp.Metadata) (string, error) {
return "", errors.New("not implemented")
// DeleteRepository ...
func (frc *fakeRetentionClient) DeleteRepository(repo *res.Repository) error {
panic("implement me")
}

View File

@ -22,7 +22,6 @@ import (
"github.com/goharbor/harbor/src/pkg/retention/dep"
"github.com/goharbor/harbor/src/pkg/retention/policy/action"
"github.com/goharbor/harbor/src/pkg/retention/policy/alg"
"github.com/goharbor/harbor/src/pkg/retention/policy/lwp"
"github.com/goharbor/harbor/src/pkg/retention/policy/rule"
"github.com/goharbor/harbor/src/pkg/retention/policy/rule/always"
"github.com/goharbor/harbor/src/pkg/retention/policy/rule/lastx"
@ -171,7 +170,7 @@ func (frc *fakeRetentionClient) Delete(candidate *res.Candidate) error {
return nil
}
// SubmitTask ...
func (frc *fakeRetentionClient) SubmitTask(taskID int64, repository *res.Repository, meta *lwp.Metadata) (string, error) {
return "", errors.New("not implemented")
// DeleteRepository ...
func (frc *fakeRetentionClient) DeleteRepository(repo *res.Repository) error {
panic("implement me")
}

View File

@ -161,6 +161,10 @@ func (suite *TestBuilderSuite) TestBuild() {
type fakeRetentionClient struct{}
func (frc *fakeRetentionClient) DeleteRepository(repo *res.Repository) error {
panic("implement me")
}
// GetCandidates ...
func (frc *fakeRetentionClient) GetCandidates(repo *res.Repository) ([]*res.Candidate, error) {
return nil, errors.New("not implemented")