Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add port configuration for MockService and MockServer #51

Merged
merged 2 commits into from
Dec 7, 2020

Conversation

surpher
Copy link
Owner

@surpher surpher commented Dec 6, 2020

馃摑 Summary of Changes

The changes in this PR introduce a new MockService initializer that accepts the port number on which to run the MockServer. This will allow tests to always run on the same port between test runs.

Along with the PactSwift enhancements described above, the following has been done:

  • Improves MockService tests
  • Update SwiftLint Phase Script for v0.41.0
  • Update GitHub Actions workflows

鈿狅笍 Items of Note

  • ISSUE: aarch64 - Xcode 12.2 requires binaries to contain aarch64 slices. This means that the script that builds pact_mock_server.a needs to build for aarch64 and x86_64 and create a fat binary containing both slices. Though the cargo build fails when even when using Rust nightly toolchain. It fails when building the pact_mock_server.a binary for aarch64 architecture from Rust code (building on x86_64 machines) due to pact_mock_server's dependencies' fail to build. Please focus on iOS platform when using Carthage or preferrably use Swift Package Manager to bring PactSwift into your project. arm64 architecture for macOS has been removed with Exclude arm64 for macos聽#53 until better support is available.
  • Port remains random if not provided when initialising MockService
  • Only port numbers above 1200 are valid and if port is not available it should fail with MockServerError(code:)

馃馃棐 Reviewer Notes

馃敤 How To Test

  • CI passes
  • Setup a test signing the URL with HMAC (optional)

@surpher surpher added the enhancement New feature or request label Dec 6, 2020
@surpher surpher force-pushed the feat/mock-server-conf branch 3 times, most recently from 57754eb to 8ecf0dc Compare December 6, 2020 04:16
@surpher surpher marked this pull request as draft December 6, 2020 04:48
Copy link

@georgescumihai georgescumihai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some remarks, this change should be enough to fix #50

README.md Outdated Show resolved Hide resolved
Sources/Services/MockService.swift Outdated Show resolved Hide resolved
Tests/Services/MockServiceTests.swift Show resolved Hide resolved
@surpher surpher merged commit 56e2f4a into master Dec 7, 2020
@surpher surpher deleted the feat/mock-server-conf branch December 7, 2020 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add port configuration for MockServer
3 participants