Open llfbandit opened 2 months ago
(|_service)
is some type of regex shell expansion for a specific shell right? Is it just expanding to two versions of the script, one with package_name
and one with package_name_service
as arguments? I don't think it would be possible for us to support this within Melos since startCommand
is using /bin/sh
.
You could try running it through the shell you want to use like melos exec -- "zsh -c flutter test --coverage --coverage-package=MELOS_PACKAGE_NAME(|_service)"
(replace zsh with your shell).
No there's no hidden part here.
coverage-package
is a parameter for flutter test
command. The regular expression is simple String set in melos.yaml
.
I'm on Windows host. Tested with CMD and Powershell.
I suppose the culprit is the pipe ('|') here.
Here's the help text for this parameter.
--coverage-package=<package-name-regexp>
A regular expression matching packages names to include in the coverage report (if coverage is enabled). If unset, matches the current package name.
Ah, I didn't know that was included in --coverage-package
, I think you're just missing some inner quotes then, try this:
melos exec -- "flutter test --coverage --coverage-package='MELOS_PACKAGE_NAME(|_service)'"
Nope same result.
Interesting, I did not get that same result on Linux. Can you try escaping the problematic characters then? Probably both that parenthesis and the pipe.
Escaping does not help.
I transformed the sample expression to this one MELOS_PACKAGE_NAME(_service)?
So, by removing the pipe, the process runs as expected.
Is there an existing issue for this?
Version
5.3.0
Description
This command for example: melos exec -- "flutter test --coverage --coverage-package=MELOS_PACKAGE_NAME(|_service)" will end with an error.
This is not due to the env variable MELOS_PACKAGE_NAME but to the regular expression itself. Tested with other expressions with the same result. I also tried to put the regular expression to an env variable.
Those examples are OK ✅: flutter test --coverage --coverage-package=package_name(|_service)✅ melos exec -- "flutter test --coverage --coverage-package=MELOS_PACKAGE_NAME" => ✅ melos exec -- "flutter test --coverage --coverage-package=package_name" => ✅
Steps to reproduce
Expected behavior
MELOS_PACKAGE_NAME replaced and the regular expression correctly handled to provide deep code coverage
Screenshots
No response
Additional context and comments
No response