Skip to content

Commit ffc2da2

Browse files
revert compose tests
1 parent 2c7af13 commit ffc2da2

File tree

4 files changed

+2
-163
lines changed

4 files changed

+2
-163
lines changed

internal/cmd/integration-tests/docker-compose.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,6 @@ services:
122122
networks:
123123
- integration-tests
124124

125-
pyroscope:
126-
image: grafana/pyroscope
127-
container_name: pyroscope
128-
ports:
129-
- "4040:4040"
130-
networks:
131-
- integration-tests
132-
133125
networks:
134126
integration-tests:
135127
driver: bridge

internal/cmd/integration-tests/tests/pyroscope-java/config.alloy

Lines changed: 0 additions & 42 deletions
This file was deleted.

internal/cmd/integration-tests/tests/pyroscope-java/pyroscope_java_test.go

Lines changed: 0 additions & 57 deletions
This file was deleted.

internal/cmd/integration-tests/utils.go

Lines changed: 2 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package main
22

33
import (
44
"context"
5-
"encoding/json"
65
"fmt"
76
"io"
87
"log"
@@ -15,7 +14,6 @@ import (
1514
"time"
1615

1716
"github.com/docker/docker/api/types/container"
18-
"github.com/docker/docker/api/types/mount"
1917
"github.com/docker/go-connections/nat"
2018
"github.com/testcontainers/testcontainers-go"
2119
"github.com/testcontainers/testcontainers-go/wait"
@@ -40,45 +38,6 @@ type fileInfo struct {
4038
relPath string
4139
}
4240

43-
func getDockerSocketPath() (string, error) {
44-
contextCmd := exec.Command("docker", "context", "show")
45-
contextOutput, err := contextCmd.Output()
46-
if err != nil {
47-
return "", fmt.Errorf("failed to get docker context: %w", err)
48-
}
49-
contextName := strings.TrimSpace(string(contextOutput))
50-
51-
inspectCmd := exec.Command("docker", "context", "inspect", contextName)
52-
inspectOutput, err := inspectCmd.Output()
53-
if err != nil {
54-
return "", fmt.Errorf("failed to inspect docker context %s: %w", contextName, err)
55-
}
56-
57-
var contexts []struct {
58-
Endpoints struct {
59-
Docker struct {
60-
Host string `json:"Host"`
61-
} `json:"docker"`
62-
} `json:"Endpoints"`
63-
}
64-
65-
if err := json.Unmarshal(inspectOutput, &contexts); err != nil {
66-
return "", fmt.Errorf("failed to parse docker context inspect output: %w", err)
67-
}
68-
69-
if len(contexts) == 0 {
70-
return "", fmt.Errorf("no docker contexts found")
71-
}
72-
73-
host := contexts[0].Endpoints.Docker.Host
74-
if !strings.HasPrefix(host, "unix://") {
75-
return "", fmt.Errorf("docker host is not a unix socket: %s", host)
76-
}
77-
78-
socketPath := strings.TrimPrefix(host, "unix://")
79-
return socketPath, nil
80-
}
81-
8241
func executeCommand(command string, args []string, taskDescription string) {
8342
fmt.Printf("%s...\n", taskDescription)
8443

@@ -130,9 +89,6 @@ func prepareContainerFiles(absTestDir string) ([]testcontainers.ContainerFile, [
13089

13190
// Create a container request based on the test directory
13291
func createContainerRequest(dirName string, port int, networkName string, containerFiles []testcontainers.ContainerFile) testcontainers.ContainerRequest {
133-
pyroscope := strings.Contains(dirName, "pyroscope")
134-
beyla := dirName == "beyla"
135-
13692
natPort, err := nat.NewPort("tcp", strconv.Itoa(port))
13793
if err != nil {
13894
panic(fmt.Sprintf("failed to build natPort: %v", err))
@@ -152,19 +108,9 @@ func createContainerRequest(dirName string, port int, networkName string, contai
152108
},
153109
Privileged: true,
154110
}
155-
dockerSocketPath, err := getDockerSocketPath()
156-
if err != nil {
157-
panic(fmt.Sprintf("failed to get docker socket path: %v", err))
158-
}
159-
if beyla || pyroscope {
111+
112+
if dirName == "beyla" {
160113
req.HostConfigModifier = func(hostConfig *container.HostConfig) {
161-
if pyroscope {
162-
hostConfig.Mounts = append(hostConfig.Mounts, mount.Mount{
163-
Type: mount.TypeBind,
164-
Source: dockerSocketPath,
165-
Target: "/host-docker.sock",
166-
})
167-
}
168114
hostConfig.Privileged = true
169115
hostConfig.CapAdd = []string{"SYS_ADMIN", "SYS_PTRACE", "SYS_RESOURCE"}
170116
hostConfig.SecurityOpt = []string{"apparmor:unconfined"}

0 commit comments

Comments
 (0)