Skip to content

Conversation

@amdolan
Copy link
Collaborator

@amdolan amdolan commented Feb 5, 2025

This PR attempts to start a history of test status and coverage. I've chosen to test against the past 4 versions of OTP, but this might be overdoing it.

The tests are not all passing on my machine, so if GitHub CI agrees with this, then a following PR will fix tests.

Keeping in draft until CI is shown to be accurate.

Note: A maintainer will need to approve this workflow, see 1 workflow awaiting approval below.

@amdolan
Copy link
Collaborator Author

amdolan commented Feb 6, 2025

CI is running in the latest version, and indeed some tests are shown to be consistently failing. I am happy to leave this PR in draft until a fix for the tests is merged. Best to start with a clean slate.

See an example here:
https://github.com/amdolan/chumak/actions/runs/13168944337

@amdolan
Copy link
Collaborator Author

amdolan commented Feb 6, 2025

Oh right, I need to install libsodium for curve encryption tests to pass.

@amdolan
Copy link
Collaborator Author

amdolan commented Feb 6, 2025

Using nix to manage the installation, included for reproduction;

{ pkgs ? import <nixpkgs> {} }:

let
  enacl = pkgs.stdenv.mkDerivation {
    pname = "enacl";
    version = "0.0.1";
    src = pkgs.fetchFromGitHub {
      owner = "amdolan";
      repo = "enacl";
      rev = "v0.0.3";
      sha256 = "sha256-RSJhLUHtKqvq4eyfB7z2LHCDWR1N119dfRHThrmcRn8=";
    };

    nativeBuildInputs = [ pkgs.rebar3 pkgs.gcc pkgs.gnumake pkgs.pkg-config ];
    buildInputs = [ pkgs.libsodium pkgs.libsodium.dev ];

    buildPhase = ''
      export REBAR_CACHE_DIR=$PWD/.rebar3_cache
      mkdir -p $REBAR_CACHE_DIR
      rebar3 compile
    '';

    installPhase = ''
      mkdir -p $out/lib/enacl
      cp -r _build/default/lib/enacl/ebin $out/lib/enacl/
      cp -r priv $out/lib/enacl/
    '';
  };
in

pkgs.mkShell {
  buildInputs = [
    pkgs.erlang
    pkgs.rebar3
    pkgs.libsodium
    pkgs.gcc
    pkgs.gnumake
    pkgs.pkg-config
    enacl
  ];

  shellHook = ''
    export CHUMAK_CURVE_LIB=enacl
    export ERL_LIBS=$ERL_LIBS:${enacl}/lib
    echo "Nix environment with Erlang, Rebar3, enacl, and Libsodium is ready!"
  '';
}

after running tests:

Failures:

  1) chumak_acceptance_error_handler_curve:-wrong_key/1-fun-1-/0:80
     Failure/Error: ?assertMatch({ server_error , { error , closed } }, Message)
       expected: = { server_error , { error , closed } }
            got: {server_error,closed}
     %% eunit_proc.erl:583:in `eunit_proc:run_group/2`
     Output:
     Output:
  2) chumak_iron_house_test:-negotiate_messages/1-fun-1-/0:83
     Failure/Error: ?assertEqual({server_error,{error,closed}}, Message)
       expected: {server_error,{error,closed}}
            got: {server_error,closed}
     %% eunit_proc.erl:583:in `eunit_proc:run_group/2`
     Output:
     Output:

Finished in 7.725 seconds
140 tests, 2 failures
===> Error running tests

Will track down discrepancies. I ran into issues with nacerl and nacl, not to say they can't be made to work. I ended up forking enacl to allow it to compile correctly on OTP 27 on an arm mac. Looks like some responses were updated at some point. Once I track those down I can port this to the action and update the tests.

@amdolan
Copy link
Collaborator Author

amdolan commented Feb 6, 2025

Appears to me to be caused by this change. Perhaps inadvertently, but still, updating the test cases may be the better solution.

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