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

Multi app setup breaks if vendor dependency contains codeception.yml file #6535

Open
calvinalkan opened this issue Aug 3, 2022 · 4 comments

Comments

@calvinalkan
Copy link
Contributor

The following root config

include:
  - src/components/*

Will recursively traverse all directories inside src/components and look for codeception.yml files.

Now I faced the following situation:

A dependent of one component forgot to put codeception.yml into .gitattributes so that it ends up in the directory when installed with composer.

src/components/component-a/vendor/some-dependency/codeception.yml

When running tests for all included suites, codeception will also try to run tests for src/components/component-a/vendor/some-dependency.

This is due to the fact that the include config is passed here as is into Finder::in() from symfony/finder.

This method makes the finder traverse all child directories recursively which leads to src/components/component-a/vendor/some-dependency/codeception.yml getting picked up.

At least I find this behavior confusing. Given the above configuration I expect only direct child directories of src/components to be evaluated by codeception and not the entire tree under src/components.

Possible fixes:

Assuming this is a bug and not intended, there a two ways to fix this.

  1. Limit finder depth to 0, this will include only direct child directories.
  2. Exclude vendor directories from search
@Naktibalda
Copy link
Member

How do you avoid version conflicts when components have different versions of the same libraries installed?

@calvinalkan
Copy link
Contributor Author

@Naktibalda https://github.com/symplify/monorepo-builder

This hoists all vendor deps to the root codeception.yml

@calvinalkan
Copy link
Contributor Author

@Naktibalda Why is that relevant tho?

Do you think that this is a bug, if yes Ill create a PR.

@tacman
Copy link

tacman commented Sep 15, 2022

On a somewhat related note, since it's on the same line (

$configFiles = Finder::create()->files()
->name('/codeception(\.dist\.yml|\.yml)/')
->in(self::$dir . DIRECTORY_SEPARATOR . $include);
), what about allowing .yaml as an extension? .yml seems so Windows-y, even DOS, the 3-letter file extension.

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

No branches or pull requests

3 participants