Skip to content

Commit

Permalink
use tests
Browse files Browse the repository at this point in the history
  • Loading branch information
simont1 committed Apr 11, 2024
1 parent 8473aab commit d7c2086
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/new-e2e/tests/apm/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,18 @@ func (s *DockerFakeintakeSuite) TestAutoVersionStats() {
}, 2*time.Minute, 10*time.Second, "Failed finding version tags")
}

func (s *DockerFakeintakeSuite) TestIsTraceRootTag() {
err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators()
s.Require().NoError(err)

service := fmt.Sprintf("tracegen-auto-is-trace-root-tag-%s", s.transport)
defer waitTracegenShutdown(&s.Suite, s.Env().FakeIntake)
defer runTracegenDocker(s.Env().RemoteHost, service, tracegenCfg{transport: s.transport})()
s.EventuallyWithTf(func(c *assert.CollectT) {
testIsTraceRootTag(s.T(), c, s.Env().FakeIntake)
}, 2*time.Minute, 10*time.Second, "Failed finding is_trace_root tag")
}

func (s *DockerFakeintakeSuite) TestStatsForService() {
err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators()
s.Require().NoError(err)
Expand Down
23 changes: 23 additions & 0 deletions test/new-e2e/tests/apm/vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,29 @@ func (s *VMFakeintakeSuite) TestAutoVersionStats() {
}, 3*time.Minute, 10*time.Second, "Failed finding stats")
}

func (s *VMFakeintakeSuite) TestIsTraceRootTag() {
err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators()
s.Require().NoError(err)

service := fmt.Sprintf("tracegen-stats-%s", s.transport)

// Wait for agent to be live
s.T().Log("Waiting for Trace Agent to be live.")
s.Require().NoError(waitRemotePort(s, 8126))

// Run Trace Generator
s.T().Log("Starting Trace Generator.")
defer waitTracegenShutdown(&s.Suite, s.Env().FakeIntake)
shutdown := runTracegenDocker(s.Env().RemoteHost, service, tracegenCfg{transport: s.transport})
defer shutdown()

s.EventuallyWithTf(func(c *assert.CollectT) {
s.logStatus()
testIsTraceRootTag(s.T(), c, s.Env().FakeIntake)
s.logJournal()
}, 3*time.Minute, 10*time.Second, "Failed finding stats")
}

func (s *VMFakeintakeSuite) TestBasicTrace() {
err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators()
s.Require().NoError(err)
Expand Down

0 comments on commit d7c2086

Please sign in to comment.