Skip to content

[Build System: Python] Test restructure #29306

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 5 commits into from
Jan 20, 2020

Conversation

Rostepher
Copy link
Contributor

This PR restructures the Python testing for utils/build_swift to mirror the module structure. Now tests for utils/build_swift/build_swift live in utils/build_swift/tests/build_swift. This allows for scripts in the top level of the module to also have tests that are not inter-mingled with the module tests.

In addition I've added new run_tests.py scripts to swift_build_support and update_checkout which use the standard unittest module to discover and execute the module tests. These scripts are then used by the validation test suite rather than having custom bash commands for each. This should be more reliable and discoverable for developers working on these modules/tools.

@@ -197,18 +197,18 @@ def test_invalid_swift_version(self):
swift_version_type('100.0.56.1')


class TestShellSplitType(object):
class TestShellSplitType(unittest.TestCase):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Turns out this test class was not actually executed because it was subclassing object... whoops.

@Rostepher
Copy link
Contributor Author

@swift-ci please test

@Rostepher Rostepher force-pushed the python-test-restructure branch from b908c98 to 825f56f Compare January 19, 2020 02:55
@Rostepher
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - b908c98e7fd112b021f51fd278d89f180e4d7b82

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - b908c98e7fd112b021f51fd278d89f180e4d7b82

@Rostepher Rostepher force-pushed the python-test-restructure branch from 825f56f to 0bd11e2 Compare January 19, 2020 03:26
@Rostepher
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 825f56f8b787b0bc5f077aa67f1ea7c71530e606

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 825f56f8b787b0bc5f077aa67f1ea7c71530e606

@Rostepher Rostepher force-pushed the python-test-restructure branch from 0bd11e2 to f93bb0a Compare January 19, 2020 03:40
@Rostepher
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 0bd11e2cb0e04dbc4b6ba494fae135324197be06

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 0bd11e2cb0e04dbc4b6ba494fae135324197be06

@Rostepher Rostepher force-pushed the python-test-restructure branch from f93bb0a to e61c987 Compare January 19, 2020 04:40
@Rostepher
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - f93bb0abeafb88fc7124cdf40a5088caba75be9e

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - f93bb0abeafb88fc7124cdf40a5088caba75be9e

Ross Bayer added 5 commits January 19, 2020 01:31
…ts to contain a build_swift directory.

Having the test directory match the module we are testing means we can have scripts in the top level of utils/build_swift which can also have tests. As part of this re-structure the test utilties have been simplified somewhat and all tests no longer use a custom TestCase, rather the standard one exposed by the unittest module.
…swift_build_support which is used to run the unit test suite.
…ls/update_checkout which is used to run the validation test.
…dated the contents to match the other tests.
… was causing the build_swift tests to fail when run with a Python 3 interpreter.
@Rostepher Rostepher force-pushed the python-test-restructure branch from e61c987 to 68bf968 Compare January 19, 2020 09:33
@Rostepher
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - e61c9878d9b6bd42620cef32e9d11a20099edbd2

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - e61c9878d9b6bd42620cef32e9d11a20099edbd2

@Rostepher
Copy link
Contributor Author

I'll likely merge this sometime later today, but only when I have time to keep an eye on bots to make sure nothing breaks. I have a few changes lined up that depend on this patch.

@Rostepher Rostepher merged commit f8f3324 into swiftlang:master Jan 20, 2020
@Rostepher Rostepher deleted the python-test-restructure branch January 20, 2020 01:08
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