Skip to content

Commit

Permalink
Fix integration test.
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscovalentecastro committed Apr 29, 2022
1 parent 3026468 commit 260735b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions integration_test/ops_agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ func TestResourceNameLabel(t *testing.T) {
type: files
include_paths:
- %s
processors:
json:
type: parse_json
exporters:
Expand All @@ -701,21 +702,21 @@ func TestResourceNameLabel(t *testing.T) {
pipelines:
p1:
receivers: [f1]
processors: [json, modify]
processors: [json]
exporters: [google]
`, file1)

if err := setupOpsAgent(ctx, logger, vm, config); err != nil {
t.Fatal(err)
}

line := `{default_present":"original"}` + "\n"
line := `{"default_present":"original"}` + "\n"
if err := gce.UploadContent(ctx, logger, vm, strings.NewReader(line), file1); err != nil {
t.Fatalf("error uploading log: %v", err)
}

// Expect to see the log with the modifications applied
check := fmt.Sprintf(`labels."agent.googleapis.com/resource_name"="%s" AND jsonPayload.default_present="original"`, vm.Name)
check := fmt.Sprintf(`labels."compute.googleapis.com/resource_name"="%s" AND jsonPayload.default_present="original"`, vm.Name)
if err := gce.WaitForLog(ctx, logger.ToMainLog(), vm, "f1", time.Hour, check); err != nil {
t.Error(err)
}
Expand Down

0 comments on commit 260735b

Please sign in to comment.