Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-126925: Modify how iOS test results are gathered#127592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
freakboy3742 merged 12 commits intopython:mainfromfreakboy3742:ios-testbed-wrapper
Dec 9, 2024

Conversation

@freakboy3742
Copy link
Contributor

@freakboy3742freakboy3742 commentedDec 4, 2024
edited
Loading

Xcode 16 deprecated thexcresultool tool we were using to gather test results after an iOS test run.

This tool was less than ideal anyway, as it didn't provide a way to see test results as the test suite was running. As a result, we had intermittent CI test failures that manifested as "test suite didn't finish", with no runtime debugging possible.

This PR adds a new configuration item (config->use_system_logger) for Apple platforms, providing the option to redirect stdout and stderr to the system log. This mirrors how Android operates - the implementation is strongly influenced by the Android implementation, but is just different enough that refactoring into a common base class is more trouble than it's worth IMHO.

This PR also adds a new test runner for iOS projects. This test runner uses the iOS testbed as a template, installing the compiled framework into copy generated from the template; and then building and running the test project in parallel with a log streamer that captures the system log from the iOS simulator as it runs. This allows us to observe test output as the test suite runs.

The test runner also includes options to allows the installation of app code. This means the testbed project can be used to test arbitrary Python code, in addition to the core CPython test suite.

Although this feature is primarily useful for iOS apps, the same codecan be used for macOS apps - something that is useful when embedding Python in to a GUI app (where stdout/stderr isn't visible).

This PR resolves both#126925and#126821; Resolving#126821 was a pre-requisite for fixing#126925 (and is the first commit in this PR), but by itself, there's very little opportunity to evaluate that it's working. You need an updated test runner to be able to observe that stdout/err redirection is working.

Fixes#126925
Fixes#126821


📚 Documentation preview 📚:https://cpython-previews--127592.org.readthedocs.build/

gy-mate reacted with heart emoji
@freakboy3742freakboy3742 added testsTests in the Lib/test dir OS-mac stdlibStandard Library Python modules in the Lib/ directory 3.13bugs and security fixes OS-ios 3.14bugs and security fixes needs backport to 3.13bugs and security fixes labelsDec 4, 2024
@freakboy3742
Copy link
ContributorAuthor

!buildbot iOS

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@freakboy3742 for commit60584e0 🤖

The command will test the builders whose names match following regular expression:iOS

The builders matched are:

  • iOS ARM64 Simulator PR

@freakboy3742
Copy link
ContributorAuthor

Moving to draft because of the test failures on macOS buils

@freakboy3742freakboy3742 marked this pull request as draftDecember 4, 2024 07:34
@freakboy3742
Copy link
ContributorAuthor

!buildbot iOS

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@freakboy3742 for commit89bb435 🤖

The command will test the builders whose names match following regular expression:iOS

The builders matched are:

  • iOS ARM64 Simulator PR

@freakboy3742freakboy3742 marked this pull request as ready for reviewDecember 5, 2024 06:38
@freakboy3742
Copy link
ContributorAuthor

I've now resolved the testing issue; I've also added some documentation for the new capabilities.

@freakboy3742
Copy link
ContributorAuthor

!buildbot iOS

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@freakboy3742 for commit47870c4 🤖

The command will test the builders whose names match following regular expression:iOS

The builders matched are:

  • iOS ARM64 Simulator PR

@freakboy3742
Copy link
ContributorAuthor

I did not make a thorough review especially of the details of how the logging would be configured for a Mac app.

There's no command line interface; it's currently only exposed as an option for embedded-mode apps.Briefcase's stub binary, for example, would be able to add stdout redirection as part of the app startup sequence, rather than requiring thestd-nslog package to install a logging shim at runtime.

@ned-deily I've now made those changes, including surpassing all but the first occurrence of the "Messages dropped..." messages in any block when they occur. Did you want to review this again, or are you OK with me to merge and backport the changes?

@ned-deily
Copy link
Member

LGTM, thanks

freakboy3742 reacted with thumbs up emoji

@freakboy3742freakboy3742 merged commit2041a95 intopython:mainDec 9, 2024
42 checks passed
@miss-islington-app
Copy link

Thanks@freakboy3742 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry,@freakboy3742, I could not cleanly backport this to3.13 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker 2041a95e68ebf6d13f867e214ada28affa830669 3.13

@freakboy3742freakboy3742 deleted the ios-testbed-wrapper branchDecember 9, 2024 05:29
freakboy3742 added a commit to freakboy3742/cpython that referenced this pull requestDec 9, 2024
…honGH-127592)Adds a `use_system_log` config item to enable stdout/stderr redirection forApple platforms. This log streaming is then used by a new iOS test runnerscript, allowing the display of test suite output at runtime. The iOS testrunner script can be used by any Python project, not just the CPython testsuite.(cherry picked from commit2041a95)Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
@bedevere-app
Copy link

GH-127754 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelDec 9, 2024
freakboy3742 added a commit that referenced this pull requestDec 9, 2024
#127754)Adds a `use_system_log` config item to enable stdout/stderr redirection forApple platforms. This log streaming is then used by a new iOS test runnerscript, allowing the display of test suite output at runtime. The iOS testrunner script can be used by any Python project, not just the CPython testsuite.(cherry picked from commit2041a95)
freakboy3742 added a commit to freakboy3742/cpython that referenced this pull requestDec 13, 2024
…onGH-127592) (python#127754)Adds a `use_system_log` config item to enable stdout/stderr redirection forApple platforms. This log streaming is then used by a new iOS test runnerscript, allowing the display of test suite output at runtime. The iOS testrunner script can be used by any Python project, not just the CPython testsuite.(cherry picked from commit2041a95)
freakboy3742 added a commit to freakboy3742/cpython that referenced this pull requestDec 13, 2024
…honGH-127592) (python#127754)Adds a `use_system_log` config item to enable stdout/stderr redirection forApple platforms. This log streaming is then used by a new iOS test runnerscript, allowing the display of test suite output at runtime. The iOS testrunner script can be used by any Python project, not just the CPython testsuite.(cherry picked from commit2041a95)
freakboy3742 added a commit to freakboy3742/cpython that referenced this pull requestDec 13, 2024
…honGH-127592) (python#127754)Adds a `use_system_log` config item to enable stdout/stderr redirection forApple platforms. This log streaming is then used by a new iOS test runnerscript, allowing the display of test suite output at runtime. The iOS testrunner script can be used by any Python project, not just the CPython testsuite.(cherry picked from commit2041a95)
freakboy3742 added a commit to freakboy3742/cpython that referenced this pull requestDec 13, 2024
…honGH-127592) (python#127754)Adds a `use_system_log` config item to enable stdout/stderr redirection forApple platforms. This log streaming is then used by a new iOS test runnerscript, allowing the display of test suite output at runtime. The iOS testrunner script can be used by any Python project, not just the CPython testsuite.(cherry picked from commit2041a95)
freakboy3742 added a commit to freakboy3742/cpython that referenced this pull requestDec 13, 2024
)Adds a `use_system_log` config item to enable stdout/stderr redirection forApple platforms. This log streaming is then used by a new iOS test runnerscript, allowing the display of test suite output at runtime. The iOS testrunner script can be used by any Python project, not just the CPython testsuite.
freakboy3742 added a commit to freakboy3742/cpython that referenced this pull requestDec 13, 2024
…honGH-127592) (python#127754)Adds a `use_system_log` config item to enable stdout/stderr redirection forApple platforms. This log streaming is then used by a new iOS test runnerscript, allowing the display of test suite output at runtime. The iOS testrunner script can be used by any Python project, not just the CPython testsuite.(cherry picked from commit2041a95)
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull requestJan 8, 2025
)Adds a `use_system_log` config item to enable stdout/stderr redirection forApple platforms. This log streaming is then used by a new iOS test runnerscript, allowing the display of test suite output at runtime. The iOS testrunner script can be used by any Python project, not just the CPython testsuite.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ned-deilyned-deilyned-deily approved these changes

@FFY00FFY00Awaiting requested review from FFY00FFY00 is a code owner

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

@erlend-aaslanderlend-aaslandAwaiting requested review from erlend-aaslanderlend-aasland is a code owner

Assignees

@freakboy3742freakboy3742

Labels

3.13bugs and security fixes3.14bugs and security fixesOS-iosOS-macstdlibStandard Library Python modules in the Lib/ directorytestsTests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

"make testios" fails with Xcode 16+ due to changes in xcresulttool Add option for redirecting stdout and stderr to the system log

3 participants

@freakboy3742@bedevere-bot@ned-deily

[8]ページ先頭

©2009-2025 Movatter.jp