Write small section README.md for contributors
Write a small section in README.md for contributors mentioning things like:
- Use
Faker.*/*functions as a source for randomness, instead of using Elixir/Erlang random functions. - conventions about locales & countries, writing tests, docs & examples
- adding dependencies
I'm asking this more out of curiosity, but why use Faker for randomness instead of Elixir/Erlang. I typically use Enum.random/1.
@anthonator we still use elixir random, it's just to be more extensible wrapped, so you can use old versions or new. You can also write your own implementation to use predictable order (I have plans to do it in faker test suite itself). Hope it makes sense.
I'm adding some Italian modules, most of my examples are failing and by reading the code I eventually found this issue.
I found the code of the sampler macro and saw that it uses Faker.random_between/2. It seems that it should set a fixed seed, but if I set my examples with the values that are making them fail, they fail again on the next run because they get a different value. It seems that the seeding is not set.
If I disable seeding with mix test --seed 0 test/faker/name_test.exs and set the values according to the errors, the errors go away.
The tests for English, Spanish and Portuguese always pass.
I think there is something else to configure for the new code I'm writing, but what? Thanks.
Edit: after running all the tests with mix test --seed 0 I run them again with only mix test and they passed. They use a different seed everytime but they work. Did I set a permanent seed somewhere on disk which overrides the per test one? (I really don't know anything about :ets).