Skip to content

[BUG] xcparse attachments does not include png/json attachments #84

@JJdeGroot

Description

@JJdeGroot

Describe the bug
When using the xcparse attachments command, only .heic images are extracted from my xctest. The output folder also contains .png images and .json files which are not extracted.

Desktop (please complete the following information):

  • OS: macOS 13.2.1 build 22D68
  • xcparse version: 2.3.1
  • Swift version: 5.8.1
  • XCResult version: 3.39

Crash Report
The DiagnosticReports folder does not contain any xcparse reports.

To Reproduce
Steps to reproduce the behavior:

  1. Create XCTestCase
  2. Use XCTIssue with XCTAttachment to attach a PNG screenshot
  3. Use XCTIssue with XCTAttachment to attach JSON data
  4. Build test, find .xctest location
  5. Run xcparse attachments /path/to/.xcresult /output/path with the right locations

Expected behavior
I expect to receive a folder with all attachments for the test. E.g. the same attachments as I can browse using the Xcode interface.

Additional context
The Xcode output directory looks like this:

IDEResultCache-D7CA4802-DD80-4106-8282-28A9346E918C-55257-0000046BB055F232 % tree
.
├── 0~2QKSXk_fXkTsHPJGs0iqE1oE2oJ23H2s12fhKNzCSTrSpPmPiphWggu-TJRKG0RnRPcjE7bVuf4K-OWcVUzHBw==
│   └── Element snapshot_2_BC641069-A876-42D7-AD9E-54D7CB3B984D.png
├── 0~BuQTrGpXqnd977I76c4YXa-Upu5oQsLFGPcttqCH858WKqfdVfR5raQ-QNb-VPm3aquG3vZvb6gbzydAx-Lpzg==
│   └── Element screenshot_1_BC641069-A876-42D7-AD9E-54D7CB3B984D.png
├── 0~HX82NkiROKN3OSbjkqSttx2NjlMyg5mj0-zE581a3se7JR-UtSsdBu2wrITqNo_drSea0kRU5TWFiaxYu4UO9A==
│   └── Diagnostics
│       ├── AbraTests-A8C90B44-9B69-478C-B8B9-ADFE9F59F19F-Configuration-Test Scheme Action-Iteration-1
│       │   ├── AbraTests-E113A3A6-4679-4423-8CA8-551BDA44E742
│       │   │   ├── Session-AbraTests-2023-08-24_120055-zs75Ia.log
│       │   │   ├── StandardOutputAndStandardError-xxx.xxx.xxx.txt
│       │   │   └── StandardOutputAndStandardError.txt
│       │   └── scheduling.log
│       └── iPhone XXXXX
│           └── testmanagerd.log
├── 0~RQgnd2gIorXiOFhHeYK51GOSHI5EgUKIYmgh6avDoy_haMKTlIaDdPhKB5A6YI7VcZsSe7xK-XR6uS0LY3W-Lg==
│   ├── Screenshot_1_29B55B7F-01F5-480D-B5E7-020E4A6AEEF2.heic
│   └── Screenshot_1_872A04D0-776B-4BD4-9707-66DA5BC5EDF1.heic
├── 0~_4soaPjeoge_8u8tboih21NzssNTe3Y4epOu9eSkfPcA5GMnJlr7GbdIqjbaJNcOSYaz8kj1uQfCBqa0Jh4YAQ==
│   ├── Screenshot_1_53473D18-426F-4EAC-92B7-307C67A414EC.heic
│   └── Screenshot_1_92377D15-AFCF-4A00-B518-C090C276B78E.heic
├── 0~dyU0Q5vAdoMCOmnB25QWpZ3WfKDhY3v39YkjhM8YqO3nTQKRyODYik43gg9EiObqIQ40jAAnxUEIiAXNlt0zPw==
│   ├── Screenshot_1_57C28ABA-FF43-4436-8A4A-1360E5C8BB7D.heic
│   ├── Screenshot_1_5B1D6582-4E7F-4187-9B1D-CD19D0F7A768.heic
│   └── Screenshot_1_B60F278D-A78F-4FB2-AE2F-C14CA60F2A1A.heic
├── 0~py6RqezrHff1Af-25NvN4lai1nkkwawW6BwUyADrkPAygG8FaV0UrFDa6taUOH5AUptUwLRJQhbhY8jOjhAcSg==
│   └── Screenshot_1_CCD2EF25-30E2-4A5D-A0B2-F7C7AAC5A7C2.heic
└── 0~tojreXv06JtyW9zi6QnKUthxF0UPNOBQC0yCGoKln08V8P3epCB7yq5FLt6m57jiamHi8gQt4q0yOUsu5uQLaw==
    └── Element data_3_BC641069-A876-42D7-AD9E-54D7CB3B984D.json

The xcparse output folder looks like this

XcodeScreens % tree
.
├── Screenshot_1_05AB0F74-05EF-4BBA-A957-D2EFAEE04297.heic
├── Screenshot_1_1726F397-FF48-4869-832C-C4125CC266EC.heic
├── Screenshot_1_42381FDC-22CD-484C-B1E9-42A0F200CA00.heic
├── Screenshot_1_509A5C5D-301E-45AE-B96E-DBE954A35B92.heic
├── Screenshot_1_BE7AF80A-F929-41B9-A35A-523108E9D625.heic
├── Screenshot_1_C8EF09E2-9D66-46C4-ABD0-4B822C2057F7.heic
├── Screenshot_1_E2C414BD-9DA7-4083-BB92-A810BCFD3B6E.heic
└── Screenshot_1_E30DCFB8-9111-4683-93D1-0DAAEE08AA58.heic

The .json and .png attachments are missing.

The .heic screenshots are automatically taken by Xcode.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions