Giter VIP home page Giter VIP logo

Comments (4)

harikrishnan83 avatar harikrishnan83 commented on June 12, 2024 1

@barath121 thanks for reporting this, I will take a look and get back to you.

from specmatic.

harikrishnan83 avatar harikrishnan83 commented on June 12, 2024

hello @barath121, thanks for reaching out.

If your objective is to enforce a certain minimum API coverage percentage and fail the build based on the same, I recommend setting the same in specmatic.json and Specmatic itself will fail the contract test suite if the criteria is not met. Here is a snippet which is setting the minThresholdPercentage to 100.

"report": {
    "formatters": [
      {
        "type": "text",
        "layout": "table"
      }
    ],
    "types": {
      "APICoverage": {
        "OpenAPI": {
          "successCriteria": {
            "minThresholdPercentage": 100,
            "maxMissedEndpointsInSpec": 0,
            "enforce": true
          },
          "excludedEndpoints": [
            "/health"
          ]
        }
      }
    }
  }

Here is a short video and detailed reference - API Coverage Report

However if you do want to parse the API coverage report, we do have a JSON format output now. It should be available under build/reports/specmatic/coverage_report.json. Hope this helps.

from specmatic.

barath121 avatar barath121 commented on June 12, 2024

Hey @harikrishnan83
The coverage_report.json is not being generated when using with python tested for verison 0.26.6 of Specmatic.

from specmatic.

harikrishnan83 avatar harikrishnan83 commented on June 12, 2024

@barath121 we ran tests on our sample project with latest Specmatic Python release 0.26.7 and the coverage_report.json is getting generated under build folder as expected. Can you please check?

from specmatic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.