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

Change the tests to use require --dev #295

Open
andybroomfield opened this issue Oct 2, 2023 · 4 comments
Open

Change the tests to use require --dev #295

andybroomfield opened this issue Oct 2, 2023 · 4 comments

Comments

@andybroomfield
Copy link
Contributor

Currently the tests install the composer suggest dependencies, but should really use the dev dependencies that are needed to run the tests, so we make sure that the correct dependencies are added to require-dev.

@millnut
Copy link
Member

millnut commented Oct 4, 2023

Hi @stephen-cox this also might be the same reason https://github.com/localgovdrupal/localgov_project/actions/runs/6402689252/job/17379803668 tests are now failing as it's not installing the group require-dev dependency of alert banner

@finnlewis
Copy link
Member

I'm trying to understand why this happens.

When we run:

composer create-project --stability dev localgovdrupal/localgov-project:2.x-dev ./html

Do we expect composer to install the require-dev dependencies of all child packages?

Locally it does not seem to do so. I do not have group module for example which is now in require-dev.

https://github.com/localgovdrupal/localgov_alert_banner/blob/1.x/composer.json#L13

Might it be that composer only installs the require-dev from the root composer.json?

@finnlewis
Copy link
Member

finnlewis commented Oct 6, 2023

Sounds like that is what happens.

Composer only ever installs the packages listed as "require-dev" of your main composer.json file, and if these packages do need something else, then only their "require" packages are installed, but not their "require-dev" packages.

From https://stackoverflow.com/questions/21154216/composer-wont-install-require-dev-packages#:~:text=2%20Answers&text=Composer%20only%20ever%20installs%20the,actually%20is%20a%20good%20thing.

@millnut
Copy link
Member

millnut commented Oct 6, 2023

@finnlewis does that mean that for this module and any others we need to add them as a require-dev dependency to the root composer.json for the project?

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