Skip to content

Commit

Permalink
Fix tests, do minimal setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ofalvai committed Sep 20, 2024
1 parent b5facc1 commit 88ef03e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bitrise/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ func RunSetupIfNeeded(logger log.Logger) error {
versionMatch, setupVersion := configs.CheckIsSetupWasDoneForVersion(version.VERSION)
if setupVersion == "" {
log.Warnf("No setup was done yet, running setup now...")
return RunSetup(logger, version.VERSION, SetupModeDefault, false)
return RunSetup(logger, version.VERSION, SetupModeMinimal, false)
}
if !versionMatch {
log.Warnf("Setup was last performed for version %s, current version is %s. Re-running setup now...", setupVersion, version.VERSION)
return RunSetup(logger, version.VERSION, SetupModeDefault, false)
return RunSetup(logger, version.VERSION, SetupModeMinimal, false)
}
return nil
}
Expand Down
9 changes: 6 additions & 3 deletions configs/configs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ func TestSetupForVersionChecks(t *testing.T) {

t.Setenv("HOME", fakeHomePth)

require.Equal(t, false, CheckIsSetupWasDoneForVersion("0.9.7"))
versionMatch, _ := CheckIsSetupWasDoneForVersion("0.9.7")
require.Equal(t, false, versionMatch)

require.Equal(t, nil, SaveSetupSuccessForVersion("0.9.7"))

require.Equal(t, true, CheckIsSetupWasDoneForVersion("0.9.7"))
versionMatch, _ = CheckIsSetupWasDoneForVersion("0.9.7")
require.Equal(t, true, versionMatch)

require.Equal(t, false, CheckIsSetupWasDoneForVersion("0.9.8"))
versionMatch, _ = CheckIsSetupWasDoneForVersion("0.9.8")
require.Equal(t, false, versionMatch)
}

0 comments on commit 88ef03e

Please sign in to comment.