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

update yeoman-test to v9. #27247

Merged
merged 8 commits into from
Sep 11, 2024
Merged

update yeoman-test to v9. #27247

merged 8 commits into from
Sep 11, 2024

Conversation

mshima
Copy link
Member

@mshima mshima commented Sep 11, 2024

Added a mocha cleanup hook that cleanup yeoman-test context on after.
Mocha seems to somehow reuse a fork pwd when creating a new fork.

  • switch to composed generators apis from yeoman-test@v9
  • drop a few more manual cleanup.

Fixes #27019.


Please make sure the below checklist is followed for Pull Requests.

When you are still working on the PR, consider converting it to Draft (below reviewers) and adding skip-ci label, you can still see CI build result at your branch.

@mshima
Copy link
Member Author

mshima commented Sep 11, 2024

Failure is caused by api request, but there is no sample in linked issue.

@DanielFran DanielFran merged commit 6ef476a into jhipster:main Sep 11, 2024
50 of 52 checks passed
@mshima mshima deleted the types branch September 11, 2024 14:18
@emilpaw
Copy link
Contributor

emilpaw commented Sep 12, 2024

@mshima Was a specific change in this PR responsible for the fix of #27019 or was it just fixed as a side effect to the update?

@mshima
Copy link
Member Author

mshima commented Sep 12, 2024

@emilpaw mocha cleanup hooks that I’ve added to yeoman-test:
https://github.com/yeoman/yeoman-test/blob/main/src/mocha-cleanup.hooks.js

after hook runs once per file(thread) in parallel.

yeoman-test cleanups current environment before a new context is created (a new test is run) or on some exit signals.
In the specific case pwd is not been reverted to the original folder, probably due some mocha thread management logic.

  • I don’t know if theads are reused or a new is created.
  • It’s not easy to reproduce with a reduced test samples.

In the end manually forcing a yeoman-test cleanup fixes the issue.

@emilpaw
Copy link
Contributor

emilpaw commented Sep 12, 2024

Thanks for the info @mshima.

I also was not able to find a minimal reproducible example, even after writing a script to automate searching for one. It seemed to require most of the tests and for sure cli-spec was involved.

@mraible mraible added this to the 8.7.1 milestone Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

npm test ends with error.
4 participants