Skip to content

Commit

Permalink
fix: only run tests as sudo if contain Sudo
Browse files Browse the repository at this point in the history
  • Loading branch information
rogercoll committed Dec 12, 2024
1 parent 90f3ceb commit 76930c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ GO_BUILD_LDFLAGS="-s -w"
GOTEST_TIMEOUT?= 600s
GOTEST_OPT?= -race -timeout $(GOTEST_TIMEOUT) -parallel 4 --tags=$(GO_BUILD_TAGS)
GOTEST_INTEGRATION_OPT?= -race -timeout 360s -parallel 4
GOTEST_INTEGRATION_OPT_SUDO= $(GOTEST_INTEGRATION_OPT) -exec sudo
GOTEST_INTEGRATION_OPT_SUDO= $(GOTEST_INTEGRATION_OPT) -exec sudo -run Sudo
GOTEST_OPT_WITH_COVERAGE = $(GOTEST_OPT) -coverprofile=coverage.txt -covermode=atomic
GOTEST_OPT_WITH_INTEGRATION=$(GOTEST_INTEGRATION_OPT) -tags=integration,$(GO_BUILD_TAGS)
GOTEST_OPT_WITH_INTEGRATION_SUDO=$(GOTEST_INTEGRATION_OPT_SUDO) -tags="integration sudo"
GOTEST_OPT_WITH_INTEGRATION_SUDO=$(GOTEST_INTEGRATION_OPT_SUDO) -tags=integration,$(GO_BUILD_TAGS)
GOTEST_OPT_WITH_INTEGRATION_COVERAGE=$(GOTEST_OPT_WITH_INTEGRATION) -coverprofile=integration-coverage.txt -covermode=atomic
GOCMD?= go
GOOS=$(shell $(GOCMD) env GOOS)
Expand Down
6 changes: 3 additions & 3 deletions extension/cgroupruntimeextension/integration_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
//go:build integration && sudo
// +build integration,sudo
//go:build integration
// +build integration

// Privileged access is required to set cgroup's memory and cpu max values

Expand Down Expand Up @@ -63,7 +63,7 @@ func cgroupMaxCpu(filename string) (quota int64, period uint64, err error) {
return quota, period, err
}

func TestCgroupV2Integration(t *testing.T) {
func TestCgroupV2SudoIntegration(t *testing.T) {
checkCgroupSystem(t)
pointerInt64 := func(int int64) *int64 {
return &int
Expand Down

0 comments on commit 76930c2

Please sign in to comment.