From 907b21ea7d7e0582295b2098f7fe35d7dbc71fc9 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Fri, 18 Aug 2023 21:41:23 +0000 Subject: [PATCH] fix(integration): Replaced artifactory with gitlab inintegration tests * The old artifactory registry is gone * Created a gitlab registry instead * Updated github workflow to use gitlab as well * Fixed a new lint error of unused variable in testutils/commands.go --- .github/workflows/build-and-test.yml | 8 ++++---- integration/docker_test.go | 16 ++++++++-------- pkg/testutils/commands.go | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 326d219..277048a 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -54,12 +54,12 @@ jobs: go-version: 1.19 cache: true - - name: Login to docker registry (yehudac.jfrog.io) + - name: Login to docker registry (registry.gitlab.com) uses: docker/login-action@v2.1.0 with: - registry: yehudac.jfrog.io - username: ${{ secrets.JFROG_USERNAME }} - password: ${{ secrets.JFROG_PASSWORD }} + registry: registry.gitlab.com + username: ${{ secrets.GITLAB_USERNAME }} + password: ${{ secrets.GITLAB_PASSWORD }} - name: Run unit tests run: make test diff --git a/integration/docker_test.go b/integration/docker_test.go index b8dc930..e1b1af9 100644 --- a/integration/docker_test.go +++ b/integration/docker_test.go @@ -127,31 +127,31 @@ func TestDockerUpload(t *testing.T) { }{ { name: "Should succeed - single image bundle", - fields: fields{path: singleImageBundle, destination: "yehudac.jfrog.io/example"}, + fields: fields{path: singleImageBundle, destination: "registry.gitlab.com/iyehuda/bring"}, wantErr: false, wantHelpMessage: false, }, { name: "Should succeed - multiple images", - fields: fields{path: multipleImageBundle, destination: "yehudac.jfrog.io/example"}, + fields: fields{path: multipleImageBundle, destination: "registry.gitlab.com/iyehuda/bring"}, wantErr: false, wantHelpMessage: false, }, { name: "Should succeed - single image, target subpath", - fields: fields{path: singleImageBundle, destination: "yehudac.jfrog.io/example/subpath"}, + fields: fields{path: singleImageBundle, destination: "registry.gitlab.com/iyehuda/bring/subpath"}, wantErr: false, wantHelpMessage: false, }, { name: "Should succeed - multiple images, target subpath", - fields: fields{path: multipleImageBundle, destination: "yehudac.jfrog.io/example/subpath"}, + fields: fields{path: multipleImageBundle, destination: "registry.gitlab.com/iyehuda/bring/subpath"}, wantErr: false, wantHelpMessage: false, }, { name: "Should fail - no input file path given", - fields: fields{destination: "yehudac.jfrog.io/example"}, + fields: fields{destination: "registry.gitlab.com/iyehuda/bring"}, wantErr: true, wantHelpMessage: true, }, @@ -163,13 +163,13 @@ func TestDockerUpload(t *testing.T) { }, { name: "Should fail - invalid input file", - fields: fields{path: invalidImageBundle, destination: "yehudac.jfrog.io/example"}, + fields: fields{path: invalidImageBundle, destination: "registry.gitlab.com/iyehuda/bring"}, wantErr: true, wantHelpMessage: false, }, { name: "Should fail - input file not found", - fields: fields{path: nonexistentImageBundle, destination: "yehudac.jfrog.io/example"}, + fields: fields{path: nonexistentImageBundle, destination: "registry.gitlab.com/iyehuda/bring"}, wantErr: true, wantHelpMessage: false, }, @@ -181,7 +181,7 @@ func TestDockerUpload(t *testing.T) { }, { name: "Should fail - registry path not found", - fields: fields{path: singleImageBundle, destination: "yehudac.jfrog.io/restricted"}, + fields: fields{path: singleImageBundle, destination: "registry.gitlab.com/iyehuda/not-exists"}, wantErr: true, wantHelpMessage: false, }, diff --git a/pkg/testutils/commands.go b/pkg/testutils/commands.go index f38ee21..f5909bd 100644 --- a/pkg/testutils/commands.go +++ b/pkg/testutils/commands.go @@ -32,6 +32,6 @@ type FakeCommandRunner struct { } // Run runs a command with a predefined error. -func (r *FakeCommandRunner) Run(cmd *exec.Cmd) error { +func (r *FakeCommandRunner) Run(_ *exec.Cmd) error { return r.Err }