Skip to content

Commit

Permalink
Add OTP 26 to CI (#1465)
Browse files Browse the repository at this point in the history
Add OTP 26 to CI and update CT tests.
  • Loading branch information
plux authored Dec 21, 2023
1 parent 7801b22 commit 3b5ea3a
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
platform: [ubuntu-latest]
otp-version: [23, 24, 25]
otp-version: [23, 24, 25, 26]
runs-on: ${{ matrix.platform }}
container:
image: erlang:${{ matrix.otp-version }}
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Lint
run: rebar3 lint
- name: Generate Dialyzer PLT for usage in CT Tests
run: dialyzer --build_plt --apps erts kernel stdlib
run: dialyzer --build_plt --apps erts kernel stdlib compiler crypto
- name: Start epmd as daemon
run: epmd -daemon
- name: Run CT Tests
Expand Down
56 changes: 44 additions & 12 deletions apps/els_lsp/test/els_completion_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -634,18 +634,25 @@ exported_functions_arity(Config) ->
exported_types(Config) ->
TriggerKind = ?COMPLETION_TRIGGER_KIND_CHARACTER,
Uri = ?config(code_navigation_uri, Config),
Types = [
<<"date_time">>,
<<"fd">>,
<<"file_info">>,
<<"filename">>,
<<"filename_all">>,
<<"io_device">>,
<<"mode">>,
<<"name">>,
<<"name_all">>,
<<"posix">>
],

OtpRelease = list_to_integer(erlang:system_info(otp_release)),

Types =
[
<<"date_time">>,
<<"fd">>,
<<"file_info">>,
<<"filename">>,
<<"filename_all">>,
<<"io_device">>
] ++
[<<"location">> || OtpRelease >= 26] ++
[
<<"mode">>,
<<"name">>,
<<"name_all">>,
<<"posix">>
],
Expected = [
#{
insertText => <<T/binary, "()">>,
Expand Down Expand Up @@ -1675,8 +1682,33 @@ resolve_application_remote_otp(Config) ->
<<"write/2">>
),
#{result := Result} = els_client:completionitem_resolve(Selected),
OtpRelease = list_to_integer(erlang:system_info(otp_release)),
Value =
case has_eep48(file) of
true when OtpRelease >= 26 ->
<<
"```erlang\nwrite(IoDevice, Bytes) -> ok | {error, "
"Reason}\nwhen\n IoDevice :: io_device() | io:device(),\n"
" Bytes :: iodata(),"
"\n Reason :: posix() | badarg | terminated.\n```\n\n"
"---\n\n"
"Writes `Bytes` to the file referenced by `IoDevice`\\."
" This function is the only way to write to a file opened in"
" `raw` mode \\(although it works for normally opened files"
" too\\)\\. Returns `ok` if successful, and"
" `{error, Reason}` otherwise\\.\n\nIf the file is opened"
" with `encoding` set to something else than `latin1`,"
" each byte written can result in many bytes being written"
" to the file, as the byte range 0\\.\\.255 can represent"
" anything between one and four bytes depending on value"
" and UTF encoding type\\. If you want to write"
" [`unicode:chardata()`](https://erlang.org/doc/man/unicode"
".html#type-chardata) to the `IoDevice` you should use"
" [`io:put_chars/2`](https://erlang.org/doc/man/io.html"
"#put_chars-2) instead\\.\n\nTypical error reasons:\n\n"
"* **`ebadf`** \n The file is not opened for writing\\.\n\n"
"* **`enospc`** \n No space is left on the device\\.\n"
>>;
true ->
<<
"```erlang\nwrite(IoDevice, Bytes) -> ok | {error, "
Expand Down
29 changes: 27 additions & 2 deletions apps/els_lsp/test/els_hover_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,33 @@ remote_call_otp(Config) ->
#{result := Result} = els_client:hover(Uri, 26, 12),
?assert(maps:is_key(contents, Result)),
Contents = maps:get(contents, Result),
OtpRelease = list_to_integer(erlang:system_info(otp_release)),
Value =
case has_eep48(file) of
true when OtpRelease >= 26 ->
<<
"```erlang\nwrite(IoDevice, Bytes) -> ok | {error, "
"Reason}\nwhen\n IoDevice :: io_device() | io:device(),\n"
" Bytes :: iodata(),"
"\n Reason :: posix() | badarg | terminated.\n```\n\n"
"---\n\n"
"Writes `Bytes` to the file referenced by `IoDevice`\\."
" This function is the only way to write to a file opened in"
" `raw` mode \\(although it works for normally opened files"
" too\\)\\. Returns `ok` if successful, and"
" `{error, Reason}` otherwise\\.\n\nIf the file is opened"
" with `encoding` set to something else than `latin1`,"
" each byte written can result in many bytes being written"
" to the file, as the byte range 0\\.\\.255 can represent"
" anything between one and four bytes depending on value"
" and UTF encoding type\\. If you want to write"
" [`unicode:chardata()`](https://erlang.org/doc/man/unicode"
".html#type-chardata) to the `IoDevice` you should use"
" [`io:put_chars/2`](https://erlang.org/doc/man/io.html"
"#put_chars-2) instead\\.\n\nTypical error reasons:\n\n"
"* **`ebadf`** \n The file is not opened for writing\\.\n\n"
"* **`enospc`** \n No space is left on the device\\.\n"
>>;
true ->
<<
"```erlang\nwrite(IoDevice, Bytes) -> ok | {error, Reason}\n"
Expand Down Expand Up @@ -541,8 +566,8 @@ nonexisting_type(Config) ->
#{result := Result} = els_client:hover(Uri, 22, 15),
%% The spec for `j' is shown instead of the type docs.
Value =
case list_to_integer(erlang:system_info(otp_release)) of
25 ->
case list_to_integer(erlang:system_info(otp_release)) >= 25 of
true ->
<<
"```erlang\nj(_ :: doesnt:exist()) -> ok.\n```\n\n"
"---\n\n\n"
Expand Down

0 comments on commit 3b5ea3a

Please sign in to comment.