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

[Bug]: Cannot use Datasets in subfolders #1121

Open
dantes4ur opened this issue Mar 25, 2024 · 7 comments · May be fixed by #1134
Open

[Bug]: Cannot use Datasets in subfolders #1121

dantes4ur opened this issue Mar 25, 2024 · 7 comments · May be fixed by #1134
Assignees
Labels

Comments

@dantes4ur
Copy link

What Happened

As part of my transition from Laravel 9 to Laravel 10, I am also upgrading from Pest 1.x to 2.x. During this process, I encountered an issue concerning the resolution of datasets located within subfolders.

I'm not the only one with this problem, please refer to [laracast question] for more details. (https://laracasts.com/discuss/channels/testing/pest-global-datasets-not-allowed-in-modular-project)

How to Reproduce

Construct a dataset and place it within a subfolder inside the Datasets directory. Afterwards, execute the command ./vendor/bin/pest MyTest.php, which unfortunately results in a failure.

However, this situation is peculiar as executing the test through PHPStorm does not present any issues, indicating that the problem only occurs when running the test from the terminal...

Sample Repository

No response

Pest Version

2.34.4

PHP Version

8.2.16

Operation System

macOS

Notes

No response

@dantes4ur dantes4ur added the bug label Mar 25, 2024
@girardotcl
Copy link

Same issue here (it's my post)

@fabio-ivona
Copy link
Collaborator

hi, would you mind to share here your test directory structure?

@dantes4ur
Copy link
Author

Sure, this is my general structure:

Captura de pantalla 2024-03-26 a la(s) 1 37 25 a m

The core issue lies with the handling of Datasets; specifically, the inability to organize them into a Folder/Subfolder structure, as Pest fails to recognize the dataset in such a configuration. This is particularly rare because this limitation was not present in Pest 1.0 afaik...

Captura de pantalla 2024-03-26 a la(s) 1 39 15 a m

Something defined within ExampleDataset.php and ExampleDataset2.php won't be loaded.

Hope this clarifies the issue

@girardotcl
Copy link

Hi !

Thanks for your work.

Any update on this issue ?

@fabio-ivona
Copy link
Collaborator

Hi !

Thanks for your work.

Any update on this issue ?

Working on this one, there are some caveats to fix, will be ready in a couple of days

@girardotcl
Copy link

Awesome, thank you very much for your work !

@fabio-ivona fabio-ivona linked a pull request Apr 11, 2024 that will close this issue
@fabio-ivona
Copy link
Collaborator

I've found a weird behaviour when running parallel tests, maybe someone's willing to have a deeper look here #1134

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