mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 20:36:12 +02:00
context propagation: bouncer list (#3236)
This commit is contained in:
parent
2a60c99036
commit
b4a2403fdf
5 changed files with 28 additions and 20 deletions
|
@ -292,9 +292,11 @@ func TestAPICHandleDeletedDecisions(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestAPICGetMetrics(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
cleanUp := func(api *apic) {
|
||||
api.dbClient.Ent.Bouncer.Delete().ExecX(context.Background())
|
||||
api.dbClient.Ent.Machine.Delete().ExecX(context.Background())
|
||||
api.dbClient.Ent.Bouncer.Delete().ExecX(ctx)
|
||||
api.dbClient.Ent.Machine.Delete().ExecX(ctx)
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
|
@ -377,7 +379,7 @@ func TestAPICGetMetrics(t *testing.T) {
|
|||
ExecX(context.Background())
|
||||
}
|
||||
|
||||
foundMetrics, err := apiClient.GetMetrics()
|
||||
foundMetrics, err := apiClient.GetMetrics(ctx)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, tc.expectedMetric.Bouncers, foundMetrics.Bouncers)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue