Skip to content

Commit

Permalink
docs(readme): add section about tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MR2011 authored Jul 25, 2024
1 parent df94ac6 commit 2db7c6c
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,46 @@ Alternatively, the application can be started by using the provided Makefile:
make start-all-heureka
```

### Tests

Heureka uses [Ginkgo](https://onsi.github.io/ginkgo/) for behavior-driven development (BDD) style tests. In the current project setup, tests are organized into three different directories, each serving a specific purpose:

- End-to-End Tests: These tests are located in the ./internal/e2e directory. End-to-end tests are designed to test the flow of an application from start to finish and ensure all integrated pieces of an application function as expected together.

- Application Layer Tests: These tests resides in the ./internal/app directory. Application layer tests focus on testing the application's behavior, such as handling requests and responses, executing appropriate logic, and more.

- Database Tests: These tests are found in the ./internal/database/db directory. Database tests ensure that the application correctly interacts with the database. They test database queries, updates, deletions, and other related operations.

If `LOCAL_TEST_DB` is set to `true` in `.test.env`, the tests will interact with a local database; otherwise, they will run against a containerized database.

Run all tests:
```
ginkgo -r
```

Run end-to-end tests:
```
ginkgo ./internal/e2e
```

Run application tests:
```
ginkgo ./internal/app
```

Run database tests:
```
ginkgo ./internal/database/mariadb
```

The ginkgo `-focus` allows using a regular expression to run a specific test:
```
ginkgo -focus="Getting Services" ./internal/database/mariadb
```
If the test block you're trying to run depends on `BeforeEach`, `JustBeforeEach`, or `Describe` blocks that aren't being run when you use the `-focus` flag, this could cause the test to fail.



## Support, Feedback, Contributing

This project is open to feature requests/suggestions, bug reports etc. via [GitHub issues](https://github.com/SAP/<your-project>/issues). Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](CONTRIBUTING.md).
Expand Down

0 comments on commit 2db7c6c

Please sign in to comment.