Skip to content

Commit

Permalink
tests: fix version tests
Browse files Browse the repository at this point in the history
  • Loading branch information
steveiliop56 committed Sep 17, 2024
1 parent b896dc4 commit 43aa667
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ var updateCmd = &cobra.Command{
// Download latest CLI
spinner.SetMessage("Downloading latest CLI")

downloadErr := release.DownloadLatestCLI(versionToUpdate)
downloadErr := release.DownloadCLI(versionToUpdate)

if downloadErr != nil {
spinner.Fail("Failed to download latest CLI, please copy the runtipi-cli-go.bak file to runtipi-cli-go and try again")
Expand Down
2 changes: 1 addition & 1 deletion internal/release/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func ValidateVersion(version string) (bool, error) {
return true, nil
}

func DownloadLatestCLI(version string) (error) {
func DownloadCLI(version string) (error) {
arch := system.GetArch()
assetUrl := fmt.Sprintf("https://github.com/runtipi/runtipi-cli-go/releases/download/%s/runtipi-cli-go-%s", version, arch)

Expand Down
6 changes: 3 additions & 3 deletions internal/release/release_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestMajorValidator(t *testing.T) {
// Test validate version
func TestValidateVersion(t *testing.T) {
// Try correct version
validateCheckCorrect, validateCheckCorrectErr := release.ValidateVersion("v0.1.0-alpha.1-runtipi-v3.6.0")
validateCheckCorrect, validateCheckCorrectErr := release.ValidateVersion("v3.6.0")

// Check for errors
if validateCheckCorrectErr != nil {
Expand All @@ -59,7 +59,7 @@ func TestValidateVersion(t *testing.T) {
}

// Try wrong version
validateCheckWrong, validateCheckWrongErr := release.ValidateVersion("v0.1.0-alpha.1-runtipi-v3.5.8")
validateCheckWrong, validateCheckWrongErr := release.ValidateVersion("v3.5.8")

// Check for errors
if validateCheckWrongErr != nil {
Expand Down Expand Up @@ -88,7 +88,7 @@ func TestCLIDownload(t *testing.T) {
os.Remove(cliPath)

// Download new CLI
downloadErr := release.DownloadLatestCLI("v0.1.0-alpha.1-runtipi-v3.6.0")
downloadErr := release.DownloadCLI("v3.6.0")

// Check for errors
if downloadErr != nil {
Expand Down

0 comments on commit 43aa667

Please sign in to comment.