diff --git a/Dockerfile-golang b/Dockerfile-golang index ce89ac2..dea71ab 100644 --- a/Dockerfile-golang +++ b/Dockerfile-golang @@ -1,6 +1,5 @@ FROM golang:1.12-alpine # Only install hard dependencies -RUN apk add --no-cache gcc git musl-dev make; \ - go get -v -u gotest.tools/gotestsum; \ - : +RUN apk add --no-cache gcc git musl-dev make && + go get -v -u gotest.tools/gotestsum diff --git a/README.md b/README.md index 2f0ce6f..4de1bf6 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,9 @@ Run locally: ```bash // run both integration and unit tests gotestsum -- -tags="integration unit" ./... + +// clean testcache +go clean -testcache ``` The tests don't test the nomad deployment capability of the service. @@ -136,8 +139,6 @@ The tests don't test the nomad deployment capability of the service. A makefile to avoid having to change your local docker daemon config so as to run the tests as docker-in-docker for CI integration. -A makefile step to regenerate testing certificates in `testutils/snakeoil` - An interface to swap in the deployment agent (only Nomad supported for now). Tests take too long to run, this is mainly due each integration test case spinning up and down its own docker containers. @@ -147,3 +148,5 @@ Nomad mock server cannot run jobs, which blocks writing of integration tests inv Buttons should implement debouncing Bug where only new tags/SHA changes AFTER you toggle back auto deployment will trigger an update, meaning any updates during the window where auto deployment was turned off are moot. + +Clean up unused registry methods. diff --git a/client/client_test.go b/client/client_test.go index d9f61f3..990b3aa 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -60,17 +60,9 @@ func TestAutoDeployLatestTag(t *testing.T) { resolves correctly for autodeployment of custom tags */ - // set to "test:latest" + // set to "test:alpine" newTag = "test" te.UpdatePinnedTag(newTag) - - shouldDeploy, _ = te.Clients.ShouldDeploy(te.TestRepoName) - tagToDeploy, _ = te.Clients.GetFormattedPinnedTag(te.TestRepoName) - // should re-deploy after pinned tag is changed - assert.True(t, shouldDeploy) - assert.Equal(t, "test", tagToDeploy) - - // "test" is now based on "alpine", rather than the original "latest" te.PushNewTag(newTag, "alpine") shouldDeploy, _ = te.Clients.ShouldDeploy(te.TestRepoName) diff --git a/client/dockerhub_api_client.go b/client/dockerhub_api_client.go index 1c9422b..c09d7ba 100644 --- a/client/dockerhub_api_client.go +++ b/client/dockerhub_api_client.go @@ -146,8 +146,8 @@ func (api *DockerhubApi) CheckImageIsCurrent(repository, digest string, checkTag return &isCurrent, nil } -// We can't just use the registry GetTagDigest because the digests from the -// registry and from the dockerhub API do not match +// Note that the digest returned from the Dockerhub API does not match +// the digest from docker registry manifest V2 API func (api *DockerhubApi) GetTagDigestFromApi(repository string, checkTag string) ( *string, error) { endpoint := fmt.Sprintf("/v2/namespaces/%s/repositories/%s/images?", api.namespace,