Skip to content

Cleanup playgrounds test driver #3923

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

Merged
merged 1 commit into from
Feb 11, 2022

Conversation

adrian-prantl
Copy link

@swift-ci test

@adrian-prantl
Copy link
Author

I'm seeing mystery errors only in PR testing, I'm hoping that the error assertion will make this more debuggable.

@adrian-prantl
Copy link
Author

For example: #3895

Copy link

@jimingham jimingham left a comment

Choose a reason for hiding this comment

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

Except for the trivial cleanup of using SBError.success rather than comparing str output, this looks correct.

@@ -100,9 +79,10 @@ def execute_code(self, inputFile):
contents = contents_file.read()

result = self.frame.EvaluateExpression(contents, self.options)
ouput = self.frame.EvaluateExpression("get_output()")
output = self.frame.EvaluateExpression("get_output()")
self.assertEquals(str(output.GetError()), 'success')
Copy link

@jimingham jimingham Feb 10, 2022

Choose a reason for hiding this comment

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

SBError has a Success() method and a .success property. Either of those seems more straightforward than relying on the str value.

Choose a reason for hiding this comment

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

Note, there's also an lldbtest.assertSuccess() method that asserts the success of an SB Error and forwards the error message to the test output if it failed. That's probably even more convenient.

Copy link

@kastiglione kastiglione Feb 10, 2022

Choose a reason for hiding this comment

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

there's also an lldbtest.assertSuccess()

TIL!

Copy link
Author

Choose a reason for hiding this comment

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

The intention was that if it fails, we would see the stringified error in the comparsion failure.

Copy link
Author

Choose a reason for hiding this comment

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

oh! That's even better

Copy link
Author

Choose a reason for hiding this comment

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

Due to the extreme latency of the PR testers I might fix that up in a separate PR.

Copy link
Author

Choose a reason for hiding this comment

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

Done. A random build failrue saved the day!

@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl adrian-prantl merged commit 7759619 into swiftlang:stable/20211026 Feb 11, 2022
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.

3 participants