Skip to content

Commit

Permalink
Adding integration tests for endorsement service (#107)
Browse files Browse the repository at this point in the history
* Added integration tests for endorsement service

* Added test suite for integration tests

* testing separation of unit and integration ci and pomxml

* Addressed review comments and added build step in CI

* Fix API contract and added pagination assertions to integration tests

* Fixing typos and addressing review comments

* Addressed review comments

* Addressed review comments

* Addressed review comments

---------

Co-authored-by: akhil <[email protected]>
  • Loading branch information
Chethan64 and akhilkh2000 authored Apr 21, 2024
1 parent 51ba2c6 commit e9ea68d
Show file tree
Hide file tree
Showing 8 changed files with 566 additions and 332 deletions.
38 changes: 34 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,37 @@ on:
- "**"
jobs:
build:
name: Maven Build
name: Maven Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Java 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: "temurin"

- name: Build with Maven
run: mvn verify --file skill-tree/pom.xml -Pgit-build-profile -Dskip-tests=true

unit-test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Java 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: "temurin"

- name: Unit Test
run: mvn test --file skill-tree/pom.xml

integration-test:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -15,7 +45,7 @@ jobs:
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
distribution: "temurin"

- name: Build with Maven
run: mvn verify --file skill-tree/pom.xml -Pgit-build-profile
- name: Integration Test
run: mvn verify --file skill-tree/pom.xml -Dskip-ut=true
2 changes: 1 addition & 1 deletion api-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ paths:
content:
application/json:
schema:
type: array
type: object
items:
$ref: '#/components/schemas/DummyEndorsementResponse'

Expand Down
35 changes: 35 additions & 0 deletions skill-tree/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,41 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>

<configuration>
<skip>${skip-ut}</skip>
<skip>${skip-tests}</skip>
<includes>
<include>**/unit/*.java</include>
</includes>

</configuration>

</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<skip>${skip-tests}</skip>
<includes>
<include>**/integration/*.java</include>
</includes>

</configuration>

<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>

Expand Down
Loading

0 comments on commit e9ea68d

Please sign in to comment.