-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
--stream prints newlines as \n #994
Comments
Yikes, this is pretty bad. Perhaps this |
This also happens with |
I'm seeing this when running
|
I also ran into this, but it seems to be an issue primarily with
Since lerna/src/ChildProcessUtilities.js Line 52 in d35c7aa
I'm not entirely sure why this is Removing There is a very simple workaround to perform the redirection to // /repo/packages/sub/package.json
"scripts": {
"test": "jest 2>&1"
} // /repo/package.json
"scripts": {
"test": "lerna run test"
} |
I think you can temporarily use exec. It does not have such a problem: lerna exec --scope <scope> --stream -- npm run <scriptName> You can also wrap scripts in package.json (for example with concurrently): "scripts": {
"start": "concurrently: \"<script>\""
} or with npm-run-all: "scripts": {
"start": "npm-run-all --print-name --serial <scriptName>",
"scriptName": "<script>"
} |
Could we possibly discuss this option? What are the possible implications? |
2'nd that - jest is hugely popular and this is making usage of jest very problematic. Also by the comments for jest developers, its working as excepted - so not much hope they would change it. Perhaps some env var or flag that can be used to disable mergeMultiline? when i tested and removed mergeMultiline from
it did work nicely with jest (happy to provide PR if any insight about accepted solution can be provided) |
My question is: why is _anybody_ running jest through lerna? Run it from the root, finish in a fraction of the time, thank me later.
… On Mar 25, 2018, at 17:26, eritikass ***@***.***> wrote:
Removing mergeMultiline in lerna might not break anything (--parallel?), but it seems like it could also have larger implications since lerna run is not limited to running tests.
Could we possibly discuss this option? What are the possible implications?
2'nd that - jest is hugely popular and this is making usage of jest very problematic.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Our use-case, we did merge several heavily connected JS projects into one for more simple management, so we do not have to make multiple PR into different projects same time etc... lerna did help a lot to manage this somewhat ad-hock monorepo. bootstrap to npm install all projects , run to run commands in all projects |
@evocateur, |
Great, so you can let bugs from transitive dependencies pass through. Brilliant strategy to save a few seconds.
… On Mar 25, 2018, at 21:01, Alexey Raspopov ***@***.***> wrote:
@evocateur, yarn lerna run test --since master on a branch allows you to run tests on the only packages that has changes.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@evocateur, by "transitive dependencies" do you mean sibling packages that appeared to be not tested with the command (since weren't changed)? Having "always green master" allows not to run all the tests, since packages weren't modified.
Imagine a dozen of client-side apps in a single repo, each of them with a set of e2e tests. This takes way longer than a few seconds. Especially, on CI server, where a few concurrent PRs are running. |
@evocateur |
@evocateur regarding your question here ☝️ : I have a monorepo in which different packages have different Do you know of an easy way to make this work from root? If not, then this would be an example of a reson for using |
Cursory googling indicates it’s a Jest issue, but separate Jest “projects” might let you configure different transforms on separate testMatch globs?
(It’s unfortunate that Vue Babel plugins can’t play nicely with client & server code)
… On Jul 2, 2018, at 07:04, Jürg Lehni ***@***.***> wrote:
@evocateur regarding your question here:
I have a monorepo in which different packages have different .babelrc files, for backend and frontend / vue.js specific code. I failed to find a nice way so far to set up jest from root in an easy way so it could run all the tests at once and still respect the different .babelrc settings, so I am using it through lerna exec instead.
Do you know of an easy way to make this work from root? If not, then this would be an example of a reson for using lerna exec with Jest.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@evocateur I've tried that but to no avail. It looks like Jest projects aren't picking up the |
@evocateur I found a solution for nested .babelrc and Jest now, but I needed to write my own version of https://github.com/lehni/babel-jest-nested#example-with-lerna |
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Expected Behavior
I run my tests with
lerna run --stream test
, the packages tests are simple Jest tests.The output printed by Lerna doesn't properly renders the newlines, for instance, this is what I get:
Possible Solution
I'm not sure, but it looks like Lerna does something to escape the special characters and forgets to restore them before it prints.
Steps to Reproduce (for bugs)
package/something
with inside itspackage.json
a Jest test commandlerna run --stream test
in the root of the projectlerna.json
lerna-debug.log
Context
This bug makes it very difficult to read the logs, especially in CI
Your Environment
lerna --version
npm --version
yarn --version
node --version
The text was updated successfully, but these errors were encountered: