Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(integration): Replaced artifactory with gitlab inintegration tests #24

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
Loading