https://pact.io logo
Join Slack
Powered by
# pact-beam
  • s

    Srijan Choudhary

    06/28/2023, 3:46 AM
    Should we rename this to pact-beam and include discussions of the new pact_erlang library as well?
  • m

    Matt Glover

    06/28/2023, 12:24 PM
    Makes sense to me. This channel has been pretty quiet since I joined it long ago. I think discussing any beam-related stuff here makes sense.
  • m

    Matt (pactflow.io / pact-js / pact-go)

    06/28/2023, 12:29 PM
    We can rename if needed. We are working to get a paid workspace, hopefully that will be soon, and then the elixir history will be back
  • m

    Matt (pactflow.io / pact-js / pact-go)

    06/28/2023, 12:30 PM
    I’d expect (in time) that both Elixir and Erlang would have separate DSLs, specific to each language. Despite the common runtime, they are separate. I say that without knowing much. Is “beam” the common platform that would be obvious to both languages / the ecosystem to join?
  • m

    Matt Glover

    06/28/2023, 12:31 PM
    The inaccurate but quickest approximation I can give is like the JVM for Java, Scala, Clojure, etc.
    👍 2
  • m

    Matt (pactflow.io / pact-js / pact-go)

    06/28/2023, 12:31 PM
    that’s what I was thinking
  • m

    Matt (pactflow.io / pact-js / pact-go)

    06/28/2023, 12:32 PM
    so
    #pact-beam
    would cover both Erlang and Elixir?
  • m

    Matt Glover

    06/28/2023, 12:32 PM
    So we can share/reuse stuff across the board if we choose. But yes you do end up with language-specific DSLs for stuff.
  • m

    Matt Glover

    06/28/2023, 12:32 PM
    Yeah it'd cover those among some others
  • m

    Matt (pactflow.io / pact-js / pact-go)

    06/28/2023, 12:32 PM
    has renamed the channel from "pact-elixir" to "pact-beam"
  • m

    Matt (pactflow.io / pact-js / pact-go)

    06/28/2023, 12:35 PM
    @Priyaranjan Mudliar - where did you land with the Erlang bindings? (and welcome blobwave )
    blob wave 1
    p
    • 2
    • 1
  • m

    Matt (pactflow.io / pact-js / pact-go)

    06/28/2023, 12:36 PM
    set the channel description: Discuss Elixir and Erlang related Pact implementations. Work in progress for Elixir exists at https://github.com/elitau/pact_elixir
  • s

    Srijan Choudhary

    06/28/2023, 2:40 PM
    The erlang wip is at https://github.com/greyorange-labs/pact-erlang With the package at https://hex.pm/packages/pact_erlang
    ☝️ 1
    🙌 2
    p
    m
    • 3
    • 5
  • m

    Matt (pactflow.io / pact-js / pact-go)

    06/28/2023, 11:19 PM
    set the channel description: Discuss Elixir and Erlang related Pact implementations. Work in progress for Elixir exists at https://github.com/elitau/pact_elixir The erlang wip is at https://github.com/greyorange-labs/pact-erlang (https://hex.pm/packages/pact_erlang)
  • s

    Srijan Choudhary

    06/29/2023, 12:30 PM
    Request for comments: DSL and project structure for pact-erlang: https://github.com/greyorange-labs/pact-erlang/issues/11
    👀 2
  • s

    Srijan Choudhary

    08/15/2023, 6:26 AM
    pact_erlang version 0.2.0 released with the new map-based DSL: https://github.com/greyorange-labs/pact_erlang Sample usage:
    Copy code
    PactRef = pact:v4(<<"myapp">>, <<"animal_service">>),
    AnimalObject = #{<<"name">> => <<"Mary">>, <<"type">> => <<"alligator">>},
    {ok, Port} = pact:interaction(PactRef,
    #{
        given => <<"an alligator with the name Mary exists">>,
        upon_receiving => <<"a request to GET an animal: Mary">>,
        with_request => #{
            method => <<"GET">>,
            path => <<"/animals/Mary">>
        },
        will_respond_with => #{
            status => 200,
            headers => #{
                <<"Content-Type">> => <<"application/json">>
            },
            body => thoas:encode(AnimalObject)
        }
    }),
    ?assertMatch({ok, AnimalObject}, animal_service_interface:get_animal(Port, "Mary")),
    {ok, matched} = pact:verify(PactRef),
    pact:write(PactRef, <<"./pacts">>),
    pact:cleanup(PactRef).
    🌮 1
    🎉 4
    p
    y
    • 3
    • 2
  • l

    Lewis Cowles

    12/20/2023, 10:35 AM
    @Lewis Cowles has left the channel
  • j

    Justin Wood

    03/13/2024, 2:20 PM
    Hello everyone! My company has recently decided to adopt pact in order to test our different services. Please let me know if there is anything I can to do help with this effort.
    blob wave 3
    p
    • 2
    • 2
  • j

    Justin Wood

    03/13/2024, 5:32 PM
    I am writing my first test with pact and it seems I am running into a problem.
    Copy code
    (pact_erlang 0.2.2) :pactffi_nif.given(65537, %{params: %{foo: "bar"}, state: "foo"})
    I have those actual values in the given expression. I am getting an argument error. That map would be
    #{params => #{foo => <<"bar">>}, state => <<"foo">>}
    in Erlang. Any help here would be appreciated.
  • j

    Justin Wood

    03/13/2024, 5:33 PM
    Actually, it looks like I missed the step in the test suite that turns it into json.
  • j

    Justin Wood

    03/13/2024, 5:35 PM
    But that didn't seem to fix my issue.
  • j

    Justin Wood

    03/13/2024, 5:46 PM
    It looks like that functionality is not yet released in the hex package. I will just have my dep point to GH for now.
  • j

    Justin Wood

    03/13/2024, 7:52 PM
    How am I supposed to tell pact that I am sending it a query string?
    j
    • 2
    • 3
  • j

    Justin Wood

    03/22/2024, 7:25 PM
    Do people generally use the pact verifier cli in order to verify their pacts? If so, how does that work with seeding data into the application?
    j
    m
    p
    • 4
    • 9
  • j

    Justin Wood

    04/25/2024, 1:30 AM
    I am trying to use the new
    :pact_verifier
    module to verify my pacts. But I can't seem to get it to work. I have tried following the test code as closely as possible, but I am getting the following error.
    Copy code
    escript: exception error: no match of right hand side value {error,bad_directory}
      in function  erl_eval:expr/6 (erl_eval.erl, line 498)
      in call from escript:eval_exprs/5 (escript.erl, line 869)
      in call from erl_eval:local_func/8 (erl_eval.erl, line 646)
      in call from escript:interpret/4 (escript.erl, line 780)
      in call from escript:start/1 (escript.erl, line 277)
      in call from init:start_em/1 
      in call from init:do_boot/3 
    escript: exception error: no match of right hand side value {error,bad_directory}
      in function  erl_eval:expr/6 (erl_eval.erl, line 498)
      in call from escript:eval_exprs/5 (escript.erl, line 869)
      in call from erl_eval:local_func/8 (erl_eval.erl, line 646)
      in call from escript:interpret/4 (escript.erl, line 780)
      in call from escript:start/1 (escript.erl, line 277)
      in call from init:start_em/1 
      in call from init:do_boot/3
    I can't seem to figure out what is going wrong with this one.
    p
    • 2
    • 3
  • j

    Justin Wood

    06/07/2024, 4:17 PM
    Is this lib known to work with the pactflow broker?
  • m

    Matt (pactflow.io / pact-js / pact-go)

    06/08/2024, 4:06 AM
    It uses the shared core or other languages, so it should. The contracts it produces definitely are. The only touch point it would have is provider verification, so it should be able to fetch pacts from Pactflow. Have you tried?
  • j

    Justin Wood

    06/11/2024, 11:43 PM
    That is what I was looking to figure out. I was able to push the pact files, but I can't really seem to find the proper configuration to give the lib in order to accept the token. https://github.com/greyorange-labs/pact_erlang/blob/develop/c_src/pactffi_nif.c#L828C5-L828C50 -- It seems like this lib doesn't allow passing the token at the moment, which I think is needed for pactflow.
    m
    • 2
    • 3
  • j

    Justin Wood

    06/11/2024, 11:46 PM
    Actually, I didn't use the lib to push the pact files. I used the github action to do it.
    ☝️ 1
    m
    • 2
    • 1
  • p

    Priyaranjan Mudliar

    06/16/2025, 12:31 PM
    I am running into segmentation fault while trying to fix the issue - https://github.com/greyorange-labs/pact_erlang/issues/32. This is only happening in linux and not in macos. (Specifically in the call
    pactffi_verifier_execute
    ). The in progress PR is - https://github.com/greyorange-labs/pact_erlang/pull/49 It will be really helpful if anyone knows how to debug/fix this issue. Thanks
    y
    • 2
    • 8