Giter VIP home page Giter VIP logo

xcresultextractor's Introduction

A Python script to extract app console logs from an .xcresult , rather than just the test runner's logs you usually see (but it can extract those too).

Inspired by both a long term struggle with the logs missing from CI test runs and henrique's solution on StackOverflow.

Usage

To extract the app's console logs from an .xcresult pass it the path to it and specify your app's bundle ID. It'll output the logs to a file in the same directory called output.txt.

python3 xcresult_extractor.py --file YourTestApp.xcresult --bundleID com.yourapp.bundleid

To extract the test runner logs simply omit the bundleID arg

python3 xcresult_extractor.py --file YourTestApp.xcresult

Getting an .xcresult

There's an example .xcresult in this repo (generated from the test app in the repo) that you can try the script with, or if you want to get your own from Xcode:

  • Run your UI tests
  • Select the Product -> Show build folder in finder menu option
  • Navigate to Logs/Tests/ and you should see your .xcresult file(s) there

xcresultextractor's People

Contributors

chrismash avatar

Stargazers

Ihar Khadorchanka avatar Jan Kodeš avatar

Watchers

 avatar

xcresultextractor's Issues

No match in graphOutput for targetFilename search causes hang

If the graphOutput doesn't contain the targetFilename then the regex search hangs the script. This can happen if the tests failed before the app even launched (e.g. the app fails to compile), so there's no entry for the app output.

Some investigation suggests that it's down to limitations in python's regex engine that no one's been willing to address due to the effort involved and is likely caused by a bad regex anyway, so possible to solve by the script author (if they're enough of a regex expert).

Example of graphOutput that can cause the hang:

* ActionsInvocationRecord
  - Id: 0~ViderfHG-tjKx31eDlrcCFZ7lPy2wuE4y2vo4xbNPgomTBbBLtWXY_oY9DlOEKXAXAeO_APN3tLJtsZDWABvpA==
  - Size: 129364
  - Refs: 5
    * ActivityLogSection
      - Id: 0~0iVC4vXDH8o3b6GSoiqaSZMTgsP6sg6pTG4gIilVtLqtCVDVk-cBOX_JDOUq2eLiZGPjlvUC8XnhEXBN_orYXg==
      - Size: 11436577
    * CASTree (file or dir)
      - Id: 0~dd8WbHD1pC54m4JODNROAYjzeer5D10hQSwSq6MYiZlYlCEOoAtCxlnDseuq9CfcVS3Y4Lj17r6NJCbJ62Y2Pg==
      - Size: 108
      - Refs: 1
      + UITests-95161872-D4C0-4B1E-8F0D-992DAE6F3366-Configuration-Configuration 1-Iteration-1 (directory)
        * CASTree (file or dir)
          - Id: 0~uvgf1VbnsbNHZK2wbqIVGW6Cue4wKjwl2JC7XiVcHlq9QDYzh778ThaSKkFHJMuxrfPtk0XWFimnCgAl2vYqQQ==
          - Size: 36
          - Refs: 1
          + scheduling.log (plainFile)
            * raw
              - Id: 0~JS3Vdv54JARu0hIXIFMVw0p498mKuRD1kcV29aUwZThJRBn4fK2qome-GEav_4dOf8gqQL_AQk2ogew9GMSv6g==
              - Size: 121
    * ActionsInvocationMetadata
      - Id: 0~eWb2GMD4--4Kr2YVl5KmPZPjfEnO1qJMNRlPLZIRpsKzmAnky8o70g7Q4RWupB4yKODVuXc4_qKisR2HVAJmYw==
      - Size: 475
    * ActivityLogSection
      - Id: 0~wLKGjIRNtB2_yOlkrTvWPI8ekMBwe2tdAL1T5gcTuHmKAL00HGFuylEys6xfgu6LXj6FLU3Py1nn6Q4zIXCspA==
      - Size: 852
    * ActivityLogSection
      - Id: 0~zvTToocgLlp_YbMSA6CoNTeJ4pS80sysrbrAG1nYA4Fbem4MX_4hbQ4JvHG2DqUHe_TWaGnY0MtQ9KJW5BTcdQ==
      - Size: 44943389

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.