Skip to content

Commit

Permalink
fix rebase conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
leehinman committed Mar 7, 2024
1 parent c8a865f commit a2af0fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/testing/fetcher_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func (h HttpFetcher) Name() string {
return fmt.Sprintf("httpFetcher-%s", sanitizeFetcherName(h.baseURL))
}

func (h HttpFetcher) Fetch(ctx context.Context, operatingSystem string, architecture string, version string) (FetcherResult, error) {
suffix, err := GetPackageSuffix(operatingSystem, architecture)
func (h HttpFetcher) Fetch(ctx context.Context, operatingSystem string, architecture string, version string, packageFormat string) (FetcherResult, error) {
suffix, err := GetPackageSuffix(operatingSystem, architecture, packageFormat)
if err != nil {
return nil, err
}
Expand Down
5 changes: 4 additions & 1 deletion pkg/testing/fetcher_http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func TestHttpFetcher_Fetch(t *testing.T) {
operatingSystem string
architecture string
version string
pkgFormat string
}
tests := []struct {
name string
Expand All @@ -38,6 +39,7 @@ func TestHttpFetcher_Fetch(t *testing.T) {
operatingSystem: "linux",
architecture: "arm64",
version: "1.2.3",
pkgFormat: "targz",
},
want: &httpFetcherResult{
baseURL: "https://artifacts.elastic.co/downloads/beats/elastic-agent/",
Expand All @@ -52,6 +54,7 @@ func TestHttpFetcher_Fetch(t *testing.T) {
operatingSystem: "windows",
architecture: "amd64",
version: "1.2.3",
pkgFormat: "zip",
},
want: &httpFetcherResult{
baseURL: "http://somehost.somedomain/some/path/here",
Expand All @@ -69,7 +72,7 @@ func TestHttpFetcher_Fetch(t *testing.T) {
h := NewHttpFetcher(opts...)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
got, err := h.Fetch(ctx, tt.args.operatingSystem, tt.args.architecture, tt.args.version)
got, err := h.Fetch(ctx, tt.args.operatingSystem, tt.args.architecture, tt.args.version, tt.args.pkgFormat)
if !tt.wantErr(t, err, fmt.Sprintf("Fetch(%v, %v, %v, %v)", ctx, tt.args.operatingSystem, tt.args.architecture, tt.args.version)) {
return
}
Expand Down

0 comments on commit a2af0fd

Please sign in to comment.