Skip to content

Conversation

msd117c
Copy link
Contributor

@msd117c msd117c commented Apr 29, 2025

Proposal to fix the issue reported here.

When the xcode execution log prints a test failure with an unknown class, the parser does not detect the error trace with the current regex expression, expecting a proper class path (/path/to/class):

...
<DebugLogPrinter> <unknown>:0: error: -[TestTarget.Tests testAccessibility] : Element has no description
<DebugLogPrinter>     t =     4.79s Find the Any (Descendant with identity binding to AX element pid: 62723, elementOrHash.elementID: 105553170498336.190)
<DebugLogPrinter>     t =     4.80s Checking existence of `"empty state view" StaticText`
<DebugLogPrinter>     t =     4.81s Find the "empty state view" StaticText
...

which results into the following failure tag:

    ...
    <testcase name="testAccessibility" time="13.387" classname="TestTarget.Tests">
      <failure></failure>
    </testcase>
    ...

For now I do not understand why the log says "unknown" class. However, this change would provide some information on the JUnit XML report about the stacktrace, as a first step to tackle the issue.

Note 1: When multiline stacktrace the parser only captures the first line.
Note 2: as an additional change the related test could be parameterized to simplify the addition of new tests / maintenance of the test.

@Malinskiy Malinskiy marked this pull request as ready for review April 29, 2025 10:50
@Malinskiy Malinskiy self-requested a review as a code owner April 29, 2025 10:50
@Malinskiy
Copy link
Member

<unknown>:0: error indicates a failure in some compiler-generated code that doesn't have a source, hence it has nothing to point to. Approved.

}
data class TestData(val caseName: String, val targetName: String)

class TestDataProvider : ArgumentsProvider {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreaciate the time to redo this properly

@Malinskiy Malinskiy merged commit 23a2a56 into MarathonLabs:develop Apr 29, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants