Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #106 from SELab-2/update-readme
Browse files Browse the repository at this point in the history
Update readme
  • Loading branch information
TomAlard authored Mar 21, 2022
2 parents f56be2f + 729479a commit b4bd6cd
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
23 changes: 23 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,26 @@ server.error.include-binding-errors=always
server.error.include-stacktrace=on_param
server.error.include-exception=false
```

## Running tests
When running integration tests, Spring needs to load the entire application. \
This means Spring will also need a database to connect to. \
For this ```/backend/src/test/resources/application.properties``` is used. \
These properties are setup as used by github actions, to run tests locally change \
```spring.datasource.url=jdbc:postgresql://postgres:5432/osoc```
to ```spring.datasource.url=jdbc:postgresql://localhost:5432/osoc``` \
Then simply run the test command in /backend to run all tests.
```
./mvnw test
```
An overview of test success or error per test class can be found in ```backend/target/surefire-reports```. \
A coverage report can be found in ```backend/target/site/jacoco```. \
The jacoco.xml file gives an overview by method, the html files can be used
to get a line based coverage report for every class in a human readable format. \
To remove old reports and force a rebuild you can run
```
./mvnw clean
```
#### Note on integration tests
Integration tests (using testcontainers) will not use /api in request paths.
They ignore ```server.servlet.context-path=/api```.
2 changes: 1 addition & 1 deletion backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<configuration>
<formats>XML</formats>
<formats>XML,HTML</formats>
</configuration>
<executions>
<execution>
Expand Down
16 changes: 15 additions & 1 deletion frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,18 @@ yarn build
Run the built app in production mode.
```sh
yarn start
```
```

## Running linters
While in /frontend run following commands to show style errors
```shell
yarn run eslint .
yarn run prettier --check .
```
Both linters can autofix errors using
```shell
yarn run eslint --fix .
yarn run prettier --write .
```
Linters will only check files in frontend/pages, frontend/public, frontend/styles and frontend/src.\
To add more locations update both frontend/.eslintignore and frontend/.prettierignore.

0 comments on commit b4bd6cd

Please sign in to comment.