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

restore Init package --install based test cases #787

Open
1 of 5 tasks
thescientist13 opened this issue Nov 3, 2021 · 3 comments · May be fixed by #931
Open
1 of 5 tasks

restore Init package --install based test cases #787

thescientist13 opened this issue Nov 3, 2021 · 3 comments · May be fixed by #931
Assignees
Labels
chore unit testing, maintenance, etc Init sponsorship:eligible
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Nov 3, 2021

Type of Change

  • New Feature Request
  • Documentation / Website
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

As part of #777 to introduce the new Init package, one issue that came up was that when running yarn install as part of the test suite, warnings were getting thrown as errors.

0 passing (3s)
  1 failing

  1) Scaffold Greenwood With Yarn: 
       default minimal template
         "before all" hook in "default minimal template":
     Error: the string "warning @greenwood/cli > markdown-toc > gray-matter > coffee-script@1.12.7: CoffeeScript on NPM has moved to \"coffeescript\" (no hyphen)\n" was thrown, throw an Error :)
      at processTicksAndRejections (node:internal/process/task_queues:93:5)

This would cause the test to fail, though there was nothing really wrong at all.

While using ignore for the stdio does help pass the test

 const process = spawn(pkgCommand, args, { stdio: 'ignore' });

The result would be that users would not get any install logs at all when running @greenwood/init during the install step which is confusing and potentially disruptive, making the user think something has broken and potentially cancelling out the whole operation.

 % npx @greenwood/init --install
-------------------------------------------------------
Initialize Greenwood Template ♻️
-------------------------------------------------------
Initialzing project with files...
Creating manifest (package.json)...
Installing project dependencies...

# terminal just "hangs" here while install happens 

Initializing new project complete!
owenbuckley@Owens-MBP-2 my-app %

Details

Would like to restore this test case while still keeping the stdio setting such that the install logs still show. Not sure if this is something to fix in gallinago or something we can work around in our test setup or not, so making this issue to track and try and resolve.

Here is the PR that reverted the stdio setting and had the relevant specs set to xdescribe. What is interesting is that Windows action passed, but the Linux one failed even for npm. Probably more to do with how process spawning is handled between the too.

@thescientist13 thescientist13 added help wanted Extra attention is needed chore unit testing, maintenance, etc Init labels Nov 3, 2021
@thescientist13 thescientist13 changed the title restore Init package Yarn test case restore Init package --install` based test cases Nov 3, 2021
@thescientist13 thescientist13 changed the title restore Init package --install` based test cases restore Init package --install based test cases Nov 3, 2021
@thescientist13 thescientist13 added this to the 1.0 milestone Nov 4, 2021
@thescientist13
Copy link
Member Author

Maybe this could get solved by using NODE_NO_WARNING=1?

@thescientist13
Copy link
Member Author

From https://github.com/ProjectEvergreen/greenwood/pull/992/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R25, we will want to figure out how to enable the init test cases on Windows, but wasn't getting a lot of debug info out of it, so just deferred to this ticket instead.

@thescientist13
Copy link
Member Author

So reviewing this again, it seems like the issue is just down the Yarn specs, but there is a new (thankfully very relevant!) error, related to a deprecation in rollup-plugin-terser now.

 1) Scaffold Greenwood With Yarn:
       default minimal template
         "before all" hook in "default minimal template":
     Error: the string "warning @greenwood/cli > rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser\n" was thrown, throw an Error :)

And so in fact, that plugin is indeed deprecated, and has moved to @rollup organization
https://www.npmjs.com/package/@rollup/plugin-terser
Screen Shot 2022-11-29 at 9 11 11 PM

So I'm thinking if we can clear that up, maybe I can take another run at this, but will need the package upgrade to flow through mainline Greenwood first into the template repo. 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore unit testing, maintenance, etc Init sponsorship:eligible
Projects
Status: 📋 Backlog
Development

Successfully merging a pull request may close this issue.

1 participant