From 2fa476c7dd325d339be3d0d06fe4069a04aea5e2 Mon Sep 17 00:00:00 2001 From: Marc Nuri Date: Fri, 15 Nov 2024 06:04:24 +0100 Subject: [PATCH] ci: make install Signed-off-by: Marc Nuri --- .github/workflows/build.yml | 2 +- .github/workflows/javadocs.yml | 2 +- Makefile | 6 +++++- .../DefaultMockServerWebSocketTest.groovy | 14 ++++++++++---- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17b07950b9b..d53ab0bac61 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,7 +54,7 @@ jobs: java-version: ${{ matrix.java }} distribution: 'temurin' - name: Build Project - run: ./mvnw ${MAVEN_ARGS} clean install + run: make install MAVEN_ARGS="${MAVEN_ARGS}" - name: Check java-generator CLI run: | diff --git a/.github/workflows/javadocs.yml b/.github/workflows/javadocs.yml index 4349d499140..14bad1f5d90 100644 --- a/.github/workflows/javadocs.yml +++ b/.github/workflows/javadocs.yml @@ -50,4 +50,4 @@ jobs: java-version: '11' distribution: 'temurin' - name: Check Java Docs - run: make javadoc + run: make javadoc MAVEN_ARGS="${MAVEN_ARGS}" diff --git a/Makefile b/Makefile index 9f0c436719c..ce23d5c8d4b 100644 --- a/Makefile +++ b/Makefile @@ -80,6 +80,10 @@ format-java: .PHONY: format format: format-license format-java -.PHONY: +.PHONY: quickly quickly: clean mvn $(MAVEN_ARGS) install -DskipTests -Djacoco.skip=true + +.PHONY: install +install: clean + mvn $(MAVEN_ARGS) install diff --git a/junit/mockwebserver/src/test/groovy/io/fabric8/mockwebserver/DefaultMockServerWebSocketTest.groovy b/junit/mockwebserver/src/test/groovy/io/fabric8/mockwebserver/DefaultMockServerWebSocketTest.groovy index 63257f329ea..c305dae9943 100644 --- a/junit/mockwebserver/src/test/groovy/io/fabric8/mockwebserver/DefaultMockServerWebSocketTest.groovy +++ b/junit/mockwebserver/src/test/groovy/io/fabric8/mockwebserver/DefaultMockServerWebSocketTest.groovy @@ -57,7 +57,7 @@ class DefaultMockServerWebSocketTest extends Specification { server.expect().withPath("/websocket") .andUpgradeToWebSocket() .open() - .waitFor(10L).andEmit("A text message from the server") + .waitFor(50L).andEmit("A text message from the server") .done() .always() and: @@ -98,6 +98,8 @@ class DefaultMockServerWebSocketTest extends Specification { when: "The request is sent and completed" conditions.eventually { assert wsReq.isComplete() + assert wsReq.result() != null + assert wsReq.result().closeReason() != null } then: "Expect the onClose reason" @@ -140,7 +142,7 @@ class DefaultMockServerWebSocketTest extends Specification { given: "A WebSocket expectation" server.expect() .withPath("/websocket") - .andUpgradeToWebSocket().open().waitFor(10L) + .andUpgradeToWebSocket().open().waitFor(50L) .andEmit("A text message from the server") .done().always() and: "A list to store the received messages" @@ -180,7 +182,7 @@ class DefaultMockServerWebSocketTest extends Specification { given: "A WebSocket expectation" server.expect() .withPath("/websocket") - .andUpgradeToWebSocket().open().waitFor(10L).andEmit("done").done().always() + .andUpgradeToWebSocket().open().waitFor(50L).andEmit("done").done().always() and: "An HTTP client" def httpClient = vertx.createHttpClient(new HttpClientOptions() .setProtocolVersion(HttpVersion.HTTP_1_1)) @@ -207,6 +209,8 @@ class DefaultMockServerWebSocketTest extends Specification { when: "The request is completed" conditions.eventually { assert request.isComplete() + assert request.result() != null + assert request.result().statusCode() > 0 } then: "Expect the response to contain a matching header" @@ -221,7 +225,7 @@ class DefaultMockServerWebSocketTest extends Specification { given: "A WebSocket expectation" server.expect() .withPath("/websocket") - .andUpgradeToWebSocket().open().waitFor(10L).andEmit("done").done().always() + .andUpgradeToWebSocket().open().waitFor(50L).andEmit("done").done().always() and: "An HTTP client" def httpClient = vertx.createHttpClient(new HttpClientOptions() .setProtocolVersion(HttpVersion.HTTP_1_1)) @@ -243,6 +247,8 @@ class DefaultMockServerWebSocketTest extends Specification { when: "The request is completed" conditions.eventually { assert request.isComplete() + assert request.result() != null + assert request.result().statusCode() > 0 } then: "Expect the response to have a client error status code"