Skip to content

Commit

Permalink
PMM-12078 Fix tests and linters.
Browse files Browse the repository at this point in the history
  • Loading branch information
BupycHuk committed Jul 19, 2023
1 parent d709b76 commit 0aa45ff
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
8 changes: 7 additions & 1 deletion managed/cmd/pmm-managed-starlark/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ package main

import (
"bytes"
"context"
"encoding/json"
"os"
"os/exec"
"testing"
"time"

"github.com/percona-platform/saas/pkg/check"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -103,8 +105,12 @@ func TestStarlarkSandbox(t *testing.T) { //nolint:tparallel
},
}

ctx, _ := context.WithTimeout(context.Background(), 120*time.Second)
// since we run the binary as a child process to test it we need to build it first.
err := exec.Command("make", "-C", "../..", "release").Run()
command := exec.CommandContext(ctx, "make", "-C", "../..", "release")
command.Stdout = os.Stdout
command.Stderr = os.Stderr
err := command.Run()
require.NoError(t, err)

for _, tc := range testCases {
Expand Down
9 changes: 0 additions & 9 deletions managed/services/agents/deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (

"github.com/percona/pmm/api/agentpb"
qanpb "github.com/percona/pmm/api/qanpb"
"github.com/percona/pmm/managed/services/agents/channel"
)

// prometheusService is a subset of methods of victoriametrics.Service used by this package.
Expand Down Expand Up @@ -69,11 +68,3 @@ type highAvailablityService interface {
// TODO: extend by send message
BroadcastMessage(message []byte)
}

type communicationChannel interface {
Requests() <-chan *channel.AgentRequest
Send(resp *channel.ServerResponse)
SendAndWaitResponse(payload agentpb.ServerRequestPayload) (agentpb.AgentResponsePayload, error)
Metrics() *channel.Metrics
Wait() error
}
2 changes: 1 addition & 1 deletion managed/services/agents/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type localPMMAgentInfo struct {
kickChan chan struct{}
}

func (p *localPMMAgentInfo) Channel() *channel.Channel { //nolint:ireturn
func (p *localPMMAgentInfo) Channel() *channel.Channel {
return p.channel
}

Expand Down
2 changes: 1 addition & 1 deletion managed/testdata/supervisord.d/pmm-db_disabled.ini
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ redirect_stderr = true
priority = 15
command = /usr/sbin/pmm-agent --config-file=/usr/local/percona/pmm2/config/pmm-agent.yaml
autorestart = true
autostart = true
autostart = false
startretries = 1000
startsecs = 1
stopsignal = TERM
Expand Down
2 changes: 1 addition & 1 deletion managed/testdata/supervisord.d/pmm-db_enabled.ini
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ redirect_stderr = true
priority = 15
command = /usr/sbin/pmm-agent --config-file=/usr/local/percona/pmm2/config/pmm-agent.yaml
autorestart = true
autostart = true
autostart = false
startretries = 1000
startsecs = 1
stopsignal = TERM
Expand Down

0 comments on commit 0aa45ff

Please sign in to comment.