feat: [AH-586]: Fix OCI tests and enable check on gitness repo (#2885)

* [AH-586]: Fix OCI tests and enable check on gitness repo
devcontainer-setup
Arvind Choudhary 2024-10-28 23:03:12 +00:00 committed by Harness
parent ff00a8ba7a
commit 86036dc43b
2 changed files with 9 additions and 8 deletions

View File

@ -55,16 +55,18 @@ test: generate ## Run the go tests
#
###############################################################################
run: clean build
run: ar-clean build
./gitness server .local.env || true
ar-conformance-test: clean build
ar-conformance-test: ar-clean build
./gitness server .local.env > logfile.log 2>&1 & echo $$! > server.PID
@sleep 10
./registry/tests/conformance_test.sh localhost:3000 || true
./registry/tests/conformance_test.sh localhost:3000
EXIT_CODE=$$?;
kill `cat server.PID`
@rm server.PID
@rm logfile.log
exit $$EXIT_CODE
ar-hot-conformance-test:
rm -rf distribution-spec || true

View File

@ -81,7 +81,7 @@ func TrackBandwidthStat(h *oci.Handler) func(http.Handler) http.Handler {
info, err := h.GetRegistryInfo(r, true)
if err != nil {
log.Ctx(ctx).Error().Stack().Str("middleware",
"TrackBandwidthStat").Err(err).Msgf("error while putting bandwidth stat of artifact, %v",
"TrackBandwidthStat").Err(err).Msgf("error while putting bandwidth stat for artifact, %v",
err)
return
}
@ -89,8 +89,8 @@ func TrackBandwidthStat(h *oci.Handler) func(http.Handler) http.Handler {
err = dbBandwidthStat(ctx, h.Controller, info, bandwidthType)
if err != nil {
log.Ctx(ctx).Error().Stack().Str("middleware",
"TrackBandwidthStat").Err(err).Msgf("error while putting bandwidth stat of artifact, %v",
err)
"TrackBandwidthStat").Err(err).Msgf("error while putting bandwidth stat for artifact [%s:%s], %v",
info.RegIdentifier, info.Image, err)
return
}
},
@ -147,6 +147,5 @@ func getImageFromUpstreamProxy(ctx context.Context, c *docker.Controller, info p
return image, nil
}
}
//nolint:nilnil
return nil, nil
return nil, errors.New("image not found in upstream proxy")
}