Skip to content

Commit

Permalink
browser: disable a bunch of tests on windows
Browse files Browse the repository at this point in the history
It seems like quite a lot of tests are not passing on windows.

Unfortunately given the volume fixing them right now seems unlikely.
So I opened #4118

This tests have not been ran on windows it seems ever, before the move
of the codebase to core.
  • Loading branch information
mstoykov committed Dec 16, 2024
1 parent f0ff9c3 commit d149740
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 2 deletions.
6 changes: 6 additions & 0 deletions js/modules/k6/browser/storage/file_persister_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http/httptest"
"os"
"path/filepath"
"runtime"
"strings"
"testing"

Expand Down Expand Up @@ -82,6 +83,11 @@ func TestLocalFilePersister(t *testing.T) {

func TestRemoteFilePersister(t *testing.T) {
t.Parallel()
if runtime.GOOS == "windows" {
t.Skip("not supported on windows for now")
// actual problem is that the paths used are with reverse slash even when they get to be inside JSON
// which leads to them being parsed as escepe codes when they shouldn't
}

const (
basePath = "screenshots"
Expand Down
4 changes: 4 additions & 0 deletions js/modules/k6/browser/tests/element_handle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"image/png"
"io"
"runtime"
"testing"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -174,6 +175,9 @@ func TestElementHandleClickWithDetachedNode(t *testing.T) {

func TestElementHandleClickConcealedLink(t *testing.T) {
t.Parallel()
if runtime.GOOS == "windows" {
t.Skip() // wrong result
}

const (
wantBefore = "🙈"
Expand Down
3 changes: 3 additions & 0 deletions js/modules/k6/browser/tests/frame_manager_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// practically none of this work on windows
//go:build !windows

package tests

import (
Expand Down
3 changes: 3 additions & 0 deletions js/modules/k6/browser/tests/frame_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// practically none of this work on windows
//go:build !windows

package tests

import (
Expand Down
3 changes: 3 additions & 0 deletions js/modules/k6/browser/tests/keyboard_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// practically none of this work on windows
//go:build !windows

package tests

import (
Expand Down
3 changes: 3 additions & 0 deletions js/modules/k6/browser/tests/lifecycle_wait_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// practically none of this work on windows
//go:build !windows

package tests

import (
Expand Down
3 changes: 3 additions & 0 deletions js/modules/k6/browser/tests/locator_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// practically none of this work on windows
//go:build !windows

package tests

import (
Expand Down
30 changes: 29 additions & 1 deletion js/modules/k6/browser/tests/page_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"net/http"
"net/http/httptest"
"os"
"runtime"
"strconv"
"sync/atomic"
"testing"
Expand Down Expand Up @@ -39,6 +40,9 @@ const sampleHTML = `<div><b>Test</b><ol><li><i>One</i></li></ol></div>`

func TestNestedFrames(t *testing.T) {
t.Parallel()
if runtime.GOOS == "windows" {
t.Skip("windows take forever to do this test")
}

tb := newTestBrowser(t,
withFileServer(),
Expand Down Expand Up @@ -335,6 +339,9 @@ func TestPageGotoDataURI(t *testing.T) {

func TestPageGotoWaitUntilLoad(t *testing.T) {
t.Parallel()
if runtime.GOOS == "windows" {
t.Skip() // no idea but it doesn't work
}

b := newTestBrowser(t, withFileServer())
p := b.NewPage(nil)
Expand All @@ -355,6 +362,9 @@ func TestPageGotoWaitUntilLoad(t *testing.T) {

func TestPageGotoWaitUntilDOMContentLoaded(t *testing.T) {
t.Parallel()
if runtime.GOOS == "windows" {
t.Skip() // no idea but it doesn't work
}

b := newTestBrowser(t, withFileServer())
p := b.NewPage(nil)
Expand Down Expand Up @@ -1359,6 +1369,9 @@ func TestPageTimeout(t *testing.T) {

func TestPageWaitForSelector(t *testing.T) {
t.Parallel()
if runtime.GOOS == "windows" {
t.Skip() // no idea but it doesn't work
}

testCases := []struct {
name string
Expand Down Expand Up @@ -1417,6 +1430,9 @@ func TestPageWaitForSelector(t *testing.T) {

func TestPageThrottleNetwork(t *testing.T) {
t.Parallel()
if runtime.GOOS == "windows" {
t.Skip() // windows timeouts
}

testCases := []struct {
name string
Expand Down Expand Up @@ -1526,6 +1542,9 @@ func TestPageThrottleNetwork(t *testing.T) {
func TestPageThrottleCPU(t *testing.T) {
t.Parallel()

if runtime.GOOS == "windows" {
t.Skip() // windows timeouts
}
tb := newTestBrowser(t, withFileServer())

tb.withHandler("/ping", func(w http.ResponseWriter, req *http.Request) {
Expand Down Expand Up @@ -1586,6 +1605,9 @@ func performPingTest(t *testing.T, tb *testBrowser, page *common.Page, iteration

func TestPageIsVisible(t *testing.T) {
t.Parallel()
if runtime.GOOS == "windows" {
t.Skip() // timeouts
}

testCases := []struct {
name string
Expand Down Expand Up @@ -1657,6 +1679,9 @@ func TestPageIsVisible(t *testing.T) {

func TestPageIsHidden(t *testing.T) {
t.Parallel()
if runtime.GOOS == "windows" {
t.Skip() // timeouts
}

testCases := []struct {
name string
Expand Down Expand Up @@ -1728,6 +1753,9 @@ func TestPageIsHidden(t *testing.T) {

func TestShadowDOMAndDocumentFragment(t *testing.T) {
t.Parallel()
if runtime.GOOS == "windows" {
t.Skip() // timeouts
}

// Start a server that will return static html files.
mux := http.NewServeMux()
Expand Down Expand Up @@ -2135,7 +2163,7 @@ func TestPageOnMetric(t *testing.T) {
const page = await browser.newPage()
%s
await page.goto('%s', {waitUntil: 'networkidle'});
await page.close()
Expand Down
5 changes: 4 additions & 1 deletion js/modules/k6/browser/tests/webvital_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package tests

import (
"context"
"runtime"
"testing"
"time"

Expand All @@ -18,7 +19,9 @@ import (
// a web page.
func TestWebVitalMetric(t *testing.T) {
t.Parallel()

if runtime.GOOS == "windows" {
t.Skip("timeouts on windows")
}
var (
samples = make(chan k6metrics.SampleContainer)
browser = newTestBrowser(t, withFileServer(), withSamples(samples))
Expand Down

0 comments on commit d149740

Please sign in to comment.