You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have triple checked, that there are no unhandled promises in my code and have read the section on intermittent test failures
I have set my log level to debug and attached a log file showing the complete request/response cycle
For bonus points and virtual high fives, I have created a reproduceable git repository (see below) to illustrate the problem
Expected behaviour
Tests run like before.
Actual behaviour
Tests fail with an error message:
TypeError: ffi.pactffiMessageGivenWithParams is not a function
150 |
151 | await converterPact
> 152 | .given({ name: "A file to convert", params: { mediaType: "image" } })
| ^
153 | .expectsToReceive("A valid convert image request")
154 | .withMetadata({
155 | // "content-type": "application/json",
at Object.givenWithParams (node_modules/@pact-foundation/pact-core/src/consumer/index.ts:46:9)
at MessageConsumerPact.Object.<anonymous>.MessageConsumerPact.given (node_modules/@pact-foundation/src/messageConsumerPact.ts:77:20)
at Object.<anonymous> (test/some.test.ts:152:10)
Steps to reproduce
We are having trouble running our tests in CI since the update of @pact-foundation/pact to version 12.1.2. Consumer message pact tests fail with the below error. Reverting to 12.1.2 lets the test run successfully again.
No special logs are emitted from Pact, however running the same test with Pact version 12.1.2 (where the test works) emits the following logs:
[08:39:20.192] INFO (24436): 0.4.16: pact native library successfully found, and the correct version
2024-03-22T07:39:20.198657Z WARN ThreadId(01) pact_ffi::mock_server::handles: Failed to parse metadata value 'convert:image' as JSON - expected value at line 1 column 1. Will treat it as string
2024-03-22T07:39:20.198776Z DEBUG ThreadId(01) pact_ffi::mock_server::bodies: Path = $
2024-03-22T07:39:20.198787Z DEBUG ThreadId(01) pact_ffi::mock_server::bodies: Configuring a normal object
2024-03-22T07:39:20.198909Z DEBUG ThreadId(01) pact_ffi::mock_server::bodies: Path = $.convertedFileId
2024-03-22T07:39:20.198913Z DEBUG ThreadId(01) pact_ffi::mock_server::bodies: detected pact:matcher:type, will configure a matcher
2024-03-22T07:39:20.198932Z DEBUG ThreadId(01) pact_ffi::mock_server::bodies: Path = $.originalFileChecksum
2024-03-22T07:39:20.198934Z DEBUG ThreadId(01) pact_ffi::mock_server::bodies: Configuring a normal object
2024-03-22T07:39:20.198938Z DEBUG ThreadId(01) pact_ffi::mock_server::bodies: Path = $.originalFileChecksum.hash
2024-03-22T07:39:20.198941Z DEBUG ThreadId(01) pact_ffi::mock_server::bodies: detected pact:matcher:type, will configure a matcher
2024-03-22T07:39:20.198947Z DEBUG ThreadId(01) pact_ffi::mock_server::bodies: Path = $.originalFileId
2024-03-22T07:39:20.198949Z DEBUG ThreadId(01) pact_ffi::mock_server::bodies: detected pact:matcher:type, will configure a matcher
2024-03-22T07:39:20.198953Z DEBUG ThreadId(01) pact_ffi::mock_server::bodies: Path = $.originalFileName
2024-03-22T07:39:20.198955Z DEBUG ThreadId(01) pact_ffi::mock_server::bodies: detected pact:matcher:type, will configure a matcher
2024-03-22T07:39:20.198959Z DEBUG ThreadId(01) pact_ffi::mock_server::bodies: Path = $.profile
2024-03-22T07:39:20.198961Z DEBUG ThreadId(01) pact_ffi::mock_server::bodies: detected pact:matcher:type, will configure a matcher
2024-03-22T07:39:20.198965Z DEBUG ThreadId(01) pact_ffi::mock_server::bodies: Path = $.targetFormat
2024-03-22T07:39:20.198967Z DEBUG ThreadId(01) pact_ffi::mock_server::bodies: detected pact:matcher:type, will configure a matcher
[08:39:20.199] INFO (24436): pact@12.1.2: Verifying message
[08:39:20.199] DEBUG (24436): pact@12.1.2: reified message raw: raw
[08:39:20.199] DEBUG (24436): pact@12.1.2: rehydrated message body into correct type: [object Object]
2024-03-22T07:39:20.201618Z DEBUG ThreadId(01) pact_ffi::mock_server::handles: pact_ffi::mock_server::handles::pactffi_pact_handle_write_file FFI function invoked
2024-03-22T07:39:20.201664Z DEBUG ThreadId(01) pact_models::pact: Merging pact with file "/home/user/project/pacts/somePact.json"
2024-03-22T07:39:20.201750Z WARN ThreadId(01) pact_models::pact: Note: Existing pact is an older specification version (V3), and will be upgraded
The text was updated successfully, but these errors were encountered:
Kampfmoehre
added
bug
Indicates an unexpected problem or unintended behavior
triage
This issue is yet to be triaged by a maintainer
labels
Mar 22, 2024
Thanks for spotting, this is indeed a bug. It looks like pactffiMessageGivenWithParams was not exported by the C interface in @pact-foundation/pact-core.
I'll push out a release shortly that pins the versions so that an upgrade will automatically pull in the correct version.
Software versions
Issue Checklist
Please confirm the following:
Expected behaviour
Tests run like before.
Actual behaviour
Tests fail with an error message:
Steps to reproduce
We are having trouble running our tests in CI since the update of
@pact-foundation/pact
to version12.1.2
. Consumer message pact tests fail with the below error. Reverting to12.1.2
lets the test run successfully again.Tests run with Jest look like this:
Relevant log files
No special logs are emitted from Pact, however running the same test with Pact version 12.1.2 (where the test works) emits the following logs:
The text was updated successfully, but these errors were encountered: