Skip to content

Commit

Permalink
restrict unix integration-tests to run on linux only (#6397)
Browse files Browse the repository at this point in the history
  • Loading branch information
wildum authored Feb 21, 2024
1 parent 6c0032d commit acdde1c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions integration-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Execute the integration tests using the following command:

`go run .`

**_NOTE:_** The tests don't run on Windows. If you want to run the tests on Linux, you need to set the environment variable OTEL_EXPORTER_ENDPOINT=172.17.0.1:4318.

### Flags

* `--skip-build`: Run the integration tests without building the agent (default: `false`)
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/tests/unix/unix_metrics_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build !windows
//go:build linux

package main

Expand Down
5 changes: 5 additions & 0 deletions integration-tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"
"os/exec"
"path/filepath"
"strings"
"sync"
)

Expand Down Expand Up @@ -122,6 +123,10 @@ func reportResults() {
// If the channel would not be closed, the for loop would wait forever.
close(logChan)
for log := range logChan {
if strings.Contains(log.TestOutput, "build constraints exclude all Go files") {
fmt.Printf("Test %q is not applicable for this OS, ignoring\n", log.TestDir)
continue
}
fmt.Printf("Failure detected in %s:\n", log.TestDir)
fmt.Println("Test output:", log.TestOutput)
fmt.Println("Agent logs:", log.AgentLog)
Expand Down

0 comments on commit acdde1c

Please sign in to comment.