Skip to content

Commit

Permalink
Improved test and suite names
Browse files Browse the repository at this point in the history
  • Loading branch information
JoukoVirtanen committed Oct 31, 2023
1 parent e132acd commit 88d442f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
36 changes: 18 additions & 18 deletions integration-tests/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ func TestDuplicateEndpoints(t *testing.T) {
suite.Run(t, new(suites.DuplicateEndpointsTestSuite))
}

func TestChangeProcessName1(t *testing.T) {
changeProcessName := &suites.ChangeProcessNameTestSuite{
func TestProcessesAndEndpoints1(t *testing.T) {
processesAndEndpoints := &suites.ProcessesAndEndpointsTestSuite{
Executable: "./change-process-name",
ContainerName: "change-process-name",
ExpectedEndpoints: []types.EndpointInfo{
Expand All @@ -151,11 +151,11 @@ func TestChangeProcessName1(t *testing.T) {
},
},
}
suite.Run(t, changeProcessName)
suite.Run(t, processesAndEndpoints)
}

func TestChangeProcessName2(t *testing.T) {
changeProcessName := &suites.ChangeProcessNameTestSuite{
func TestProcessesAndEndpoints2(t *testing.T) {
processesAndEndpoints := &suites.ProcessesAndEndpointsTestSuite{
Executable: "./change-executable-file-path",
ContainerName: "change-executable-file-path",
ExpectedEndpoints: []types.EndpointInfo{
Expand All @@ -182,11 +182,11 @@ func TestChangeProcessName2(t *testing.T) {
},
},
}
suite.Run(t, changeProcessName)
suite.Run(t, processesAndEndpoints)
}

func TestChangeProcessNameChildProcess(t *testing.T) {
changeProcessName := &suites.ChangeProcessNameTestSuite{
func TestProcessesAndEndpointsChildProcess(t *testing.T) {
processesAndEndpoints := &suites.ProcessesAndEndpointsTestSuite{
Executable: "./listening-endpoint-child-process",
ContainerName: "listening-endpoint-child-process",
ExpectedEndpoints: []types.EndpointInfo{
Expand Down Expand Up @@ -218,11 +218,11 @@ func TestChangeProcessNameChildProcess(t *testing.T) {
},
},
}
suite.Run(t, changeProcessName)
suite.Run(t, processesAndEndpoints)
}

func TestChangeProcessNameChildProcessNoExec(t *testing.T) {
changeProcessName := &suites.ChangeProcessNameTestSuite{
func TestProcessesAndEndpointsChildProcessNoExec(t *testing.T) {
processesAndEndpoints := &suites.ProcessesAndEndpointsTestSuite{
Executable: "./listening-endpoint-child-process-no-exec",
ContainerName: "listening-endpoint-child-process-no-exec",
ExpectedEndpoints: []types.EndpointInfo{
Expand All @@ -249,11 +249,11 @@ func TestChangeProcessNameChildProcessNoExec(t *testing.T) {
},
},
}
suite.Run(t, changeProcessName)
suite.Run(t, processesAndEndpoints)
}

func TestChangeProcessNameChildProcessNoFork(t *testing.T) {
changeProcessName := &suites.ChangeProcessNameTestSuite{
func TestProcessesAndEndpointsChildProcessNoFork(t *testing.T) {
processesAndEndpoints := &suites.ProcessesAndEndpointsTestSuite{
Executable: "./listening-endpoint-child-process-no-fork",
ContainerName: "listening-endpoint-child-process-no-fork",
ExpectedEndpoints: []types.EndpointInfo{
Expand Down Expand Up @@ -283,11 +283,11 @@ func TestChangeProcessNameChildProcessNoFork(t *testing.T) {
},
},
}
suite.Run(t, changeProcessName)
suite.Run(t, processesAndEndpoints)
}

func TestChangeProcessNameChildProcessNoForkDelay(t *testing.T) {
changeProcessName := &suites.ChangeProcessNameTestSuite{
func TestProcessesAndEndpointsChildProcessNoForkDelay(t *testing.T) {
processesAndEndpoints := &suites.ProcessesAndEndpointsTestSuite{
Executable: "./listening-endpoint-child-process-no-fork",
Args: []string{"5"},
ContainerName: "listening-endpoint-child-process-no-fork",
Expand Down Expand Up @@ -320,7 +320,7 @@ func TestChangeProcessNameChildProcessNoForkDelay(t *testing.T) {
},
},
}
suite.Run(t, changeProcessName)
suite.Run(t, processesAndEndpoints)
}

func TestConnectionsAndEndpointsNormal(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/assert"
)

type ChangeProcessNameTestSuite struct {
type ProcessesAndEndpointsTestSuite struct {
IntegrationTestSuiteBase
container string
Executable string
Expand All @@ -19,7 +19,7 @@ type ChangeProcessNameTestSuite struct {
ContainerName string
}

func (s *ChangeProcessNameTestSuite) SetupSuite() {
func (s *ProcessesAndEndpointsTestSuite) SetupSuite() {

collector := s.Collector()

Expand All @@ -39,13 +39,13 @@ func (s *ChangeProcessNameTestSuite) SetupSuite() {
time.Sleep(20 * time.Second)
}

func (s *ChangeProcessNameTestSuite) TearDownSuite() {
func (s *ProcessesAndEndpointsTestSuite) TearDownSuite() {
s.StopCollector()
s.cleanupContainer([]string{"collector"})
s.cleanupContainer([]string{s.ContainerName})
}

func (s *ChangeProcessNameTestSuite) TestChangeProcessName() {
func (s *ProcessesAndEndpointsTestSuite) TestProcessesAndEndpoints() {
processes := s.Sensor().Processes(s.container)
endpoints := s.Sensor().Endpoints(s.container)

Expand Down

0 comments on commit 88d442f

Please sign in to comment.