fix: running tests locally fails (#1879)

Signed-off-by: Alexei Dodon <adodon@cisco.com>
This commit is contained in:
Alexei Dodon
2023-10-05 14:34:50 +03:00
committed by GitHub
parent e6902b937f
commit 044ea85279
16 changed files with 88 additions and 138 deletions
+2 -9
View File
@@ -36,6 +36,7 @@ import (
test "zotregistry.io/zot/pkg/test/common"
. "zotregistry.io/zot/pkg/test/image-utils"
"zotregistry.io/zot/pkg/test/signature"
tskip "zotregistry.io/zot/pkg/test/skip"
)
type errReader int
@@ -122,7 +123,7 @@ func TestSignatureUploadAndVerificationLocal(t *testing.T) {
}
func TestSignatureUploadAndVerificationAWS(t *testing.T) {
skipIt(t)
tskip.SkipDynamo(t)
Convey("test with AWS", t, func() {
uuid, err := guuid.NewV4()
@@ -1000,11 +1001,3 @@ func RunSignatureUploadAndVerificationTests(t *testing.T, cacheDriverParams map[
So(resp.StatusCode(), ShouldEqual, http.StatusInternalServerError)
})
}
func skipIt(t *testing.T) {
t.Helper()
if os.Getenv("DYNAMODBMOCK_ENDPOINT") == "" {
t.Skip("Skipping testing without AWS mock server")
}
}
@@ -41,6 +41,7 @@ import (
. "zotregistry.io/zot/pkg/test/image-utils"
"zotregistry.io/zot/pkg/test/mocks"
"zotregistry.io/zot/pkg/test/signature"
tskip "zotregistry.io/zot/pkg/test/skip"
)
var (
@@ -658,7 +659,7 @@ func TestLocalTrustStore(t *testing.T) {
}
func TestAWSTrustStore(t *testing.T) {
skipIt(t)
tskip.SkipDynamo(t)
trustpolicy := "trustpolicy"
@@ -1336,11 +1337,3 @@ func RunVerificationTests(t *testing.T, dbDriverParams map[string]interface{}) {
})
})
}
func skipIt(t *testing.T) {
t.Helper()
if os.Getenv("DYNAMODBMOCK_ENDPOINT") == "" {
t.Skip("Skipping testing without AWS mock server")
}
}
+1
View File
@@ -2012,6 +2012,7 @@ func TestMandatoryAnnotations(t *testing.T) {
logFile, err := os.CreateTemp("", "zot-log*.txt")
So(err, ShouldBeNil)
defer os.Remove(logFile.Name())
destConfig.Log.Output = logFile.Name()