pact-foundation / pact-provider-verifier

Cross-platform, generic language, Pact provider verification tool
http://pact.io
MIT License
32 stars 25 forks source link

PactSpec v3 not supported? #61

Closed lt-mayonesa closed 3 weeks ago

lt-mayonesa commented 3 years ago

Hi, i'm having the following issue ¿what am i missing?

WARN: Ignoring unsupported combine AND for path $['id'] WARN: Ignoring unsupported matchers [{"match"=>"number"}] for path $['amount'] WARN: Ignoring unsupported combine AND for path $['amount'] WARN: Ignoring unsupported matchers [{"match"=>"timestamp", "timestamp"=>"yyyy-MM-dd'T'HH:mm:ss"}] for path $['expires_at'] WARN: Ignoring unsupported combine AND for path $['expires_at']

full_log.txt

Command:

docker run --rm --net host \
  -e PACT_BROKER_BASE_URL=https://pactbroker.custom.domain.com/ \
  -e PACT_BROKER_USERNAME \
  -e PACT_BROKER_PASSWORD \
  -e PACT_BROKER_PUBLISH_VERIFICATION_RESULTS=false \
  pactfoundation/pact-cli:0.24.0.0 verify \
  --provider ms-virtual-account \
  --provider-base-url http://localhost:59000 \
  --provider-app-version "$1" \
  --no-enable-pending \
  --wait 10 \
  --provider-version-tag local-test \
  --consumer-version-selector '{"tag":"local","latest":true,"fallbackTag":"feats"}' \
  --consumer-version-selector '{"tag":"dev","latest":true,"fallbackTag":"prod"}'

This is my pact (part of):

{
  "interactions": [
    {
      "_id": "1d4705eb3dfafb618d9a9172bf701406e4e736cf",
      "description": "a request to reserve amount",
      "request": {
        "method": "POST",
        "path": "/movements",
        "headers": {
          "Content-Type": "application/json"
        },
        "body": {
          "amount": 100.5,
          "intention_id": "4",
          "type": "reserve"
        }
      },
      "response": {
        "status": 201,
        "headers": {
          "Content-Type": "application/json; charset=UTF-8"
        },
        "body": {
          "amount": 100.5,
          "expires_at": "2020-11-12T14:15:38",
          "id": "5",
          "status": "CREATED"
        },
        "matchingRules": {
          "body": {
            "$.id": {
              "matchers": [
                {
                  "match": "type"
                }
              ],
              "combine": "AND"
            },
            "$.amount": {
              "matchers": [
                {
                  "match": "number"
                }
              ],
              "combine": "AND"
            },
            "$.expires_at": {
              "matchers": [
                {
                  "match": "date",
                  "date": "yyyy-MM-dd'T'HH:mm:ss"
                }
              ],
              "combine": "AND"
            }
          },
          "header": {
            "Content-Type": {
              "matchers": [
                {
                  "match": "regex",
                  "regex": "application/json(;\\s?charset=[\\w\\-]+)?"
                }
              ],
              "combine": "AND"
            }
          }
        }
      },
      "providerStates": [
        {
          "name": "account has available balance"
        }
      ]
    }
  ],
  "metadata": {
    "pactSpecification": {
      "version": "3.0.0"
    },
    "pact-jvm": {
      "version": "4.1.7"
    }
  }
}
bethesque commented 3 years ago

v3 is not supported yet, sorry.

lt-mayonesa commented 3 years ago

Which is the latest supported? I'm having a similar issue with a v2 pact.

WARN: Ignoring unsupported matching rules {"match"=>"date", "date"=>"yyyy-MM-dd'T'HH:mm:ss"} for path $['body']['expires_at']

pd: there's a section in the README with something about v3. That's a bit confusing.

Thanks in advance!

YOU54F commented 3 weeks ago

V3 is only partially supported, see tracking issue https://github.com/pact-foundation/pact-ruby/issues/318 for more detail.

Pact-Ruby can write 3.0.0 HTTP pacts but in an incorrect format, with V2 matching rules.

Closing as tracking in the v3 meta issue