Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions testing/integration/ess/beat_receivers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,8 @@ outputs:
type: elasticsearch
hosts: [http://localhost:9200]
api_key: placeholder
status_reporting:
enabled: false
agent.monitoring.enabled: false
`

Expand Down Expand Up @@ -847,6 +849,8 @@ outputs:
hosts: [http://localhost:9200]
api_key: placeholder
indices: [] # not supported by the elasticsearch exporter
status_reporting:
enabled: false
`

// this is the context for the whole test, with a global timeout defined
Expand Down Expand Up @@ -943,6 +947,8 @@ outputs:
type: elasticsearch
hosts: [http://localhost:9200]
api_key: placeholder
status_reporting:
enabled: false
agent.monitoring.enabled: false
`

Expand Down Expand Up @@ -1030,6 +1036,8 @@ outputs:
type: elasticsearch
hosts: [http://localhost:9200]
api_key: placeholder
status_reporting:
enabled: false
agent.monitoring.enabled: false
`
err = fixture.Configure(ctx, []byte(configNoComponents))
Expand Down
39 changes: 20 additions & 19 deletions testing/integration/ess/diagnostics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ outputs:
type: elasticsearch
hosts: [http://localhost:9200]
api_key: placeholder
status_reporting:
enabled: false
agent.monitoring.enabled: false
`

Expand All @@ -359,13 +361,25 @@ agent.monitoring.enabled: false

ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute))
defer cancel()
expectedComponentState := map[string]integrationtest.ComponentState{
"filestream-default": {
State: integrationtest.NewClientState(client.Healthy),
Units: map[integrationtest.ComponentUnitKey]integrationtest.ComponentUnitState{
integrationtest.ComponentUnitKey{UnitType: client.UnitTypeOutput, UnitID: "filestream-default"}: {
State: integrationtest.NewClientState(client.Healthy),
},
integrationtest.ComponentUnitKey{UnitType: client.UnitTypeInput, UnitID: "filestream-default-filestream-filebeat"}: {
State: integrationtest.NewClientState(client.Healthy),
},
},
},
}
expectedAgentState := integrationtest.NewClientState(client.Healthy)

testCases := []struct {
name string
runtime string
expectedCompDiagnosticsFiles []string
expectedAgentState *client.State
expectedComponentState map[string]integrationtest.ComponentState
}{
{
name: "filebeat process",
Expand All @@ -377,20 +391,6 @@ agent.monitoring.enabled: false
"beat-rendered-config.yml",
"global_processors.txt",
),
expectedAgentState: integrationtest.NewClientState(client.Healthy),
expectedComponentState: map[string]integrationtest.ComponentState{
"filestream-default": {
State: integrationtest.NewClientState(client.Healthy),
Units: map[integrationtest.ComponentUnitKey]integrationtest.ComponentUnitState{
integrationtest.ComponentUnitKey{UnitType: client.UnitTypeOutput, UnitID: "filestream-default"}: {
State: integrationtest.NewClientState(client.Healthy),
},
integrationtest.ComponentUnitKey{UnitType: client.UnitTypeInput, UnitID: "filestream-default-filestream-filebeat"}: {
State: integrationtest.NewClientState(client.Healthy),
},
},
},
},
},
{
name: "filebeat receiver",
Expand All @@ -400,7 +400,6 @@ agent.monitoring.enabled: false
"beat_metrics.json",
"input_metrics.json",
},
expectedAgentState: integrationtest.NewClientState(client.Degraded),
},
}

Expand Down Expand Up @@ -443,8 +442,8 @@ agent.monitoring.enabled: false
}
err = f.Run(ctx, integrationtest.State{
Configure: configBuffer.String(),
AgentState: tc.expectedAgentState,
Components: tc.expectedComponentState,
AgentState: expectedAgentState,
Components: expectedComponentState,
After: testDiagnosticsFactory(t, filebeatSetup, expDiagFiles, tc.expectedCompDiagnosticsFiles, f, []string{"diagnostics", "collect"}),
})
assert.NoError(t, err)
Expand Down Expand Up @@ -475,6 +474,8 @@ outputs:
type: elasticsearch
hosts: [http://localhost:9200]
api_key: placeholder
status_reporting:
enabled: false
agent.monitoring.enabled: false
`

Expand Down