-
Notifications
You must be signed in to change notification settings - Fork 39
chore: Fix test builds with meck incompatibilities. #135
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
Conversation
rebar.config
Outdated
| {bookish_spork, "0.3.5"}, | ||
| {cowboy, "2.8.0"}, | ||
| {meck, "0.9.2"} | ||
| {meck, { git, "[email protected]:eproxus/meck.git", {ref, "dfb47c544bdf14b5c26ff2651cf9339dbbe2f50e"}}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This SHA has some OTP/27 fixes.
Makefile
Outdated
| #This is used on CircleCI because the Redis Docker container is already started unlike the local tests command | ||
| ci-tests: | ||
| @$(REBAR3) ct --dir="test,test-redis" --logdir logs/ct | ||
| @if [ "$(ERL_VERSION)" -ge "25" ]; then\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here things get ugly. Need two different versions of meck to keep things working.
| fail-fast: false | ||
| matrix: | ||
| versions: | ||
| - {os: 'ubuntu-20.04', otp: '21.x', rebar: '3.15.2'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having to drop CI for 21.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should all still work, but a version of meck that works with 21 will not work with 27.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second problem. meck is really unhappy about mocking rand now. So I changed this to allow the randomization function to be injected.
| tests: | ||
| docker run --name ld-test-redis -p 6379:6379 -d redis | ||
| @$(REBAR3) ct --dir="test,test-redis" --logdir logs/ct --cover | ||
| @$(REBAR3) ct --dir="test,test-redis" --logdir logs/ct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First problem is that it doesn't work with the cover arguments in current OTP 27.
Works around: eproxus/meck#248