Skip to content

Commit

Permalink
ci: enable windows for testing heartbeat (#32937)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored and chrisberkhout committed Jun 1, 2023
1 parent 42ecd33 commit 9a93cd5
Show file tree
Hide file tree
Showing 15 changed files with 59 additions and 55 deletions.
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
1 change: 1 addition & 0 deletions x-pack/heartbeat/monitors/browser/source/source.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// 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

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
},
},
},
}

0 comments on commit 9a93cd5

Please sign in to comment.