File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed
docs/2_development/2_tech-stack Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ RustFMT
54
54
semver
55
55
Slackbot
56
56
subpackages
57
+ Subtests
57
58
TBD
58
59
TODO
59
60
unpatched
Original file line number Diff line number Diff line change @@ -335,3 +335,49 @@ jobs:
335
335
Make sure to pin the linter version (` version: v1.45`) since the same linters can behave differently from a version to another.
336
336
:: :
337
337
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
You can’t perform that action at this time.
0 commit comments