Skip to content

Commit

Permalink
ci: make install
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <[email protected]>
  • Loading branch information
manusa authored Nov 15, 2024
1 parent 0bb40d3 commit 72df49e
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/javadocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ jobs:
java-version: '11'
distribution: 'temurin'
- name: Check Java Docs
run: make javadoc
run: make javadoc MAVEN_ARGS="${MAVEN_ARGS}"
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 12 additions & 1 deletion java-generator/it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@
<name>Fabric8 :: Java generator :: Integration Tests</name>

<dependencies>
<!-- Force installation before running the ITs -->
<dependency>
<groupId>io.fabric8.java-generator</groupId>
<artifactId>io.fabric8.java-generator.gradle.plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>java-generator-maven-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<!-- // -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
Expand Down Expand Up @@ -82,7 +94,6 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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))
Expand All @@ -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"
Expand All @@ -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))
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ class MockWebServerWebSocketTest extends Specification {
server.enqueue(new MockResponse().withWebSocketUpgrade(new WebSocketListener() {
@Override
void onOpen(WebSocket webSocket, Response response) {
Thread.sleep(100L)
webSocket.close(1000, "Normal closure")
}
}))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public void handle(HttpExchange exchange) {

public final void await() {
try {
barrier.await(1, TimeUnit.SECONDS);
barrier.await(5, TimeUnit.SECONDS);
} catch (Exception ex) {
throw new RuntimeException("Failed to await the barrier");
}
Expand Down

0 comments on commit 72df49e

Please sign in to comment.