https://pact.io logo
Join Slack
Powered by
# pact-swift
  • m

    Michael Strasser

    04/19/2024, 5:33 AM
    @Michael Strasser has left the channel
  • m

    Marko (IttyBittyApps / pact-swift)

    05/12/2024, 11:42 PM
    There's lots of people in this channel and no activity. Is that because Pact for Swift is so easy/clear to use (I wish) or the interest is there but the teams can't necessarily adopt it?
    👀 1
    m
    • 2
    • 1
  • m

    Marko (IttyBittyApps / pact-swift)

    05/12/2024, 11:42 PM
    I've spent some time on PactSwift these past weeks and major (breaking) changes are about to happen
    👍 1
  • m

    Marko (IttyBittyApps / pact-swift)

    05/12/2024, 11:42 PM
    More here - https://github.com/surpher/PactSwift/discussions/122
  • m

    Marko (IttyBittyApps / pact-swift)

    05/12/2024, 11:43 PM
    but! the good news is, it's shaping up to be much leaner, cleaner and better for bandwidth going forward.
    nice 7771 2
  • m

    Martin Gallauner

    05/14/2024, 9:40 AM
    @Martin Gallauner has left the channel
  • t

    Tomer

    05/16/2024, 8:38 AM
    @Tomer has left the channel
  • t

    Taha Shakibania

    05/27/2024, 11:03 AM
    @Taha Shakibania has left the channel
  • g

    georgia andrews

    06/03/2024, 5:40 PM
    @georgia andrews has left the channel
  • p

    PK

    06/04/2024, 3:45 AM
    @PK has left the channel
  • s

    Stephen Bell

    06/18/2024, 10:28 PM
    @Stephen Bell has left the channel
  • a

    Amit Wertheimer

    06/25/2024, 10:27 AM
    @Amit Wertheimer has left the channel
  • v

    Vladimir Vásquez Hernández

    07/15/2024, 10:28 PM
    Hi team, I'm trying to write a basic test using PactConsumerSwift. However it is failing when Pact is trying to connect to the server.
    Copy code
    test(): failed - Error setting up pact: Could not connect to the server.
    I tried to change the localhost address as indicated in some fixes, but it didn't work. Here is my code, I'd be glad to receive your suggestions:
    Copy code
    import Foundation
    import PactConsumerSwift
    import XCTest
    import Hamcrest
    
    class SimulatedSaleIntegration: XCTestCase {
        
        var mockService: MockService?
        let apiClient: SimulatedSaleViewModel = SimulatedSaleViewModel()
        let successfulSale = Sale(amount: 5000.0, vat: 0.19, tip: 0.15, paymentMethod: "", location: "")
        
        
        override func setUp() {
            super.setUp()
            mockService = MockService(provider: "calculator-service", consumer: "Example-app-for-testing")
            apiClient.setServer(url: mockService!.baseUrl)
          }
        
        override func tearDown() {
            super.tearDown()
          }
        
        func testGetSuccessfulSimulatedSale() {
            mockService!
                .uponReceiving("A request to get a simulated sale")
                .withRequest(
                    method: .GET,
                    path: "/calculator",
                    query: [...]
                )
                .willRespondWith(
                    status: 200,
                    headers: ["Content-Type": "application/json"],
                    body: [...]
                )
            
            mockService!.run { (testComplete) -> Void in
                self.apiClient.getSimulatedSale(sale: self.successfulSale)
                assertThat(self.apiClient.simulatedSale?.fee, equalTo(168.34))
                testComplete()
            }
        }
    }
    In logs, all I can see is
    interactions/verification
    request could not being performed
    Copy code
    Task <5AEFFE81-A9B5-4574-9DFB-EE823F7B83B9>.<2> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x6000015ed710 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: en0[802.11], uses wifi, _kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <5AEFFE81-A9B5-4574-9DFB-EE823F7B83B9>.<2>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
      "LocalDataTask <5AEFFE81-A9B5-4574-9DFB-EE823F7B83B9>.<2>"
    ), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=<https://0.0.0.0:1234/interactions/verification>, NSErrorFailingURLKey=<https://0.0.0.0:1234/interactions/verification>, _kCFStreamErrorDomainKey=1}
    Anyone has an idea about this issue? Thanks in advace 😉
    🙌 1
    a
    • 2
    • 2
  • m

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

    07/15/2024, 10:39 PM
    This looks like an older version of the swift library that uses the Ruby “core”. There should be some logs somewhere (or you should be able to enable them), could you please share those? Did the test ever work or are these new tests? What OS are you on?
    ☝️ 1
    v
    m
    • 3
    • 43
  • j

    Jocelyn Lecomte

    07/25/2024, 9:23 AM
    @Jocelyn Lecomte has left the channel
  • i

    Inken

    07/25/2024, 3:21 PM
    @Inken has left the channel
  • d

    Diego Betancur

    07/29/2024, 4:44 PM
    @Diego Betancur has left the channel
  • m

    Megan Honig

    07/30/2024, 6:56 PM
    @Megan Honig has left the channel
  • b

    Bertold Kolics

    09/08/2024, 8:12 PM
    @Bertold Kolics has left the channel
  • v

    Val Kolovos

    09/19/2024, 10:40 PM
    @Val Kolovos has left the channel
  • m

    Marcus Couto

    10/04/2024, 4:16 PM
    @Marcus Couto has left the channel
  • a

    Ashley Gautama

    10/10/2024, 8:09 AM
    Hey, a specific question using pact swift. We are having some trouble configuring the requestbody for our mockserver/contract test. Reason being we are (also) using an encrypted multipart in the request body. Any ideas? We couldnt really find a similar example. The actual request body looks something like this.
    m
    • 2
    • 1
  • g

    Gianluca Ciccarelli

    11/22/2024, 2:08 PM
    @Gianluca Ciccarelli has left the channel
  • s

    Shakil Riyad

    11/25/2024, 9:57 PM
    @Shakil Riyad has left the channel
  • p

    Pietro Di Bello

    12/17/2024, 11:23 AM
    @Pietro Di Bello has left the channel
  • t

    Tom Lopez

    01/22/2025, 4:04 PM
    @Tom Lopez has left the channel
  • r

    Romain Létendart

    01/31/2025, 4:56 PM
    @Romain Létendart has left the channel
  • s

    Spencer

    02/11/2025, 3:34 PM
    @Spencer has left the channel
  • d

    Dominik Krichbaum

    02/26/2025, 2:22 PM
    @Dominik Krichbaum has left the channel
  • m

    Martin Mineo

    03/07/2025, 1:16 PM
    @Martin Mineo has left the channel