yeoman / environment

Yeoman runtime environment
BSD 2-Clause "Simplified" License
128 stars 70 forks source link

Hangs in my CI environment, after 3.0.0 and upwards #315

Closed wbern closed 3 years ago

wbern commented 3 years ago

Hey!

It seems like when I do helpers.run(...), the process simply hangs and never starts any generators.

When I revert to 2.10.3, it works.

It's really hard for me to reproduce this because I have no issues running locally. Jenkins CI is running node 14.15.4, same as what I have locally.

Jenkins is also running in a docker container.

breglerj commented 3 years ago

I have the same issue when running tests that use yeoman-test. The tests run locally (Windows and Linux), but fail in the Jenkins pipeline.

github-actions[bot] commented 3 years ago

This issue is stale because it has been open with no activity. Remove stale label or comment or this will be closed

wbern commented 3 years ago

This is still an issue.

breglerj commented 3 years ago

I think the issue is somehow related to the generator namespace. I fixed it by explicitly defining a namespace for the generator I was trying to test:

helpers.run( require( 'generators/app' ), { resolved: path.join( __dirname, 'generators/app' ), namespace: '@my/custom-generator:app' })

In addition I was using a sub-generator in the same project. The sub-generator didn't have the generator- prefix which wasn't an issue with version 2 of yeoman-environment. However, version 3 seems to require that all generator names start with the generator- prefix to be able to correctly resolve them.

github-actions[bot] commented 3 years ago

This issue is stale because it has been open with no activity. Remove stale label or comment or this will be closed

sclarkson-zoomcare commented 2 years ago

@breglerj we were having the exact same issue with Jenkins, and your suggestion resolved it. Thank you!

Dependencies

├─ yeoman-assert@3.1.1
├─ yeoman-environment@3.9.1
├─ yeoman-generator@5.6.1
└─ yeoman-test@6.3.0
└─ mocha@10.0.0

Running Jenkins 2.366