pact-foundation / pact-reference

Reference implementations for the pact specifications
https://pact.io
MIT License
93 stars 46 forks source link

0.4.20 pactffi_mock_server_logs empty - mismatch in tracing library #434

Closed YOU54F closed 5 months ago

YOU54F commented 5 months ago

pactffi_mock_server_logs are empty, in 0.4.20 release.

Initially identified in pact-net's test suite when attempting to update to libpact_ffi 0.4.20. pact-net uses pactffi_log_to_buffer when it initialises, and has a test to check that pactffi_mock_server_logs actually returns logs (and it failed)

Cause

I believe this is due to a mis-match in the logging libraries in pact_models, compared to the rest of the pact rust estate

All other crates

Reproductions

Added a test, which requires a buffer log sink. I believe the full test run sets a different global sink, so the test is ignored in the main run, and executed in isolation. It's not terribly pretty but it does the job.

✅ tag libpact_ffi-v0.4.19

❌ tag libpact_ffi-v0.4.20

Resolution

Suggest

  1. Update pact_models to match tracing libs
    1. Requires consuming in pact-plugin-driver & pact-core-mock-server
  2. Pin logging libs explicitly with version="=x.y.z", note the = sign in the version number. This forces pinned resolution

Testing

  1. Update pact_models to same logging libs
  2. Update pact_mock_server to use updated pact_models
  3. Update pact-plugin-driver, as it consumes pact_models, and are depended on by pact_mock_server
  4. Update all the things in pact-ref to point to updated pact_mock_server and pact-plugin-driver

pact-plugin-driver

pact_mock_server

pact_reference

YOU54F commented 5 months ago

should be fixed in 0.4.21, just awaiting release