Skip to content

Commit

Permalink
chore(makefile): add targets for generation and testing (#88)
Browse files Browse the repository at this point in the history
* chore(makefile): add targets for generation and testing

* docs(mockery): added mockery section to readme

* chore(makefile): add fmt

---------

Co-authored-by: David Rochow <[email protected]>
  • Loading branch information
MR2011 and drochow authored Jul 31, 2024
1 parent b93a562 commit 7c0d9e9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
23 changes: 22 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ VERSION ?= $(shell git log -1 --pretty=format:"%H")
OS := $(shell go env GOOS)
ARCH := $(shell go env GOARCH)

.PHONY: all test doc
.PHONY: all test doc gqlgen test-all test-e2e test-app test-db

# Source the .env file to use the env vars with make
-include .env
Expand Down Expand Up @@ -47,3 +47,24 @@ push:

run:
go run cmd/heureka/main.go

gqlgen:
cd internal/api/graphql && go run github.com/99designs/gqlgen generate

mockery:
mockery

test-all:
ginkgo -r

test-e2e:
ginkgo internal/e2e

test-app:
ginkgo internal/app

test-db:
ginkgo internal/database/mariadb

fmt:
go fmt ./...
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ make start-all-heureka

### Tests

#### Mockery

Heureka uses [Mockery](https://vektra.github.io/mockery/) for building Mocks based on defined interfaces for the purpose of Unit-Testing.

Please [follow the steps to install mockery on your local system](https://vektra.github.io/mockery/latest/installation/) to be able to build mocks.

#### Using Ginkgo

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.
Expand Down Expand Up @@ -136,8 +144,6 @@ 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 7c0d9e9

Please sign in to comment.