Skip to content

Commit

Permalink
chore: update docker compose command
Browse files Browse the repository at this point in the history
  • Loading branch information
sigilioso committed Jul 3, 2024
1 parent a06bb53 commit 4fb6680
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ test:

integration-test:
@echo "=== $(INTEGRATION) === [ test ]: running integration tests..."
@docker-compose -f tests/docker-compose.yml pull
@go test -v -tags=integration ./tests/. || (ret=$$?; docker-compose -f tests/docker-compose.yml down && exit $$ret)
@docker-compose -f tests/docker-compose.yml down
@docker compose -f tests/docker-compose.yml pull
@go test -v -tags=integration ./tests/. || (ret=$$?; docker compose -f tests/docker-compose.yml down && exit $$ret)
@docker compose -f tests/docker-compose.yml down

compile:
@echo "=== $(INTEGRATION) === [ compile ]: Building $(BINARY_NAME)..."
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ services:
To connect with a msclient simply start the service:
```shell
$ docker-compose up
$ docker compose up
$ sqlcmd -S127.0.0.1 -USA -Psecret123! -q "SELECT * FROM sys.dm_os_performance_counters WHERE counter_name = 'Buffer cache hit ratio' or counter_name = 'Buffer cache hit ratio base'"
```

Expand Down
11 changes: 7 additions & 4 deletions tests/helper.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
//go:build integration
// +build integration

package tests

import (
"bytes"
"fmt"
"github.com/newrelic/infra-integrations-sdk/log"
"github.com/xeipuuv/gojsonschema"
"os"
"os/exec"
"path/filepath"
"strings"

"github.com/newrelic/infra-integrations-sdk/log"
"github.com/xeipuuv/gojsonschema"
)

func dockerComposeRunMode(vars []string, ports []string, container string, detached bool) (string, string, error) {
Expand All @@ -28,8 +30,9 @@ func dockerComposeRunMode(vars []string, ports []string, container string, detac
cmdLine = append(cmdLine, fmt.Sprintf("-p%s", ports[p]))
}
cmdLine = append(cmdLine, container)
fmt.Printf("executing: docker-compose %s --verbose\n", strings.Join(cmdLine, " "))
cmd := exec.Command("docker-compose", cmdLine...)
cmdLine = append([]string{"compose"}, cmdLine...)
fmt.Printf("executing: docker %s --verbose\n", strings.Join(cmdLine, " "))
cmd := exec.Command("docker", cmdLine...)
var outbuf, errbuf bytes.Buffer
cmd.Stdout = &outbuf
cmd.Stderr = &errbuf
Expand Down

0 comments on commit 4fb6680

Please sign in to comment.