Skip to content

Commit

Permalink
Fix compatibility with OTP 26
Browse files Browse the repository at this point in the history
  • Loading branch information
cabol committed May 25, 2024
1 parent 82560f5 commit 4ef2fbc
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,36 @@ jobs:
fail-fast: false
matrix:
include:
- otp: '25.x'
- otp: '26.x'
os: 'ubuntu-latest'
rebar3_version: "3.23.0"
coverage: true
xref: true
dialyzer: true
- otp: '25.x'
os: 'ubuntu-latest'
rebar3_version: "3.23.0"
- otp: '24.x'
os: 'ubuntu-latest'
rebar3_version: "3.23.0"
- otp: '23.x'
os: 'ubuntu-20.04'
rebar3_version: "3.20.0"

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OTP_VERSION: ${{ matrix.otp }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install OTP and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
rebar3-version: ${{ matrix.rebar3_version }}
version-type: loose

- name: Cache deps
uses: actions/cache@v3
Expand Down Expand Up @@ -82,7 +91,7 @@ jobs:
if: ${{ matrix.dialyzer && steps.plt-cache.outputs.cache-hit != 'true' }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: _build/test/covertool/shards.covertool.xml
flags: otp-${{ matrix.otp }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ doc
docs
/priv/plts
/bench
rebar3
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
erlang 26.2
10 changes: 10 additions & 0 deletions src/shards.erl
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,15 @@ maybe_register(Name, Pid, Options) ->
ok
end.

-ifndef(OTP_RELEASE).
%% OTP 20 or lower.
-define(OTP_RELEASE, 20).
-endif.

-if(?OTP_RELEASE >= 26).
%% @private
wrap_exit() -> ok.
-else.
%% @private
wrap_exit() ->
% We wait for the 'EXIT' signal from the partition supervisor knowing
Expand All @@ -978,6 +987,7 @@ wrap_exit() ->
receive
{'EXIT', _Pid, _Reason} -> ok
end.
-endif.

%% @equiv next(Tab, Key1, shards_meta:get(Tab))
next(Tab, Key1) ->
Expand Down
15 changes: 0 additions & 15 deletions test/shards_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,6 @@
t_table_creation_errors/1
]).

% %% Test Cases Helpers
% -export([
% t_basic_ops_/1,
% t_match_ops_/1,
% t_select_ops_/1
% ]).

% %% Helpers
% -export([
% init_shards/0,
% init_shards/1,
% cleanup_shards/0,
% delete_shards/0
% ]).

-define(EXCLUDED_FUNS, [
module_info,
all,
Expand Down

0 comments on commit 4ef2fbc

Please sign in to comment.