Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 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
18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ env:
PW_MAX_RETRIES: 3
jobs:
dev:
timeout-minutes: 30
timeout-minutes: 60
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's do it only for channels that we know are slow?

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
browser: [chromium, firefox, webkit]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK 1.8
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 8
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
java -jar target/test-spring-boot*.jar

stable:
timeout-minutes: 30
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
Expand All @@ -65,13 +65,13 @@ jobs:
browser-channel: msedge
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Media Pack
if: matrix.os == 'windows-latest'
shell: powershell
run: Install-WindowsFeature Server-Media-Foundation
- name: Set up JDK 1.8
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 8
Expand All @@ -93,16 +93,16 @@ jobs:
BROWSER_CHANNEL: ${{ matrix.browser-channel }}

Java_21:
timeout-minutes: 30
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 21
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Cache Maven packages
uses: actions/cache@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Download drivers
run: scripts/download_driver.sh
- name: Regenerate APIs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ private void installBrowsers(Map<String, String> env) throws IOException, Interr
}
ProcessBuilder pb = createProcessBuilder();
pb.command().add("install");
pb.redirectError(ProcessBuilder.Redirect.INHERIT);
pb.redirectOutput(ProcessBuilder.Redirect.INHERIT);
if (System.getenv("PW_JAVA_INTERNAL_SILENT_INSTALL") != null) {
pb.redirectError(ProcessBuilder.Redirect.INHERIT);
pb.redirectOutput(ProcessBuilder.Redirect.INHERIT);
}
Process p = pb.start();
boolean result = p.waitFor(10, TimeUnit.MINUTES);
if (!result) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ void shouldThrowWhenBrowserPathIsInvalid(@TempDir Path tmpDir) throws NoSuchFiel
// Make sure the browsers are not installed yet by pointing at an empty dir.
env.put("PLAYWRIGHT_BROWSERS_PATH", tmpDir.toString());
env.put("PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD", "false");
env.put("PW_JAVA_INTERNAL_SILENT_INSTALL", "true");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's not do it for now. If we do it, let's make it a public option?


RuntimeException exception = assertThrows(RuntimeException.class, () -> Driver.createAndInstall(env, true));
String message = exception.getMessage();
Expand Down
4 changes: 4 additions & 0 deletions playwright/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
</dependency>
<dependency>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let's remove?

<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public void handle(HttpExchange exchange) throws IOException {
}
long contentLength = body.size();
// -1 means no body, 0 means chunked encoding.
exchange.sendResponseHeaders(200, contentLength == 0 ? -1 : contentLength);
exchange.sendResponseHeaders(200, (contentLength == 0 || exchange.getRequestMethod().equals("HEAD")) ? -1 : contentLength);
if (contentLength > 0) {
exchange.getResponseBody().write(body.toByteArray());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ static boolean isChromiumHeadedLike() {
@Test
@DisabledIf(value="isChromiumHeadedLike", disabledReason="fail")
void shouldFailWithoutCredentials() {
System.out.println("channel2 " + getBrowserChannelFromEnv());
server.setAuth("/empty.html", "user", "pass");
Response response = page.navigate(server.EMPTY_PAGE);
assertEquals(401, response.status());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ void shouldReturnBodyForFailingRequests() {
for (String method : new String[] {"head", "put", "trace"}) {
server.setRoute("/empty.html", exchange -> {
exchange.getResponseHeaders().set("Content-type", "text/plain");
exchange.sendResponseHeaders(404, 10);
exchange.sendResponseHeaders(404, exchange.getRequestMethod().equals("HEAD") ? -1 : 10);
try (Writer writer = new OutputStreamWriter(exchange.getResponseBody())) {
writer.write("Not found.");
}
Expand Down
9 changes: 8 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<junit.version>5.12.0</junit.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<websocket.version>1.6.0</websocket.version>
<slf4j.version>2.0.17</slf4j.version>
<opentest4j.version>1.3.0</opentest4j.version>
</properties>

Expand Down Expand Up @@ -91,6 +92,12 @@
<version>${websocket.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's add comment that it's just for websocket to stop polluting the output with warnings.

<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
Expand Down Expand Up @@ -151,7 +158,7 @@
<configuration>
<properties>
<configurationParameters>
junit.jupiter.execution.parallel.enabled = true
junit.jupiter.execution.parallel.enabled = false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

stray change?

junit.jupiter.execution.parallel.mode.default = same_thread
junit.jupiter.execution.parallel.mode.classes.default = concurrent
junit.jupiter.execution.parallel.config.strategy=dynamic
Expand Down