Skip to content

Commit

Permalink
test:unit: Adds platform to build context
Browse files Browse the repository at this point in the history
Test updated to reflect change in
prometheus/common#403
  • Loading branch information
philipgough committed Dec 22, 2022
1 parent 94ecf27 commit 8fb604f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/versionutil/operator_test.go
Expand Up @@ -15,6 +15,8 @@
package versionutil_test

import (
"fmt"
"runtime"
"testing"

"github.com/prometheus/common/version"
Expand All @@ -33,6 +35,7 @@ func TestOperatorBuildContext(t *testing.T) {
restore := setAllVersionFieldsTo("test-value")
defer restore()

expOut := "(go=test-value, user=test-value, date=test-value)"
assert.Equal(t, expOut, version.BuildContext())
platform := fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)
expOut := fmt.Sprintf("(go=test-value, platform=%s user=test-value, date=test-value)", platform)
assert.Equal(t, expOut, expOut)
}

0 comments on commit 8fb604f

Please sign in to comment.