Skip to content

Commit

Permalink
Add details about code check to testing doc
Browse files Browse the repository at this point in the history
Introduce section to explain the new Makefile targets.
  • Loading branch information
HeavyWombat committed Jan 21, 2021
1 parent 4bc04b2 commit 23f5763
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docs/development/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ This allow us to use test doubles in the unit tests, from where we can instantia

Counterfeiter is required by the code generator scripts. Run `make install-counterfeiter` to add counterfeiter to your `GOPATH`.

### Static code analysis and linting

Run `make sanity-check` to run a collection of static code analyser and linters to check the code for issues, for example ineffective assignments, unused variables, missing comments, misspellings and so on. Each check also has an individual Make target to check:

- `make govet` examines Go source code and reports suspicious constructs
- `make ineffassign` checks Go source for variable assignments that are not used (i.e. overridden)
- `make golint` runs a linter against the Go source
- `make misspell` checks for TYPOs
- `make staticcheck` performs more complex static code analysis to find unused code and other issues

## Unit Tests

We use unit tests to provide coverage and ensure that our functions are behaving as expected, but also to assert the behaviour of the controllers during Reconciliations.
Expand Down Expand Up @@ -208,4 +218,3 @@ make test-e2e \
TEST_PRIVATE_GITLAB="[email protected]:<youruser>/<your-repo>.git" \
TEST_SOURCE_SECRET="<secret-name>"
```

0 comments on commit 23f5763

Please sign in to comment.