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

Update driver script to execute test through test_core #24168

Merged
merged 10 commits into from
Nov 15, 2018

Conversation

jonahwilliams
Copy link
Member

This allows us to remove the package:test requirement for driver scripts. I've only updated one set of tests so we can confirm it is backwards compatible.

Cleanup: moved dev deps on integration/ui into dev deps section

Fixes #24005

// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:test_core/src/executable.dart' as executable; // ignore: implementation_imports
Copy link
Contributor

Choose a reason for hiding this comment

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

This feels a bit too cryptic. Would we recommend that our users do this too? So far the flutter drive command has been a fairly simple convenience command. Some users don't even use it but instead launch their apps and scripts by hand. It seems this will make it less obvious how to run things yourself. Am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair question, this is really more of a cleanup for the flutter repo. It doesn't effect users at all.

A user can write a test which uses package:test and then run the test with dart or pub the same as normal. This is because the package:test entry point is ultimately the same as the package:test_core entry point.

However, this slight refactoring allows flutter/flutter to stop using package test and instead export test_api from our testing shims.

In the future we might could consider exporting test_api from flutter_driver to completely remove the need for package test. This would actually remove the ability to run the test script directly with dart. However, that is not what the change is about.

Copy link
Member Author

Choose a reason for hiding this comment

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

I had another through - we could always make this a command line toggle (something like --flutter-repo), then we can have our cake and eat it too

@yjbanov
Copy link
Contributor

yjbanov commented Nov 11, 2018

lgtm

@jonahwilliams
Copy link
Member Author

@yjbanov PTAL updated to make this functionality flag based (defaulting to false). I believe this removes any risk from the feature.

@jonahwilliams jonahwilliams merged commit 6c62cf3 into flutter:master Nov 15, 2018
@jonahwilliams jonahwilliams deleted the flutter_driver_script branch November 15, 2018 18:50
@jonahwilliams jonahwilliams restored the flutter_driver_script branch November 15, 2018 19:16
jonahwilliams added a commit that referenced this pull request Nov 15, 2018
jonahwilliams added a commit that referenced this pull request Nov 15, 2018
* Revert "Add dashing config file for generating docset from flutter docs (#24374)"

This reverts commit ec8ca86.

* Revert "Update driver script to execute test through test_core (#24168)"

This reverts commit 6c62cf3.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flutter drive should support test_api scripts
3 participants