Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Mizu
Commits
0840642c
Unverified
Commit
0840642c
authored
3 years ago
by
RoyUP9
Committed by
GitHub
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
testing guidelines (#276)
parent
d5b01347
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.github/TESTING.md
+33
-0
.github/TESTING.md
TESTING.md
+0
-15
TESTING.md
with
33 additions
and
15 deletions
+33
-15
.github/TESTING.md
0 → 100644
+
33
-
0
View file @
0840642c

# Testing guidelines
## Generic guidelines
*
Use "
[
testing
](
https://pkg.go.dev/testing
)
" package
*
Write
[
Table-driven tests using subtests
](
https://go.dev/blog/subtests
)
*
Use cleanup in test/subtest in order to clean up resources
*
Name the test func "Test
<tested_func_name><tested_case>
"
## Unit tests
*
Position the test file inside the folder of the tested package
*
In case of internal func testing
*
Name the test file "
<tested_file_name>
_internal_
test.go"
*
Name the test package same as the package being tested
*
Example -
[
Config
](
../cli/config/config_internal_test.go
)
*
In case of exported func testing
*
Name the test file "
<tested_file_name>
_test.go"
*
Name the test package "
<tested_package>
_test"
*
Example -
[
Slice Utils
](
../cli/mizu/sliceUtils_test.go
)
*
Make sure to run test coverage to make sure you covered all the cases and lines in the func
## Acceptance tests
*
Position the test file inside the
[
acceptance tests folder
](
../acceptanceTests
)
*
Name the file "
<tested_command>
_test.go"
*
Name the package "acceptanceTests"
*
Do not run as part of the short tests
*
Use/Create generic test utils func in acceptanceTests/testsUtils
*
Don't use sleep inside the tests - active check
*
Running acceptance tests locally
*
Switch to the branch that is being tested
*
Run acceptanceTests/setup.sh
*
Run tests (make acceptance-test)
*
Example -
[
Tap
](
../acceptanceTests/tap_test.go
)
This diff is collapsed.
Click to expand it.
TESTING.md
deleted
100644 → 0
+
0
-
15
View file @
d5b01347

# TESTING
Testing guidelines for Mizu project
## Unit-tests
*
TBD
*
TBD
*
TBD
## System tests
*
TBD
*
TBD
*
TBD
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help