-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Heartbeat] Fix testing pipeline for Windows (#40583)
* Fix windows test pipeline by reflecting browser monitor build constraints in the include file
- Loading branch information
1 parent
72f4afb
commit 41b1c4d
Showing
5 changed files
with
50 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
// or more contributor license agreements. Licensed under the Elastic License; | ||
// you may not use this file except in compliance with the Elastic License. | ||
|
||
//go:build linux || darwin || synthetics | ||
|
||
package scenarios | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/elastic/go-lookslike" | ||
"github.com/elastic/go-lookslike/testslike" | ||
|
||
"github.com/elastic/beats/v7/heartbeat/hbtest" | ||
_ "github.com/elastic/beats/v7/heartbeat/monitors/active/http" | ||
_ "github.com/elastic/beats/v7/heartbeat/monitors/active/icmp" | ||
_ "github.com/elastic/beats/v7/heartbeat/monitors/active/tcp" | ||
"github.com/elastic/beats/v7/heartbeat/monitors/wrappers/summarizer/jobsummary" | ||
"github.com/elastic/beats/v7/x-pack/heartbeat/scenarios/framework" | ||
) | ||
|
||
func TestBrowserSummaries(t *testing.T) { | ||
t.Parallel() | ||
scenarioDB.RunTagWithSeparateTwists(t, "browser", StdAttemptTwists, func(t *testing.T, mtr *framework.MonitorTestRun, err error) { | ||
all := mtr.Events() | ||
lastEvent := all[len(all)-1] | ||
|
||
testslike.Test(t, | ||
lookslike.Compose( | ||
SummaryValidatorForStatus(mtr.Meta.Status), | ||
hbtest.URLChecks(t, mtr.Meta.URL), | ||
), | ||
lastEvent.Fields) | ||
|
||
monStatus, _ := lastEvent.GetValue("monitor.status") | ||
summaryIface, _ := lastEvent.GetValue("summary") | ||
summary := summaryIface.(*jobsummary.JobSummary) | ||
require.Equal(t, string(summary.Status), monStatus, "expected summary status and mon status to be equal in event: %v", lastEvent.Fields) | ||
|
||
requireOneSummaryPerAttempt(t, all) | ||
|
||
}) | ||
} |