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

[Question] Does this support passing individual test files/directories? #24

Open
lyio opened this issue Jul 6, 2022 · 9 comments
Open

Comments

@lyio
Copy link

lyio commented Jul 6, 2022

I tried running my tests by simply calling spec in the root folder and it only picked up tests in a packages/test folder and ignored the ones in the main test folder.

When I pass individual test files as I would with flutter_test as in flutter test test/path/to_test.dart, Spec does not find the tests and runs nothing.

Is using melos in this case required or is there an option I have not yet found?

@rrousselGit
Copy link
Contributor

Hello!

Could you better describe your folder architecture? I'm not sure I understand how your project looks like

@lyio
Copy link
Author

lyio commented Jul 7, 2022

@rrousselGit we have a standard Flutter app folder layout.

- android/
- ios/
- lib/
- packages/
- test/
  - some_test.dart
  - folder1/
    - folder1_test.dart
  - folder2/
    - folder2_test.dart 
- pubspec.yaml

The packages folder

packages/
	- api_client/
	  - lib/
	  - test/
	    - first_test.dart
	    - second_test.dart
	  - pubspec.yaml 

The spec_cli only picks up the tests in the packages folder.

@rrousselGit
Copy link
Contributor

I don't think melos supports both having a root pubspec and a packages folder simultaneously

But I'm sure it could be adapted to do so
cc @Salakar

@lyio
Copy link
Author

lyio commented Jul 7, 2022

We're not using melos, though.

@rrousselGit
Copy link
Contributor

rrousselGit commented Jul 7, 2022

Spec does for you.

@lyio
Copy link
Author

lyio commented Jul 7, 2022

Ah, ok

@Salakar
Copy link
Contributor

Salakar commented Jul 7, 2022

I don't think melos supports both having a root pubspec and a packages folder simultaneously

But I'm sure it could be adapted to do so cc @Salakar

It does support this, even Melos repo itself is setup like this 🤔

@rrousselGit
Copy link
Contributor

As the default format - aka without a melos.yaml?

@Salakar
Copy link
Contributor

Salakar commented Jul 7, 2022

As the default format - aka without a melos.yaml?

Ah no it does not, easy change though by adding another glob here: https://github.com/invertase/melos/blob/main/packages/melos/lib/src/workspace_configs.dart#L516-L522

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants