Closed mjfh closed 2 years ago
the error in the test indicates that there are too many globals - the better fix would be to reduce the overall count of globals by moving them into test
- this also makes for better tests that are more independent - in particular, it seems that the new collections are producing many globals
Could you please explain or give an example? As far as I understand, the latest addition has not many globals. So it was just the literal straw that broke the camel's neck.
3 things should be done:
test
runs in a separate proc
, thus not creating globals) - this can be done for all tests in hereconst
, not a let
test
or setup
, else it creates a globalok, I see.
I guess unittest2 was avoided in order to reduce the imported packages? Otherwise i would prefer to use unittest2 and wrap in the main function wrapper.
I'm guessing it hasn't been needed until now - @zah started using it in https://github.com/status-im/nim-stew/pull/122 (stew predates unittest2) - when migrating, it's best to do all unittests in one go so as to avoid issues - it's mostly doable with a search/replace of the import
Well, then I prefer to do it now. I see that is the most clean solution.
It is widely used in nim-eth
though there are pockets using testutils/unittest
.
.. or tomorrow morning :)
superseded by #125
Running some unit tests in a separate file attempts to mitigate the global symbols overflow on Github ci when compiling with nim version <= 1.2.