Skip to content

Conversation

@kinyoklion
Copy link
Member

Works around: eproxus/meck#248

@kinyoklion kinyoklion requested a review from a team as a code owner October 18, 2024 21:27
@kinyoklion kinyoklion marked this pull request as draft October 18, 2024 21:30
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"}}}
Copy link
Member Author

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.

@kinyoklion kinyoklion changed the title chore: Remove cover option to temporarily fix meck. chore: Fix tests builds with meck incompatibilities. Oct 18, 2024
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\
Copy link
Member Author

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'}
Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member Author

@kinyoklion kinyoklion Oct 18, 2024

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
Copy link
Member Author

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.

@kinyoklion kinyoklion marked this pull request as ready for review October 18, 2024 22:43
@kinyoklion kinyoklion changed the title chore: Fix tests builds with meck incompatibilities. chore: Fix test builds with meck incompatibilities. Oct 21, 2024
@kinyoklion kinyoklion merged commit f487151 into main Oct 21, 2024
5 checks passed
@kinyoklion kinyoklion deleted the rlamb/meck-cover branch October 21, 2024 20:26
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

Successfully merging this pull request may close these issues.

3 participants