Skip to content

Commit

Permalink
test: fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ekristen committed Oct 26, 2024
1 parent b93c743 commit 16c03bc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/asset/asset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,8 @@ func TestAssetInstall(t *testing.T) {
assert.NoError(t, err)

for _, fileName := range c.expectedFiles {
destBinaryName := fmt.Sprintf("test-id-%s", filepath.Base(fileName))
destBinPath := filepath.Join(binDir, destBinaryName)
destBinaryName := filepath.Base(fileName)
destBinPath := filepath.Join(optDir, destBinaryName)

baseLinkName := filepath.Join(binDir, filepath.Base(fileName))
versionedLinkName := filepath.Join(binDir, fmt.Sprintf("%s@%s", filepath.Base(fileName), "1.0.0"))
Expand Down
4 changes: 2 additions & 2 deletions pkg/osconfig/osconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func TestOS_InvalidOS(t *testing.T) {
{
name: "Windows",
os: osconfig.New(osconfig.Windows, osconfig.AMD64),
expected: []string{osconfig.Linux, osconfig.Darwin},
expected: []string{osconfig.Linux, osconfig.Darwin, osconfig.FreeBSD},
},
{
name: "Linux",
Expand All @@ -147,7 +147,7 @@ func TestOS_InvalidOS(t *testing.T) {
{
name: "Darwin",
os: osconfig.New(osconfig.Darwin, osconfig.AMD64),
expected: []string{osconfig.Windows, osconfig.Linux},
expected: []string{osconfig.Windows, osconfig.Linux, osconfig.FreeBSD},
},
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/score/score_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func TestScore(t *testing.T) {
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
actual := Score(c.names, c.opts)
assert.Equal(t, c.expected, actual)
assert.ElementsMatch(t, c.expected, actual)
})
}
}
4 changes: 3 additions & 1 deletion pkg/source/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ func (s *GitHub) FindRelease(ctx context.Context) error {
var err error
var release *github.RepositoryRelease

logrus.WithField("owner", s.GetOwner()).WithField("repo", s.GetRepo()).Trace("finding release")

if s.Version == provider.VersionLatest {
release, _, err = s.client.Repositories.GetLatestRelease(ctx, s.GetOwner(), s.GetRepo())
if err != nil && !strings.Contains(err.Error(), "404 Not Found") {
Expand Down Expand Up @@ -139,7 +141,7 @@ func (s *GitHub) FindRelease(ctx context.Context) error {
return fmt.Errorf("release not found")
}

log.Infof("installing version: %s", strings.TrimPrefix(release.GetTagName(), "v"))
log.Infof("selected version: %s", strings.TrimPrefix(release.GetTagName(), "v"))

s.Release = release

Expand Down

0 comments on commit 16c03bc

Please sign in to comment.