Skip to content

Commit

Permalink
CI and IT cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mswatosh committed Nov 16, 2023
1 parent 503e4e1 commit d5b33d5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/ci-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,24 @@ jobs:
java-version: 21
distribution: 'temurin'
cache: maven
- name: Compile App
run: mvn -B compiler:compile
- name: Compile Tests
run: mvn -B compiler:testCompile
- name: Create Server
run: mvn -B liberty:create
- name: Deploy App
run: mvn -B liberty:deploy
- name: Compile App and Tests
run: |
mvn -B compiler:compile
mvn -B compiler:testCompile
- name: Create Server and Deploy App
run: |
mvn -B liberty:create
mvn -B liberty:deploy
- name: Start Server
run: mvn -B liberty:test-start
run: mvn -B liberty:start
- name: Run Integration Tests
run: mvn -B failsafe:integration-test
- name: Stop Server
run: mvn -B liberty:test-stop
run: mvn -B liberty:stop
- name: Verify Integration Test Results
run: mvn -B failsafe:verify
- name: Archive Liberty logs
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: liberty-logs
Expand Down
9 changes: 4 additions & 5 deletions src/test/java/io/openliberty/sample/it/CrewServiceIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ public class CrewServiceIT {
private Response response;

@BeforeAll
public static void init() {

public static void init() {
String port = System.getProperty("http.port");
baseURL = "http://localhost:" + port + "/";
}
Expand All @@ -56,6 +55,7 @@ public void setup() {

@AfterEach
public void teardown() {
response.close();
client.close();
}

Expand All @@ -69,7 +69,7 @@ public void testAddGetDeleteCrewMember() {

//Check Add
response = client.target(baseURL + "db/crew/it").request().post(Entity.json("{\"name\":\"Mark\",\"rank\":\"Captain\",\"crewID\":\"75\"}"));
assertEquals(200, response.getStatus());
assertEquals(200, response.getStatus(), "output: " + response.readEntity(String.class));

//Check Get
response = client.target(baseURL + "db/crew").request().get();
Expand All @@ -84,7 +84,7 @@ public void testAddGetDeleteCrewMember() {

//Check Delete
response = client.target(baseURL + "db/crew/75").request().delete();
assertEquals(200, response.getStatus());
assertEquals(200, response.getStatus(), "output: " + response.readEntity(String.class));

//Confirm Delete
response = client.target(baseURL + "db/crew").request().get();
Expand Down Expand Up @@ -131,7 +131,6 @@ public void testValidationCrewMember() {

private boolean isPostgresAvailable() {
return checkHostAndPort("localhost", 5432);
// || checkHostAndPort("otherHost", 5432);
}

private boolean checkHostAndPort(String host, int port) {
Expand Down

0 comments on commit d5b33d5

Please sign in to comment.