Skip to content

[lldb] Run async tests using back-deployment target #3490

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: stable/20210726
Choose a base branch
from

Conversation

kastiglione
Copy link

For each of the async tests, extract the test body into a function (in some cases this already existed), and then duplicate each test* function to a *_backdeploy test. The back-deploy tests build for macos11, which is a back deployment target.

@kastiglione
Copy link
Author

@swift-ci test

Copy link

@adrian-prantl adrian-prantl left a comment

Choose a reason for hiding this comment

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

Thanks, this is great! I have a couple of questions inside.

def test_backdeploy(self):
"""Test function arguments in async functions"""
self.build(dictionary={
'TARGET_SWIFTFLAGS': f'-target {self.getArchitecture()}-apple-macos11'

Choose a reason for hiding this comment

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

This is the first time I'm seeing these nifty format string literals. Are they supported by all python versions that LLDB can build under?

Copy link
Author

Choose a reason for hiding this comment

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

I'll get rid of these. I forgot that f-strings are Python 3.6+, not all versions of Python 3.

@skipIf(oslist=['windows', 'linux'])
def test_backdeploy(self):
"""Test function arguments in async functions"""
self.build(dictionary={

Choose a reason for hiding this comment

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

Maybe add a comment here that the first macOS to natively support async was macos12?

@swiftTest
@skipIfWindows
@skipIfLinux
@skipIf(archs=no_match(["arm64", "arm64e", "arm64_32", "x86_64"]))

Choose a reason for hiding this comment

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

Why is this necessary? It sounds like this basically excludes i386-apple-macos11, which I think isn't a thing?
On the other hand we may need to @skipDarwinEmbedded since the triple explictly asks for macos.

Copy link
Author

Choose a reason for hiding this comment

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

I'll review and fix these. You're no doubt right. I duplicated the existing function and kept its decorations without looking closely at them.

def test_actor_backdeploy(self):
"""Test async unwind"""
self.build(dictionary={
'TARGET_SWIFTFLAGS': f'-target {self.getArchitecture()}-apple-macos11'

Choose a reason for hiding this comment

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

I'm curious if this is better than using SWIFTFLAGS_EXTRAS. Are the makefiles themselves defining SWIFTFLAGS_EXTRAS?

Copy link
Author

Choose a reason for hiding this comment

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

Yes the Makefiles are defining SWIFTFLAGS_EXTRAS. I believe it didn't work when I tried. I can double check.

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