Giter VIP home page Giter VIP logo

xcresultkit's Introduction

XCResultKit

This package provides some friendly Swift objects that map to the xcresult objects that you can access using the xcresulttool and xccov apps included in Xcode 11. Both of these apps provide export to JSON options, and this package provides all the JSON parsing required to turn the data into objects you can use.

XCResultFile

This is the main entry point for using the package. Just create an instance of this object with the path to the .xcresult you want to extract from:

let resultFile = XCResultFile(url: urlToXCResult)

Once you have created an instance, there are several methods to extract and parse the data. Note that these all shell out to run the xcresulttool or xccov so clearly this will not work on anything but macOS.

To get the ActionsInvocationRecord object (this is the top level object in the .xcresult file):

let invocationRecord = resultFile.getInvocationRecord()

Inside the invocation record you will find test plan run summaries id which you can use to get the details of what tests were ran:

let testPlanRunSummaries = resultFile.getTestPlanRunSummaries(id: "xxx")

You can get the details for an individual test:

let testSummary = resultFile.getActionTestSummary(id: "xxx")

Tests can also include attachments and with the payload ID you can either get the raw data, or export the contents to a file:

let payload = resultFile.getPayload(id: "123")
let exportedPath = resultFile.exportPayload(id: "123")

And you can also get the results of xccov using this simplified method:

let codeCoverage = resultFile.getCodeCoverage()

xcresultkit's People

Contributors

davidahouse avatar bblechman-ebay avatar felginep avatar kpmobiledevops avatar benblechman avatar selasie avatar nacho4d avatar aapng avatar

Watchers

 avatar

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.