Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

Getting error on running npm run test:pact:provider #7

Open
arunamuthyala opened this issue Nov 21, 2018 · 1 comment
Open

Getting error on running npm run test:pact:provider #7

arunamuthyala opened this issue Nov 21, 2018 · 1 comment
Labels

Comments

@arunamuthyala
Copy link

:\pact-workshop-js-master>npm run test:pact:provider

[email protected] test:pact:provider C:\pact-workshop-js-master
mocha --timeout 1000000 provider/test/providerPact.spec.js

                                                                                                                                                                    Provider service listening on http://localhost:8081

Pact Verification
[2018-11-21T17:30:52.918Z] INFO: [email protected]/24720 on APTSW57SLPC0201: Verifying Pacts. [2018-11-21T17:30:52.920Z] INFO: [email protected]/24720 on APTSW57SLPC0201: Verifying Pact Files [2018-11-21T17:30:55.928Z] INFO: [email protected]/24720 on APTSW57SLPC0201: Created 'standalone\win32-1.61.1\bin\pact-provider-verifier.bat 'https://test.pact.dius.com.au/pacts/provider/Our%20Provider/consumer/Our%20Little%20Consumer/version/1.0.1542820574' --provider-base-url 'http://localhost:8081' --provider-states-setup-url 'http://localhost:8081/setup' --broker-username 'dXfltyFMgNOFZAxr8io9wJ37iUpY42M' --broker-password 'O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1' --publish-verification-results 'true' --provider-app-version '1.0.0'' process with PID: 27156
[2018-11-21T17:31:07.274Z] WARN: [email protected]/24720 on APTSW57SLPC0201: Pact exited with code 1.
1) should validate the expectations of Our Little Consumer

0 passing (14s)
1 failing
1) Pact Verification
should validate the expectations of Our Little Consumer:
Error: INFO: Reading pact at https://dXfltyFMgNOFZAxr8io9wJ37iUpY42M:*****@test.pact.dius.com.au/pacts/provider/Our%20Provider/consumer/Our%20Little%20Consumer/version/1.0.1542820574

Verifying a pact between Our Little Consumer and Our Provider
Given date count > 0
a request for JSON data
with GET /provider?validDate=2018-11-21T17%3A15%3A44.943Z
returns a response which

      has status code 200 (FAILED - 1)

      has a matching body (FAILED - 2)

      includes headers

        "Content-Type" which equals "application/json; charset=utf-8" (FAILED - 3)

Given date count > 0

a request with an invalid date parameter

  with GET /provider?validDate=This+is+not+a+date

    returns a response which

      has status code 400 (FAILED - 4)

      has a matching body (FAILED - 5)

      includes headers

        "Content-Type" which equals "application/json; charset=utf-8" (FAILED - 6)

Given date count > 0

a request with a missing date parameter

  with GET /provider

    returns a response which

      has status code 400 (FAILED - 7)

      has a matching body (FAILED - 8)

      includes headers

        "Content-Type" which equals "application/json; charset=utf-8" (FAILED - 9)

Given date count == 0

a request for JSON data

  with GET /provider?validDate=2018-11-21T17%3A15%3A44.943Z

    returns a response which

      has status code 404 (FAILED - 10)

      includes headers                                                                                                                                                                                                                                                                                                                                  "Content-Type" which equals "application/json; charset=utf-8" (FAILED - 11)

Failures:

  1. Verifying a pact between Our Little Consumer and Our Provider Given date count > 0 a request for JSON data with GET /provider?validDate=2018-11-21T17%3A15%3A44.943Z returns a response which has status code 200
    Failure/Error: set_up_provider_states interaction.provider_states, options[:consumer]
    Pact::ProviderVerifier::SetUpProviderStateError:
    Error setting up provider state 'date count > 0' for consumer 'Our Little Consumer' at http://localhost:8081/setup. response status=404 response body=404 Not Found

  2. Verifying a pact between Our Little Consumer and Our Provider Given date count > 0 a request for JSON data with GET /provider?validDate=2018-11-21T17%3A15%3A44.943Z returns a response which has a matching body
    Failure/Error: set_up_provider_states interaction.provider_states, options[:consumer]
    Pact::ProviderVerifier::SetUpProviderStateError: Error setting up provider state 'date count > 0' for consumer 'Our Little Consumer' at http://localhost:8081/setup. response status=404 response body=404 Not Found
    3) Verifying a pact between Our Little Consumer and Our Provider Given date count > 0 a request for JSON data with GET /provider?validDate=2018-11-21T17%3A15%3A44.943Z returns a response which includes headers "Content-Type" which equals "application/json; charset=utf-8"
    Failure/Error: set_up_provider_states interaction.provider_states, options[:consumer]
    Pact::ProviderVerifier::SetUpProviderStateError: Error setting up provider state 'date count > 0' for consumer 'Our Little Consumer' at http://localhost:8081/setup. response status=404 response body=404 Not Found
    4) Verifying a pact between Our Little Consumer and Our Provider Given date count > 0 a request with an invalid date parameter with GET /provider?validDate=This+is+not+a+date returns a response which has status code 400 Failure/Error: set_up_provider_states interaction.provider_states, options[:consumer] Pact::ProviderVerifier::SetUpProviderStateError:
    Error setting up provider state 'date count > 0' for consumer 'Our Little Consumer' at http://localhost:8081/setup. response status=404 response body=404 Not Found
    5) Verifying a pact between Our Little Consumer and Our Provider Given date count > 0 a request with an invalid date parameter with GET /provider?validDate=This+is+not+a+date returns a response which has a matching body Failure/Error: set_up_provider_states interaction.provider_states, options[:consumer]

    Pact::ProviderVerifier::SetUpProviderStateError: Error setting up provider state 'date count > 0' for consumer 'Our Little Consumer' at http://localhost:8081/setup. response status=404 response body=404 Not Found

  3. Verifying a pact between Our Little Consumer and Our Provider Given date count > 0 a request with an invalid date parameter with GET /provider?validDate=This+is+not+a+date returns a response which includes headers "Content-Type" which equals "application/json; charset=utf-8"
    Failure/Error: set_up_provider_states interaction.provider_states, options[:consumer]
    Pact::ProviderVerifier::SetUpProviderStateError:
    Error setting up provider state 'date count > 0' for consumer 'Our Little Consumer' at http://localhost:8081/setup. response status=404 response body=404 Not Found
    7) Verifying a pact between Our Little Consumer and Our Provider Given date count > 0 a request with a missing date parameter with GET /provider returns a response which has status code 400
    Failure/Error: set_up_provider_states interaction.provider_states, options[:consumer]
    Pact::ProviderVerifier::SetUpProviderStateError: Error setting up provider state 'date count > 0' for consumer 'Our Little Consumer' at http://localhost:8081/setup. response status=404 response body=404 Not Found 8) Verifying a pact between Our Little Consumer and Our Provider Given date count > 0 a request with a missing date parameter with GET /provider returns a response which has a matching body
    Failure/Error: set_up_provider_states interaction.provider_states, options[:consumer]
    Pact::ProviderVerifier::SetUpProviderStateError: Error setting up provider state 'date count > 0' for consumer 'Our Little Consumer' at http://localhost:8081/setup. response status=404 response body=404 Not Found

  4. Verifying a pact between Our Little Consumer and Our Provider Given date count > 0 a request with a missing date parameter with GET /provider returns a response which includes headers "Content-Type" which equals "application/json; charset=utf-8"
    Failure/Error: set_up_provider_states interaction.provider_states, options[:consumer]
    Pact::ProviderVerifier::SetUpProviderStateError:
    Error setting up provider state 'date count > 0' for consumer 'Our Little Consumer' at http://localhost:8081/setup. response status=404 response body=404 Not Found

  5. Verifying a pact between Our Little Consumer and Our Provider Given date count == 0 a request for JSON data with GET /provider?validDate=2018-11-21T17%3A15%3A44.943Z returns a response which has status code 404 Failure/Error: set_up_provider_states interaction.provider_states, options[:consumer]
    Pact::ProviderVerifier::SetUpProviderStateError:
    Error setting up provider state 'date count == 0' for consumer 'Our Little Consumer' at http://localhost:8081/setup. response status=404 response body=404 Not Found

  6. Verifying a pact between Our Little Consumer and Our Provider Given date count == 0 a request for JSON data with GET /provider?validDate=2018-11-21T17%3A15%3A44.943Z returns a response which includes headers "Content-Type" which equals "application/json; charset=utf-8"
    Failure/Error: set_up_provider_states interaction.provider_states, options[:consumer]

    Pact::ProviderVerifier::SetUpProviderStateError:
    Error setting up provider state 'date count == 0' for consumer 'Our Little Consumer' at http://localhost:8081/setup. response status=404 response body=404 Not Found

4 interactions, 4 failures

Failed interactions:

  • A request for json data given date count > 0

  • A request with an invalid date parameter given date count > 0

  • A request with a missing date parameter given date count > 0

  • A request for json data given date count == 0

INFO: Verification results published to https://test.pact.dius.com.au/pacts/provider/Our%20Provider/consumer/Our%20Little%20Consumer/pact-version/3dc154c18ef205be0003a2196515f34aedf39c95/verification-results/11957

  at ChildProcess.<anonymous> (node_modules\@pact-foundation\pact-node\src\verifier.js:130:68)
  at maybeClose (internal/child_process.js:925:16)
  at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
@mefellows
Copy link
Collaborator

Hi, which branch are you in?

I ran this workshop just yesterday, and it worked for all attendees.

Potentially, this is a Windows only issue (I'm guessing you're on Windows?)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants