Skip to content
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

Convert run_tests to python, allow running on Mac/Windows and allow filters for tests. #9818

Merged
merged 3 commits into from
Jul 16, 2019

Conversation

chinmaygarde
Copy link
Member

@chinmaygarde chinmaygarde commented Jul 12, 2019

Sample usage:

To run only the embedder_unittests in the engine with the profile variant, the command would be

./flutter/testing/run_tests.py --variant host_profile_unopt --type engine --filter embedder_unittests

To run only the geometry in Dart with the debug variant, the command would be

./flutter/testing/run_tests.py --variant host_debug_unopt --type dart --filter geometry_test

Without any arguments, the behavior is identical to run_tests.sh.

In a subsequent patch, I will enable running unit-tests on Windows in the tryjobs. The lack of compatibility of the shell script on Windows made it so that we never ran any Windows unit-tests in the tryjobs.

…lters for tests.

Sample usage:

To run only the embedder_unittests in the engine with the profile variant, the command would be
```
./flutter/testing/run_tests.py —variant host_profile_unopt —type engine —filter embedder_unittests
``

To run only the geometry in Dart with the debug variant, the command would be
```
./flutter/testing/run_tests.py —variant host_debug_unopt —type dart —filter geometry_test
``

Without any argument, the behavior is identical to `run_tests.sh`.

In a subsequent patch, I will enable running unit-tests on Windows in the tryjobs. The lack of compatibility of the shell script on Windows made it so that we never ran any Windows unit-tests in the tryjobs.
@chinmaygarde
Copy link
Member Author

No change in functionality from the current version of the shell script. I will patch the tryjobs and remove the script next.

@chinmaygarde chinmaygarde changed the title Covert run_tests to python, allow running on Mac/Windows and allow filters for tests. Convert run_tests to python, allow running on Mac/Windows and allow filters for tests. Jul 12, 2019
if IsLinux():
RunEngineExecutable(build_dir, 'txt_benchmarks', filter, [ fonts_dir_flag ])

if IsLinux():
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this block was copied twice

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, one of them is a benchmark run.

Copy link
Contributor

@liyuqian liyuqian left a comment

Choose a reason for hiding this comment

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

LGTM with tiny nits.


args = parser.parse_args()

run_engine_tests = args.type == 'engine'
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: args.type in ['engine', 'all'] to save 4 lines below :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Cool. Done.


def RunTests(build_dir, filter, run_engine_tests, run_dart_tests, run_benchmarks):
if run_engine_tests:
RunEngineTests(build_dir, filter)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: the dart tests seem to be also engine tests. Shall we call this RunGtests, RunCppTests, RunCcTests, or just RunUnitTests?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. Used RunCCTests

@liyuqian
Copy link
Contributor

BTW, I changed to -- in the PR description. You may need to manually change them during the merge. I guess the git commit somehow messed up with the copy/paste.

@chinmaygarde chinmaygarde merged commit a59b6a6 into flutter:master Jul 16, 2019
@chinmaygarde chinmaygarde deleted the run_tests_py branch July 16, 2019 00:46
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 16, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants