Skip to content

Commit

Permalink
build: add test for vault
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko committed May 13, 2022
1 parent 1c1c996 commit bbc7232
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions build/git_revision_test.go
Expand Up @@ -75,6 +75,35 @@ func TestGitRevision_consul(t *testing.T) {
}
}

func TestGitRevision_vault(t *testing.T) {
testutil.EndToEndTest(t)

gr := &GitRevision{Product: product.Vault}
gr.SetLogger(testutil.TestLogger())

ctx := context.Background()

execPath, err := gr.Build(ctx)
if err != nil {
t.Fatal(err)
}
t.Cleanup(func() { gr.Remove(ctx) })

v, err := product.Vault.GetVersion(ctx, execPath)
if err != nil {
t.Fatal(err)
}

latestConstraint, err := version.NewConstraint(">= 1.0")
if err != nil {
t.Fatal(err)
}
if !latestConstraint.Check(v.Core()) {
t.Fatalf("versions don't match (expected: %s, installed: %s)",
latestConstraint, v)
}
}

func TestGitRevisionValidate(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit bbc7232

Please sign in to comment.