Can't export Test artifacts

xcode
testing
ios
#1

Hi,

We’ve not had any issues using the xcode-test step, as it works like a charm :+1:

However, we have found an inconsistency in the way it exports the Test artifacts. We’re currently using the Snapshot-Testing library from Pointfreeco, that exports some XCTAttachments when there’s a diff between a reference and a failed screenshot test.

Thanks to your Test Addon, we’re able to see these attachments in the Test Artifacts tab and check what has happened, but we cannot export them out from a Script step as these attachments are not available neither in the $BITRISE_XCRESULT_PATH nor in the $BITRISE_TEST_DEPLOY_DIR.

Being more specific, when we join remotely we can see those attachments here:

/var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/XCUITestOutput538637142/Test.xcresult/Staging/2_Test/Attachments/

but once we download the zip after the Deploy step, it does not contain the Staging and subsequent folders (it’s just /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/XCUITestOutput538637142/Test.xcresult/).

Could you help us here?

0 Likes

#2

Hi @enrique.delpozo,

Thank you for reaching out.

Can you provide a link to a build that reproduces this behaviour please?

Thanks,
Luna

0 Likes

#3

Sure, this one should reflect the issue

https://app.bitrise.io/build/6a6be40c444ca57f#?tab=log

0 Likes

#4

Hi @enrique.delpozo,

I was on sick leave this past little while (bad flu!) so I’m very sorry for the delay in getting back to you. With that said, I am back on the saddle and I hope to check this out shortly. Either me or another person on our team will get back to you soon.

Thanks,
Luna

0 Likes

#5

No worries at all, and I hope you are better now :pray:

Alright, we’re looking forward to hearing from you :+1:

0 Likes

#6

Hello,

FIrst, I’m glad to hear Xcode-test is working like a charm!

To be honest, I’m not exactly sure how the test artifacts are collected/deployed/etc. I suspect the following lines in your build log may be part of what is going on:

Export UITest Artifacts (export_uitest_artifacts) turned on, but Xcode version >= 11. The test result bundle structure changed in Xcode 11 it does not contain TestSummaries.plist and Attachments directly, nothing to export.

I will check and try to get more specifics on what is going on and if there is a possible solution.

Since you know the path of these attachments, I wonder if a script test before deploy to bitrise.io to copy the contents of that directory to $BITRISE_XCRESULT_PATH or $BITRISE_TEST_DEPLOY_DIR would work?

0 Likes

#7

Yeah, Xcode 11 is supposed to not export those attachments anymore but that’s why it’s a bit weird to me that Bitrise manages to display them in the Test Addon.

We’re currently running a script to export all the paths right after the xcode-test step, but all of them are empty. :frowning:

0 Likes