nickva commented on code in PR #4474:
URL: https://github.com/apache/couchdb/pull/4474#discussion_r1135722344


##########
src/couch_prometheus/src/couch_prometheus_util.erl:
##########
@@ -167,3 +167,75 @@ val(Data) ->
 val(Key, Stats) ->
     {Key, Data} = lists:keyfind(Key, 1, Stats),
     val(Data).
+
+-ifdef(TEST).
+-include_lib("couch/include/couch_eunit.hrl").
+
+to_prom_test_() ->
+    [
+        ?_assertEqual(
+            <<"couchdb_ddoc_cache 10">>,
+            test_to_prom_output(ddoc_cache, counter, 10)
+        ),
+        ?_assertEqual(

Review Comment:
   I don't think there is a reason to use generators at all here. So all test 
functions would end in `_test(...)` and assert macros would be `?assert...()` 
with not underscores in front.
   
   The tests would then look something like this: 
https://gist.github.com/nickva/2258cd2b71ff0ff2577448f1445eba9d
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to