Skip to content

Commit

Permalink
fix(integration): Replaced artifactory with gitlab inintegration tests
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Ubuntu committed Aug 18, 2023
1 parent a242ed7 commit 907b21e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
Expand Down
16 changes: 8 additions & 8 deletions integration/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand All @@ -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,
},
Expand All @@ -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,
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/testutils/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 907b21e

Please sign in to comment.