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

Support :suite_finished on elixir 1.12+ #5

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

aeruder
Copy link

@aeruder aeruder commented Apr 6, 2023

This PR has a few commits to support newer versions of elixir. I was mostly focused on the first one which causes the summary to not be printed on 1.12+ but I threw a few other commits in here to get a few other things working nicer on more modern versions of elixir.

support :suite_finished on Elixir 1.12+

    This was noted in the Elixir 1.12 changelog as:

        A backward incompatible change was found on Elixir v1.12.0 after
        the release. This was not planned and it is documented below:

        ExUnit

        [ExUnit.Formatter]
          {:suite_finished, load_time, run_time}
        message has been updated to
          {:suite_finished, %{load: load_time, run: run_time, async: async_time}}

    It is fairly trivial to support the old-style message and the
    new-style message as the ExUnit.Formatter still supports both (until
    1.16 per the comments in ExUnit.Formatter).

Without this change, you will not get the summary of the test suite at the end of the test run on anything newer than 1.12.

get testsuite passing on 1.12+

    Some small tweaks to the output.  This will unfortunately fail on
    older versions of elixir, but I think its worthwhile making the
    testsuite work on new versions and just keeping the code working in as
    much as possible on the older versions.
  • before: passes 1.4 - 1.7, fails 1.8 - 1.14
  • after: fails 1.4 - 1.9, passes 1.10 - 1.14
    to pass on 1.10+ (works as a lib on 1.4+, same as before this PR, but tests now fail between ).

Get rid of deprecation warning on Elixir 1.6+

    Do a compile-time compare to see if we have
    ExUnit.Formatter.format_test_all_failure available to us (added in
    1.6+) and use that instead.

Remove config/config.exs

    It is empty and just serves to issue warnings on Elixir 1.13+ due to
    the deprecation of Mix.Config.  Nothing elixir 1.4+ requires the file
    be here.

bump minimum required elixir to 1.4

    1.3 was required back here:

        commit 24f3bbced99f3fba6ee2a2e09bdac75808a10f3a
        CommitDate: Thu Nov  9 16:12:08 2017 -0600

            Merge pull request #2 from adamnbowen/use-string-trim

    And 1.4 was then required back here:

        commit 9b072284316b5cf0ce9f4c514fbeb3b723cdb3bd
        CommitDate: Thu Nov  9 16:38:37 2017 -0600

            Merge branch 'replace-gen-event-with-gen-server'

The 1.4+ requirement is unchanged by this PR, just documenting it as such.

aeruder added 5 commits April 6, 2023 15:58
This was noted in the Elixir 1.12 changelog as:

    A backward incompatible change was found on Elixir v1.12.0 after
    the release. This was not planned and it is documented below:

    ExUnit

    [ExUnit.Formatter]
      {:suite_finished, load_time, run_time}
    message has been updated to
      {:suite_finished, %{load: load_time, run: run_time, async: async_time}}

It is fairly trivial to support the old-style message and the
new-style message as the ExUnit.Formatter still supports both (until
1.16 per the comments in ExUnit.Formatter).
Some small tweaks to the output.  This will unfortunately fail on
older versions of elixir, but I think its worthwhile making the
testsuite work on new versions and just keeping the code working in as
much as possible on the older versions.
Do a compile-time compare to see if we have
ExUnit.Formatter.format_test_all_failure available to us (added in
1.6+) and use that instead.
It is empty and just serves to issue warnings on Elixir 1.13+ due to
the deprecation of Mix.Config.  Nothing elixir 1.4+ requires the file
be here.
1.3 was required back here:

    commit 24f3bbc
    CommitDate: Thu Nov  9 16:12:08 2017 -0600

        Merge pull request joshwlewis#2 from adamnbowen/use-string-trim

And 1.4 was then required back here:

    commit 9b07228
    CommitDate: Thu Nov  9 16:38:37 2017 -0600

        Merge branch 'replace-gen-event-with-gen-server'
@aeruder
Copy link
Author

aeruder commented Apr 6, 2023

As noted above, with this PR library now seems to fully work from 1.4 -> 1.14, test suite passes on 1.10+. Verified via this elixir docker images:

hexpm/elixir:1.1.0-erlang-17.0.1-debian-jessie-20200224
hexpm/elixir:1.2.0-erlang-18.0.1-debian-jessie-20200224
hexpm/elixir:1.3.0-erlang-18.0.1-debian-jessie-20200224
hexpm/elixir:1.4.0-erlang-18.0.1-debian-jessie-20200224
hexpm/elixir:1.5.0-erlang-20.3.8.9-ubuntu-impish-20211102
hexpm/elixir:1.6.0-erlang-20.3.8.9-ubuntu-impish-20211102
hexpm/elixir:1.7.0-erlang-22.3.4.26-debian-buster-20210902
hexpm/elixir:1.8.0-erlang-20.0.1-alpine-3.11.2
hexpm/elixir:1.9.0-erlang-20.0.1-alpine-3.11.3
hexpm/elixir:1.10.0-erlang-21.0.1-alpine-3.11.2
hexpm/elixir:1.11.0-erlang-21.0.1-alpine-3.11.3
hexpm/elixir:1.12.0-erlang-22.0.1-alpine-3.11.3
hexpm/elixir:1.13.0-erlang-22.0.1-alpine-3.11.3
hexpm/elixir:1.14.0-erlang-23.0.1-debian-bullseye-20210902

My bad on the 2 PRs for the same thing. I got a little confused on my github accounts.

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.

1 participant