Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.4](backport #32937) ci: enable windows for testing heartbeat #32963

Closed
wants to merge 1 commit into from
Closed
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
58 changes: 30 additions & 28 deletions x-pack/heartbeat/Jenkinsfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,36 @@ stages:
- "macosTest"
tags: true ## for all the tags
stage: extended
# TODO: there are windows test failures already reported
# https:/elastic/beats/issues/23957 and https:/elastic/beats/issues/23958
# waiting for being fixed.
# windows-2019:
# mage: "mage build test"
# platforms: ## override default labels in this specific stage.
# - "windows-2019"
# stage: extended_win
# windows-2016:
# mage: "mage build test"
# platforms: ## override default labels in this specific stage.
# - "windows-2016"
# stage: mandatory
# windows-2012:
# mage: "mage build test"
# platforms: ## override default labels in this specific stage.
# - "windows-2012-r2"
# stage: extended_win
# windows-10:
# mage: "mage build test"
# platforms: ## override default labels in this specific stage.
# - "windows-10"
# stage: extended_win
# windows-8:
# mage: "mage build test"
# platforms: ## override default labels in this specific stage.
# - "windows-8"
# stage: extended_win
windows-2022:
mage: "mage build test"
platforms: ## override default labels in this specific stage.
- "windows-2022"
stage: mandatory
windows-2019:
mage: "mage build test"
platforms: ## override default labels in this specific stage.
- "windows-2019"
stage: extended_win
windows-2016:
mage: "mage build test"
platforms: ## override default labels in this specific stage.
- "windows-2016"
stage: mandatory
windows-2012:
mage: "mage build test"
platforms: ## override default labels in this specific stage.
- "windows-2012-r2"
stage: extended_win
windows-10:
mage: "mage build test"
platforms: ## override default labels in this specific stage.
- "windows-10"
stage: extended_win
windows-8:
mage: "mage build test"
platforms: ## override default labels in this specific stage.
- "windows-8"
stage: extended_win
packaging-linux:
packaging-linux: "mage package"
e2e:
Expand Down
2 changes: 2 additions & 0 deletions x-pack/heartbeat/monitors/browser/source/inline.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// 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
// +build linux darwin

package source

Expand Down
2 changes: 2 additions & 0 deletions x-pack/heartbeat/monitors/browser/source/inline_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// 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
// +build linux darwin

package source

Expand Down
3 changes: 3 additions & 0 deletions x-pack/heartbeat/monitors/browser/source/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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
// +build linux darwin

package source

import (
Expand Down
3 changes: 3 additions & 0 deletions x-pack/heartbeat/monitors/browser/source/local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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
// +build linux darwin

package source

import (
Expand Down
2 changes: 2 additions & 0 deletions x-pack/heartbeat/monitors/browser/source/offline.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// 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
// +build linux darwin

package source

Expand Down
2 changes: 2 additions & 0 deletions x-pack/heartbeat/monitors/browser/source/project.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// 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
// +build linux darwin

package source

Expand Down
2 changes: 2 additions & 0 deletions x-pack/heartbeat/monitors/browser/source/project_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// 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
// +build linux darwin

package source

Expand Down
6 changes: 6 additions & 0 deletions x-pack/heartbeat/monitors/browser/source/source.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
// 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.
<<<<<<< HEAD
=======

//go:build linux || darwin
// +build linux darwin
>>>>>>> 8552e34a6a (ci: enable windows for testing heartbeat (#32937))
Comment on lines +4 to +9
Copy link
Member

@v1v v1v Sep 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrewvc , is this correct?

Suggested change
<<<<<<< HEAD
=======
//go:build linux || darwin
// +build linux darwin
>>>>>>> 8552e34a6a (ci: enable windows for testing heartbeat (#32937))
//go:build linux || darwin
// +build linux darwin


package source

Expand Down
3 changes: 3 additions & 0 deletions x-pack/heartbeat/monitors/browser/source/validatepackage.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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
// +build linux darwin

package source

import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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
// +build linux darwin

package source

import (
Expand Down
3 changes: 3 additions & 0 deletions x-pack/heartbeat/monitors/browser/source/zipurl.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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
// +build linux darwin

package source

import (
Expand Down
3 changes: 3 additions & 0 deletions x-pack/heartbeat/monitors/browser/source/zipurl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// 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
// +build linux darwin

package source

import (
Expand Down
1 change: 0 additions & 1 deletion x-pack/heartbeat/scenarios/basics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
_ "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/x-pack/heartbeat/monitors/browser"
)

func TestSimpleScenariosBasicFields(t *testing.T) {
Expand Down
26 changes: 0 additions & 26 deletions x-pack/heartbeat/scenarios/scenarios.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"fmt"
"net/http/httptest"
"net/url"
"os"
"sync"

"github.com/elastic/elastic-agent-libs/mapstr"
Expand Down Expand Up @@ -70,30 +69,5 @@ var Scenarios = &ScenarioDB{
}, func() {}, nil
},
},
{
Name: "simple-browser",
Type: "browser",
Tags: []string{"browser", "browser-inline"},
Runner: func() (config mapstr.M, close func(), err error) {
err = os.Setenv("ELASTIC_SYNTHETICS_CAPABLE", "true")
if err != nil {
return nil, nil, err
}
server := httptest.NewServer(hbtest.HelloWorldHandler(200))
config = mapstr.M{
"id": "browser-test-id",
"name": "browser-test-name",
"type": "browser",
"schedule": "@every 1m",
"hosts": []string{"127.0.0.1"},
"source": mapstr.M{
"inline": mapstr.M{
"script": fmt.Sprintf("step('load server', async () => {await page.goto('%s')})", server.URL),
},
},
}
return config, server.Close, nil
},
},
},
}