Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write small section README.md for contributors #123

Open
tobyhinloopen opened this issue Nov 11, 2017 · 3 comments
Open

Write small section README.md for contributors #123

tobyhinloopen opened this issue Nov 11, 2017 · 3 comments

Comments

@tobyhinloopen
Copy link
Contributor

tobyhinloopen commented Nov 11, 2017

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
@tobyhinloopen tobyhinloopen added this to the 0.11.0 milestone Nov 11, 2017
@anthonator
Copy link
Collaborator

I'm asking this more out of curiosity, but why use Faker for randomness instead of Elixir/Erlang. I typically use Enum.random/1.

@igas
Copy link
Member

igas commented Mar 19, 2018

@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.

@igas igas removed this from the 0.11.0 milestone Oct 4, 2018
@pmontrasio
Copy link
Contributor

pmontrasio commented Nov 13, 2018

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants