🗣 Context
Currently the only way to display some logging is by setting an environment variable. It would be good to have the logs of interactions with the mock server written in a file.
💬 Narrative
When running pact tests
I want to have logs written into a file
So that I can debug locally and on CI much easier
📝 Notes
PactSwiftMockServer exposes a pactffi method that tells pactffi_mock_server to write the log buffer into a file.
🏗 Design
- Exposes the interface ie
MockService.init(log: URL? = nil)
- Passes do write the log signal to
PactSwiftMockServer package and into pactffi.
- Uses the same base default directory for contract if no override provided (eg:
/tmp/pacts/logs)
✅ Acceptance Criteria
GIVEN a valid URL to a log file is provided at MockService.init
WHEN pact tests finish
THEN a log file is generated at provided URL
GIVEN MockService is instantiated without an URL to a log file
WHEN pact tests finish
THEN a log file is generated at defaultPactsDir/logs
🚫 Out of Scope
🗣 Context
Currently the only way to display some logging is by setting an environment variable. It would be good to have the logs of interactions with the mock server written in a file.
💬 Narrative
When running pact tests
I want to have logs written into a file
So that I can debug locally and on CI much easier
📝 Notes
PactSwiftMockServerexposes apactffimethod that tellspactffi_mock_serverto write the log buffer into a file.🏗 Design
MockService.init(log: URL? = nil)PactSwiftMockServerpackage and intopactffi./tmp/pacts/logs)✅ Acceptance Criteria
GIVEN a valid
URLto a log file is provided atMockService.initWHEN pact tests finish
THEN a log file is generated at provided
URLGIVEN
MockServiceis instantiated without an URL to a log fileWHEN pact tests finish
THEN a log file is generated at
defaultPactsDir/logs🚫 Out of Scope