Skip to content

Explanation of why no tests ran #651

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
matanlurey opened this issue Jun 17, 2017 · 6 comments
Open

Explanation of why no tests ran #651

matanlurey opened this issue Jun 17, 2017 · 6 comments
Labels
type-enhancement A request for a change that isn't a bug

Comments

@matanlurey
Copy link
Contributor

An excerpt of email by @chalin (emphasis mine):

pub serve test --port=8080
Loading source assets...
Loading angular2, angular2/transform/reflection_remover, test/pub_serve and dart_to_js_script_rewriter transformers...
Pub "serve" started on http://localhost:8080
Serving angular_tour_of_heroes test on http://localhost:8080
Finished compilation. Running tests...
pub run test --pub-serve=8080
No tests ran.

As I assume it is never the intention of the author to use pub run test to run no tests, can test recover and explain why no tests were run? In this particular case it was because all tests were filtered out since the default platform is VM, and all of Patrice's tests were browser based.

I'd like to see:

No tests ran: The default platform "vm" was used, but tests expected: ["browser"].

See goo.gl/xxx for how to configure the test runner for different platforms.

@grouma grouma self-assigned this Jun 19, 2017
@nex3 nex3 added the type-enhancement A request for a change that isn't a bug label Jun 20, 2017
@srawlins
Copy link
Member

Agreed. This is my favorite:

$ cd dart-webdriver
$ git pull upstream master
Already up-to-date.
$ pub get
Resolving dependencies...
...
$ pub run test
00:07 +0: All tests skipped.

Um... yay!

@nex3
Copy link
Member

nex3 commented Jan 12, 2018

I believe the particular issue is due to a bug or SDK incompatibility that should go away when you pub upgrade.

@grouma grouma removed their assignment Oct 17, 2019
@alexZaicev
Copy link

The error still exist in my open project.

My project structure
--root
--lib
--test
---codemetrics
----test_file.dart
----test_file2.dart

When I run pub run test console prints out no test ran

@jakemac53
Copy link
Contributor

jakemac53 commented Apr 16, 2020

@alexZaicev This is because you need to follow the naming conventions, by default the test runner only considers files ending in _test.dart to be tests.

So in this case it would be nice if we printed something like No tests matching the file pattern "*_test.dart"

@alexZaicev
Copy link

@jakemac53 Thanks for the info, I`ll change my file names accordingly.

Can this be added to the documentation? Under section 'Writing Tests'

@grouma
Copy link
Member

grouma commented Apr 16, 2020

It's under the Running Tests section:
https://github.com/dart-lang/test/blob/master/pkgs/test/README.md#running-tests

We probably should add it to the Writing Tests section as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

6 participants