Skip to content

Fix test order in one file on ios #3020

Draft
Kendru98 wants to merge 1 commit into
fix/xcode-26-4-issuefrom
fix/order-of-tests-on-ios
Draft

Fix test order in one file on ios #3020
Kendru98 wants to merge 1 commit into
fix/xcode-26-4-issuefrom
fix/order-of-tests-on-ios

Conversation

@Kendru98

@Kendru98 Kendru98 commented Mar 31, 2026

Copy link
Copy Markdown
Collaborator

Potential fix for #2944

@github-actions github-actions Bot added the package: patrol Related to the patrol package (native automation, test bundling) label Mar 31, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds a new end-to-end test file and modifies the iOS test runner to include a numeric prefix in dynamic selector names, ensuring a specific execution order. A review comment suggests refining the selector naming convention by using underscores instead of spaces and adding a 'test_' prefix to improve compatibility with test reporting tools and IDEs.

XCTAssertTrue(passed, @"%@", details); \
}); \
SEL selector = NSSelectorFromString(dartTestName); \
NSString *selectorName = [NSString stringWithFormat:@"%05lu %@", (unsigned long)i, dartTestName]; \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The selector name is constructed using a space as a separator (e.g., 00000 my test). While technically allowed by the Objective-C runtime, selectors with spaces are highly unconventional and can break compatibility with test reporting tools, CI systems (like those parsing JUnit XML), and IDE integrations (such as the Xcode Test Navigator) that expect valid C-style identifiers. It is recommended to use an underscore as a separator and prefix the selector with test_ to align with standard XCTest naming conventions.

Suggested change
NSString *selectorName = [NSString stringWithFormat:@"%05lu %@", (unsigned long)i, dartTestName]; \
NSString *selectorName = [NSString stringWithFormat:@"test_%05lu_%@", (unsigned long)i, dartTestName]; \

@Kendru98 Kendru98 changed the title Add initial end-to-end tests for order functionality and update selec… Fix test order in one file on ios Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: patrol Related to the patrol package (native automation, test bundling)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant