Skip to content

Commit

Permalink
counter/countertest: add returns to disabled functions that need them
Browse files Browse the repository at this point in the history
Also add a SkipIfUnsupportedPlatform to TestE2E_off

Fixes golang/go#65544

Change-Id: I8896c8c4c80589516fefd6357cfdf302cd93945b
Cq-Include-Trybots: luci.golang.try:x_telemetry-gotip-linux-386,x_telemetry-gotip-js-wasm,x_telemetry-gotip-solaris-amd64,x_telemetry-gotip-openbsd-amd64,x_telemetry-gotip-windows-386,x_telemetry-gotip-wasip1-wasm_wazero
Reviewed-on: https://go-review.googlesource.com/c/telemetry/+/562396
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
  • Loading branch information
Pinkle-pash committed Feb 7, 2024
1 parent c69e2d3 commit a13d72d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
12 changes: 9 additions & 3 deletions counter/countertest/countertest_disabled.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ package countertest

import "golang.org/x/telemetry/counter"

func Open(telemetryDir string) {}
func ReadCounter(c *counter.Counter) (count uint64, _ error) {}
func ReadStackCounter(c *counter.StackCounter) (stackCounts map[string]uint64, _ error) {}
func Open(telemetryDir string) {}

func ReadCounter(c *counter.Counter) (count uint64, _ error) {
return 0, nil
}

func ReadStackCounter(c *counter.StackCounter) (stackCounts map[string]uint64, _ error) {
return nil, nil
}
1 change: 1 addition & 0 deletions internal/regtest/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func programIncCounters() int {

func TestE2E_off(t *testing.T) {
testenv.MustHaveExec(t)
testenv.SkipIfUnsupportedPlatform(t)

prog := NewProgram(t, "prog", programIncCounters)
tests := []struct {
Expand Down

0 comments on commit a13d72d

Please sign in to comment.