Skip to content

Commit

Permalink
Clean up e2e test for CLI version
Browse files Browse the repository at this point in the history
  • Loading branch information
YrrepNoj committed Oct 25, 2021
1 parent 96826cb commit c94d58a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# test: deps
# gotestsum

CLI_VERSION := $(shell git describe)
CLI_VERSION := $(if $(shell git describe), $(shell git describe), "UnknownVersion")

build:
mkdir -p ../build
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/spf13/cobra"
)

var CLIVersion = "unset"
var CLIVersion = ""

var rootCmd = &cobra.Command{
Use: "zarf COMMAND|ZARF-PACKAGE|ZARF-YAML",
Expand Down
4 changes: 1 addition & 3 deletions test/e2e/e2e_general_cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,9 @@ func testGeneralCliStuff(t *testing.T, terraformOptions *terraform.Options, keyP
assert.Equal(t, expectedShasum, output, "The expected SHASUM should equal the actual SHASUM")

// Test `zarf version`
//expectedVersion, err := exec.Command("git", "describe").Output()
//require.NoError(t, err, output)
output, err := ssh.CheckSshCommand(t, publicHost, fmt.Sprintf("cd /home/%s/build && ./zarf version", username))
require.NoError(t, err, output)
assert.NotNil(t, output)
assert.NotEqual(t, len(output), 0, "Zarf version should not be an empty string")
//assert.Equal(t, expectedVersion, output, "The expected Zarf version should equal the actual Zarf version")
assert.NotEqual(t, string(output), "Unknown Version", "Zarf version should not be the default value")
}

0 comments on commit c94d58a

Please sign in to comment.