Files
threshold/testing/internal/e2e/tests/base/version_test.go
shadowdaoandClaude Sonnet 5.5 962d708fdd Rename Go module paths to repo.anhonesthost.net/CyberCoveLLC/threshold
Rename root, api and sdk module paths (imports, go.mod, go_package,
ldflags, build scripts, buf configs) and regenerate protobuf/gateway
code with the project's pinned toolchain. Wire identifiers unchanged.
api gets a local replace for sdk; root/api/sdk require v0.1.0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 10:33:41 -07:00

38 lines
1.1 KiB
Go

// Copyright IBM Corp. 2020, 2026
// SPDX-License-Identifier: BUSL-1.1
package base_test
import (
"encoding/json"
"strconv"
"strings"
"testing"
"repo.anhonesthost.net/CyberCoveLLC/threshold/testing/internal/e2e"
"repo.anhonesthost.net/CyberCoveLLC/threshold/version"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
// TestCliVersion validates the output from `boundary version`
func TestCliVersion(t *testing.T) {
e2e.MaybeSkipTest(t)
ctx := t.Context()
output := e2e.RunCommand(ctx, "boundary", e2e.WithArgs("version", "-format", "json"))
require.NoError(t, output.Err, string(output.Stderr))
var versionResult version.Info
err := json.Unmarshal(output.Stdout, &versionResult)
require.NoError(t, err)
parts := strings.Split(versionResult.Version, ".")
assert.Equal(t, 3, len(parts), "Incorrect number of parts in version %q. EXPECTED: 3, ACTUAL: %d", versionResult.Version, len(parts))
for _, v := range parts {
_, err := strconv.Atoi(v)
assert.NoError(t, err, "Invalid value in version %q. EXPECTED: Number, ACTUAL: %s", versionResult.Version, v)
}
}