Skip to content

Commit

Permalink
Check whether browsers can be tested
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewvc committed Aug 15, 2023
1 parent 7d877e8 commit db08ea2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions x-pack/heartbeat/scenarios/browsercheck_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package scenarios

Check failure on line 1 in x-pack/heartbeat/scenarios/browsercheck_test.go

View workflow job for this annotation

GitHub Actions / check

is missing the license header

import (
"os/exec"
"strings"
"testing"

"github.com/stretchr/testify/require"
)

func TestElasticSyntheticsRunnable(t *testing.T) {
// this test should fail if synthetics isn't correctly setup in the current environment
cmd := exec.Command("sh", "-c", "echo 'step(\"t\", () => { })' | elastic-synthetics --inline")
var out strings.Builder
cmd.Stdout = &out
cmd.Stderr = &out
cmd.Run()

Check failure on line 17 in x-pack/heartbeat/scenarios/browsercheck_test.go

View workflow job for this annotation

GitHub Actions / lint (linux)

Error return value of `cmd.Run` is not checked (errcheck)
require.Equal(t, 0, cmd.ProcessState.ExitCode(), "command exited with bad code: %s", out.String())
}

0 comments on commit db08ea2

Please sign in to comment.