Skip to content

Commit cdc35eb

Browse files
committed
wip
1 parent da8d874 commit cdc35eb

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

dictionary.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ RustFMT
5454
semver
5555
Slackbot
5656
subpackages
57+
Subtests
5758
TBD
5859
TODO
5960
unpatched

docs/2_development/2_tech-stack/go.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,3 +335,49 @@ jobs:
335335
Make sure to pin the linter version (`version: v1.45`) since the same linters can behave differently from a version to another.
336336
:::
337337

338+
339+
## Testing
340+
341+
### Testing philosophy
342+
343+
Here are a few key points to remember when writing tests:
344+
345+
- your **production code must be testable**. Adjust it as needed.
346+
- all your **tests must be event driven** and not time driven
347+
- your **unit tests must be blazing fast**
348+
- **never export testing code** across package boundaries
349+
- run your unit and integration tests in **parallel**
350+
- have a **good testing depth**: you need to assert enough affected elements
351+
- **keep your tests dumb** and feel free to repeat code
352+
353+
### Libraries to use
354+
355+
- [github.com/stretchr/testify](https://github.com/stretchr/testify) for assertions
356+
- [github.com/golang/gomock](https://github.com/golang/gomock) for mocking (see the [Mocking](#Mocking) section)
357+
358+
### `assert.*` vs `require.*`
359+
360+
361+
### Asserting errors
362+
363+
- `assert.ErrorIs` + `assert.EqualError`
364+
365+
366+
### 'Table' tests
367+
368+
### Subtests
369+
370+
### Parallel tests
371+
372+
- Network servers, listen on port `:0`.
373+
- Race detector
374+
375+
### Unit tests
376+
377+
### Integration tests
378+
379+
### End to end tests
380+
381+
### Fuzz tests
382+
383+
### Continuous integration

0 commit comments

Comments
 (0)