From d881f4e916fb11ea2d2f9e0b9dfa6948ff80885e Mon Sep 17 00:00:00 2001 From: peusebiu Date: Thu, 22 Jun 2023 20:43:47 +0300 Subject: [PATCH] fix(sync): flaky test on fetching tags (#1546) Signed-off-by: Petu Eusebiu --- pkg/extensions/sync/sync_internal_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkg/extensions/sync/sync_internal_test.go b/pkg/extensions/sync/sync_internal_test.go index 8ef0fafd..3b702d99 100644 --- a/pkg/extensions/sync/sync_internal_test.go +++ b/pkg/extensions/sync/sync_internal_test.go @@ -22,6 +22,7 @@ import ( "zotregistry.io/zot/errors" "zotregistry.io/zot/pkg/extensions/config" + syncconf "zotregistry.io/zot/pkg/extensions/config/sync" "zotregistry.io/zot/pkg/extensions/lint" "zotregistry.io/zot/pkg/extensions/monitoring" client "zotregistry.io/zot/pkg/extensions/sync/httpclient" @@ -155,6 +156,20 @@ func TestRemoteRegistry(t *testing.T) { }) } +func TestService(t *testing.T) { + Convey("trigger fetch tags error", t, func() { + conf := syncconf.RegistryConfig{ + URLs: []string{"http://localhost"}, + } + + service, err := New(conf, "", storage.StoreController{}, mocks.RepoDBMock{}, log.Logger{}) + So(err, ShouldBeNil) + + err = service.SyncRepo("repo") + So(err, ShouldNotBeNil) + }) +} + func TestLocalRegistry(t *testing.T) { Convey("make StoreController", t, func() { dir := t.TempDir()