Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
0ec94ef
chore: testing runner on docker, cbox dependency
yamilmedina Dec 15, 2023
531d46a
chore: testing runner on docker, exporting results
yamilmedina Dec 15, 2023
20d0372
chore: testing runner on docker, exporting results
yamilmedina Dec 18, 2023
f1c2b88
chore: testing runner on docker, exporting results
yamilmedina Dec 18, 2023
5e709d1
chore: testing runner on docker, working state
yamilmedina Dec 18, 2023
db59383
chore: testing runner on docker, working in ci
yamilmedina Dec 18, 2023
9aa313e
chore: testing runner on docker, working in ci
yamilmedina Dec 18, 2023
9f5f2b7
chore: testing runner on docker, working in ci
yamilmedina Dec 18, 2023
a83109c
chore: testing runner on docker, working in ci
yamilmedina Dec 18, 2023
f08d403
chore: testing runner on docker, working in ci
yamilmedina Dec 18, 2023
9f35330
chore: testing runner on docker, working in ci
yamilmedina Dec 18, 2023
8aea590
chore: testing runner on docker, working in ci
yamilmedina Dec 18, 2023
f0a88c3
chore: testing runner on docker, working in ci
yamilmedina Dec 18, 2023
1a12ff2
chore: testing runner on docker, working in ci
yamilmedina Dec 18, 2023
bcebe6e
chore: testing runner on docker, working in ci, testing failed test
yamilmedina Dec 18, 2023
9550cf5
chore: testing runner on docker, working in ci
yamilmedina Dec 18, 2023
5d777ec
chore: testing runner on docker, ci adj
yamilmedina Dec 18, 2023
e4e58fc
chore: testing runner on docker, ci adj
yamilmedina Dec 18, 2023
eb73824
chore: testing runner on docker, ci adj
yamilmedina Dec 18, 2023
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ roman.iml
frontend/node_modules
frontend/build
*.iml
!backend/target/surefire-reports
!backend/target/test.result
16 changes: 11 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
name: CI

on:
push:
branches-ignore:
- master
- staging

pull_request:
types: [ opened, synchronize ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -24,6 +20,16 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Run tests
run: make docker-run-tests

- name: Publish test report
uses: EnricoMi/publish-unit-test-result-action/composite@v2.7
if: always()
with:
files: |
backend/target/reports/TEST-*.xml

- name: Build image
id: docker_build
uses: docker/build-push-action@v2
Expand Down
12 changes: 12 additions & 0 deletions Dockerfile.UnitTests
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM --platform=linux/x86_64 wirebot/cryptobox:1.4.0 AS test-stage
WORKDIR /app

COPY . ./
WORKDIR /app/backend

# in case of error, write test output status code to /tmp/test.result and exit with 0 for later stages checks.
RUN echo "0" > /tmp/test.result
RUN ./mvnw test -Dmaven.test.skip=false 2>&1 || echo $? > /tmp/test.result || echo "Tests failed"

FROM scratch AS export-stage
COPY --from=test-stage /app/backend/target/surefire-reports/TEST-*.xml /tmp/test.result /
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
docker-run-tests:
./test.sh

db:
docker-compose up -d db

Expand Down
26 changes: 20 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ The best way how to run Roman is to use Docker, another option is to run the Rom
- In order to actually being able to connect to the Wire backend, Roman's endpoints needs to run on HTTPS.
- You need a PostgreSQL instance with an empty database and credentials.
- In order to run it as a Docker container, you need to have Docker installed.
- In order to run it natively on JVM, you need to have JVM 11 installed + all necessary libraries
- In order to run it natively on JVM, you need to have JVM 17 installed + all necessary libraries
for [Cryptobox4j](https://github.com/wireapp/cryptobox4j).

### Configuration
Expand Down Expand Up @@ -455,7 +455,7 @@ env variables. See [Configuration section](#configuration) how to obtain them.

As previously mentioned, Wire recommends running the Roman as a docker container. However, you can run it natively on
the JVM as well.
Please note that Roman requires JVM >= 11. To run it natively, one needs to
Please note that Roman requires JVM >= 17. To run it natively, one needs to
install [Cryptobox4j](https://github.com/wireapp/cryptobox4j)
and other cryptographic libraries. You can use
[Docker Build Image](https://github.com/wireapp/cryptobox4j/blob/master/dockerfiles/Dockerfile.cryptobox)
Expand All @@ -464,17 +464,17 @@ as an inspiration what needs to be installed and what environment variables need
Also, don't forget to read the [Configuration section](#configuration) and set all necessary environment variables for
the Roman itselgf.

First, it is necessary to build the application:
First, it is necessary to build the application under `backend` directory:

```bash
# Maven and JVM 11 is required
mvn package -DskipTests
# Maven and JVM 17 is required
./mvnw package -DskipTests
```

Then to run it like that:

```bash
# JVM 11 required
# JVM 17 required
java -jar target/roman.jar server roman.yaml
```

Expand Down Expand Up @@ -557,6 +557,20 @@ docker-compose -f docker-compose.prod.yml --env-file .env.prod up -d

10. All set! You can go to `https://roman.example.com/swagger` and start using Roman.

## Running Roman tests suite

Tests run with the help of docker containers to setup all requirements.
To run the test suite just run:

```bash
make docker-run-tests
```

or directly:
```bash
./test.sh
```

## Comprehensive tutorial how to onboard new bot

Step-by-step guide, how to create a simple bot for Roman - [onboarding.md](docs/onboarding.md).
2 changes: 2 additions & 0 deletions backend/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
Loading