Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-05-09 08:29:30 +0300
committerStan Hu <stanhu@gmail.com>2018-05-10 00:33:42 +0300
commit204af2e1019e661fddc451ad0cfb982453d4085b (patch)
tree3b6484d2eba16771b96a41f8f2e994678f278ecb /doc/development/testing_guide/best_practices.md
parent5b0e96d09a7b6309384ef4c300c56872adba0626 (diff)
Support resetting of Prometheus metrics between test runs
Adding the :prometheus tag to an rspec test will clear out memory-mapped files and reset the registry. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/39968
Diffstat (limited to 'doc/development/testing_guide/best_practices.md')
-rw-r--r--doc/development/testing_guide/best_practices.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/development/testing_guide/best_practices.md b/doc/development/testing_guide/best_practices.md
index 7b32e0a47e1..61fa5459b91 100644
--- a/doc/development/testing_guide/best_practices.md
+++ b/doc/development/testing_guide/best_practices.md
@@ -230,6 +230,11 @@ describe "#==" do
end
```
+### Prometheus tests
+
+Prometheus metrics may be preserved from one test run to another. To ensure that metrics are
+reset before each example, add the `:prometheus` tag to the Rspec test.
+
### Matchers
Custom matchers should be created to clarify the intent and/or hide the