Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yigitsadic/listele

Sample project for multi-layer testing using interfaces, unit tests and dockertest.
https://github.com/yigitsadic/listele

Last synced: about 1 month ago
JSON representation

Sample project for multi-layer testing using interfaces, unit tests and dockertest.

Awesome Lists containing this project

README

        

# What is this?

> I have mentioned this repository at my blog [post](https://yigitsadic.github.io/2021/09/18/dockertest-example-project.html).

This is an example project to implement unit-tests, interfaces, database integration tests with docker.

Application serves records found on `people` table as JSON list.

To run `docker-compose up`

`curl http://localhost:3035 | jq`

```json
[
{
"full_name": "John Doe"
},
{
"full_name": "Aida Bugg"
},
{
"full_name": "Maureen Biologist"
},
{
"full_name": "Allie Grater"
}
]
```

Run tests:

```
go test ./...
```

Run tests with database integration tests:

```
RUN_INTEGRATION_TESTS=YES go test ./...
```