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
mermaid-cli 8.8.4 (new formula) #65521
Conversation
code style issue
|
Yes that's the missing test. I left that in so that the test can be added to the right section. |
This test seems like a good idea. And please also update the version as you indicated. |
@SMillerDev Thanks for the feedback, will incorporate. Would you mind quickly helping me with the test? This is what I currently have: test do
shell_output("\
cat << EOF | mmdc -o testpath/out.svg\
sequenceDiagram\
participant Alice\
participant Bob\
Alice->>John: Hello John, how are you?\
loop Healthcheck\
John->>John: Fight against hypochondria\
end\
Note right of John: Rational thoughts <br/>prevail!\
John-->>Alice: Great!\
John->>Bob: How about you?\
Bob-->>John: Jolly good!\
EOF\
")
assert_predicate testpath/"out.svg", :exist?
end How do I send the variable Also, just for posterity, my two other questions again, if you wouldn't mind helping me here as well:
Thanks! |
Just updating your code so I can use the github review tools is much easier. Please push your (non-functional) code and I'll review it. |
Sorry about that, one sec. |
I cannot create a commit for the bottles and dependencies questions since this is more about setup ut everything else should be up-to-date now. |
For certain languages this is automatically downloaded. JavaScript is one of these so no need to declare them manually.
Unless you're downloading a single binary that can run anywhere (like a |
Ok, thanks for the feedback and help! It's my first formula so really appreciated! |
@SMillerDev I'm still not able to find the file with |
It could be, if you run |
Just ran it with The path is correctly substituted as the command is displayed as |
|
@BastianZim , you have an indentation-related syntax issue in your formula (https://github.com/Homebrew/homebrew-core/pull/65521/checks?check_run_id=1464363067). Run If the Mermaid syntax depends on proper indentation, this may also be the source of your current headache. |
Just to confirm, you mean:
==> mmdc -i /private/tmp/mermaid-cli-test-20201127-97029-g7kwsl/test.mmd -o /private/tmp/mermaid-cli-test-20201127-97029-g7kwsl/out.svg
/usr/local/Homebrew/Library/Homebrew/debrew.rb:18:in `raise'
Test::Unit::AssertionFailedError: <#<Pathname:/private/tmp/mermaid-cli-test-20201127-97029-g7kwsl/out.svg>>.exist? is true value expected but was
<false>
1. raise
2. ignore
3. backtrace
4. irb
5. shell
Tried that and it doesn't work. Strange this is, when I then just run |
Thanks for the heads-up @gromgit, should be fixed with c866b45
Unfortunately, mermaid is fine with the indentation. I ran the output file through it separately and it worked perfectly fine, just not in this context. |
Just to sum it up: If I run ==> Testing mermaid-cli
==> mmdc -i /private/tmp/mermaid-cli-test-20201127-98550-1clnvz3/test.mmd -o /private/tmp/mermaid-cli-test-20201127-98550-1clnvz3/out.svg
==> Kept temporary files
Temporary files retained at /private/tmp/mermaid-cli-test-20201127-98550-1clnvz3
Error: mermaid-cli: failed
An exception occurred within a child process:
Test::Unit::AssertionFailedError: <#<Pathname:/private/tmp/mermaid-cli-test-20201127-98550-1clnvz3/out.svg>>.exist? is true value expected but was
<false>
/Library/Ruby/Gems/2.6.0/gems/test-unit-3.2.9/lib/test/unit/assertions.rb:55:in `block in assert_block'
/Library/Ruby/Gems/2.6.0/gems/test-unit-3.2.9/lib/test/unit/assertions.rb:1631:in `_wrap_assertion'
/Library/Ruby/Gems/2.6.0/gems/test-unit-3.2.9/lib/test/unit/assertions.rb:53:in `assert_block'
/Library/Ruby/Gems/2.6.0/gems/test-unit-3.2.9/lib/test/unit/assertions.rb:1392:in `block in assert_predicate'
/Library/Ruby/Gems/2.6.0/gems/test-unit-3.2.9/lib/test/unit/assertions.rb:1636:in `_wrap_assertion'
/Library/Ruby/Gems/2.6.0/gems/test-unit-3.2.9/lib/test/unit/assertions.rb:1383:in `assert_predicate'
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/mermaid-cli.rb:33:in `block in <class:MermaidCli>'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1884:in `block (3 levels) in run_test'
/usr/local/Homebrew/Library/Homebrew/utils.rb:500:in `with_env'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1883:in `block (2 levels) in run_test'
/usr/local/Homebrew/Library/Homebrew/formula.rb:901:in `with_logging'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1882:in `block in run_test'
/usr/local/Homebrew/Library/Homebrew/mktemp.rb:63:in `block in run'
/usr/local/Homebrew/Library/Homebrew/mktemp.rb:63:in `chdir'
/usr/local/Homebrew/Library/Homebrew/mktemp.rb:63:in `run'
/usr/local/Homebrew/Library/Homebrew/formula.rb:2129:in `mktemp'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1876:in `run_test'
/usr/local/Homebrew/Library/Homebrew/test.rb:43:in `block in <main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:93:in `block in timeout'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `block in catch'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `catch'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `catch'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:108:in `timeout'
/usr/local/Homebrew/Library/Homebrew/test.rb:42:in `<main>' because no file was created. If I then only run |
To add: Running I also created a file containing only the command and that worked as well. Could it be that something in brew disables something in mermaid? Because, to be honest, I have absolutely no idea why it's just not doing anything, but only when it's called in the brew file, with everything else working completely fine. Also, running test = `mmdc -h`
puts test correctly outputs Usage: mmdc [options]
Options:
-V, --version output the version number
-t, --theme [theme] Theme of the chart, could be default, forest, dark or neutral. Optional. Default: default (default: "default")
-w, --width [width] Width of the page. Optional. Default: 800 (default: "800")
-H, --height [height] Height of the page. Optional. Default: 600 (default: "600")
-i, --input <input> Input mermaid file. Required.
-o, --output [output] Output file. It should be either svg, png or pdf. Optional. Default: input + ".svg"
-b, --backgroundColor [backgroundColor] Background color. Example: transparent, red, '#F0F0F0'. Optional. Default: white
-c, --configFile [configFile] JSON configuration file for mermaid. Optional
-C, --cssFile [cssFile] CSS file for the page. Optional
-s, --scale [scale] Puppeteer scale factor, default 1. Optional
-f, --pdfFit Scale PDF to fit chart
-p --puppeteerConfigFile [puppeteerConfigFile] JSON configuration file for puppeteer. Optional
-h, --help display help for command so the tool itself works. |
Checked out and tried your PR on my own box, and I can confirm that something in the test environment is stopping Then I looked at the $ ls -lR /usr/local/opt/mermaid-cli/
...
/usr/local/opt/mermaid-cli/libexec/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer:
total 60
drwxr-xr-x 3 aho admin 96 Nov 28 10:12 .local-chromium/
-rw-r--r-- 1 aho admin 1132 Oct 26 1985 CHANGELOG.md
-rw-r--r-- 1 aho admin 11344 Oct 26 1985 LICENSE
-rw-r--r-- 1 aho admin 22441 Oct 26 1985 README.md
-rw-r--r-- 1 aho admin 1289 Oct 26 1985 cjs-entry-core.js
-rw-r--r-- 1 aho admin 1274 Oct 26 1985 cjs-entry.js
-rw-r--r-- 1 aho admin 2792 Oct 26 1985 install.js
drwxr-xr-x 4 aho admin 128 Nov 28 10:11 lib/
-rw-r--r-- 1 aho admin 4005 Oct 26 1985 package.json
-rw-r--r-- 1 aho admin 2053 Oct 26 1985 typescript-if-required.js
/usr/local/opt/mermaid-cli/libexec/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer/.local-chromium:
total 0
drwxr-xr-x 3 aho admin 96 Nov 28 10:12 mac-818858/
/usr/local/opt/mermaid-cli/libexec/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer/.local-chromium/mac-818858:
total 0
drwxr-xr-x 3 aho admin 96 Nov 28 10:12 chrome-mac/
/usr/local/opt/mermaid-cli/libexec/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer/.local-chromium/mac-818858/chrome-mac:
total 0
drwxr-xr-x 3 aho admin 96 Nov 28 10:12 Chromium.app/
/usr/local/opt/mermaid-cli/libexec/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer/.local-chromium/mac-818858/chrome-mac/Chromium.app:
total 0
drwxr-xr-x 7 aho admin 224 Nov 28 10:12 Contents/
/usr/local/opt/mermaid-cli/libexec/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer/.local-chromium/mac-818858/chrome-mac/Chromium.app/Contents:
total 16
drwxr-xr-x 3 aho admin 96 Nov 28 10:12 Frameworks/
-rw-r--r-- 1 aho admin 10387 Nov 28 10:12 Info.plist
drwxr-xr-x 3 aho admin 96 Nov 28 10:12 MacOS/
-rw-r--r-- 1 aho admin 8 Nov 28 10:12 PkgInfo
drwxr-xr-x 59 aho admin 1888 Nov 28 10:12 Resources/
... Sure enough,
|
Awesome, that's it, reproduced it on my side. Thanks for investigating that! Is there any way to mitigate that? Otherwise, I think, I'm forced to use |
I'd consider this a bug that upstream needs to fix. I wouldn't accept a help test just because the browser they ship with the CLI tool doesn't like sandboxes. |
This comment has been minimized.
This comment has been minimized.
Found the problem: Puppeteer (and then Chrome) launches in its own sandbox which doesn't play nice with brew apparently. (Also see https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#setting-up-chrome-linux-sandbox) When using |
Closes #67789. Signed-off-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
* lasi: fix shim path pollution This failed auditing due to: * Files were found with references to the Homebrew shims directory. The offending files are: share/lasi1.1.3/examples/Makefile This is basically the same issue I had with plplot's Makefiles.examples (#66985) Similar fix works. * lasi: address review comments Closes #67592. Signed-off-by: chenrui <chenrui333@gmail.com> Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
Closes #67517. Signed-off-by: chenrui <chenrui333@gmail.com> Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
This LGTM. @BastianZim, can you rebase this against master (and squash your commits) so that CI can re-run it? |
* cargo-audit 0.13.1 (new formula) * cargo-audit: depends_on openssl * cargo-audit: add success test * cargo-audit: simplify assertion check Closes #67711. Signed-off-by: Rui Chen <rui@meetup.com> Co-authored-by: chenrui <rui@meetup.com> Signed-off-by: chenrui <chenrui333@gmail.com>
Closes #67712. Signed-off-by: Rui Chen <rui@meetup.com> Signed-off-by: Dawid Dziurla <dawidd0811@gmail.com> Signed-off-by: chenrui <chenrui333@gmail.com>
* graphicsmagick 1.3.36 * graphicsmagick: add license * graphicsmagick: leave license for separate PR Closes #67780. Co-authored-by: chenrui <rui@meetup.com> Signed-off-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
Closes #67791. Signed-off-by: Rui Chen <rui@meetup.com> Signed-off-by: chenrui <chenrui333@gmail.com>
Hmmm. The problem seems to be that you made your changes in the I think this might work (back up your formula first in case something goes awry):
Once you've done that, you'll want to do |
@carlocab Thanks for the feedback! Yeah, master seems to be the problem as it's always pulling in all the commits when rebasing. I followed your advice but still have all the commits. If it's alright with you, I would open a new PR, use a separate branch this time and ping you from there. |
Closing in favour of new PR: #67804 |
mermaid-cli 8.8.1 (new formula)
Added mermaid-cli
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?I have not added a test yet as I do not know how to, unfortunately. mermaid-cli converts graphs written in markdown to images which is difficult to test for as a failed conversion will sometimes still result in an image.
What I would recommend is running
mmdc -h
which outputsbut I'm not sure how to assert that a multi-line output is the same?
Another way could be to download a file as outlined in the cookbook but I would need to ask the maintainers to create and save such a file to the repo. Since I'm not the owner I cannot guarantee that they will allow this.
Edit: I'm actually not sure anymore if making sure that the image is correct, is needed. Since we're only testing if mermaid-cli works, we can establish that and any problem with the image should be taken up with mermaid-cli.
In that case, a test could be to run the following:
(Not sure how to write that in ruby)
and then
Any advice here would be appreciated.
brew audit --strict <formula>
(after doingbrew install <formula>
)?Except for the test part it does.
Additional Comments:
The project declares dependencies on their npm website which seem to be downloaded by brew when installing it (at least that's what happened to me).
I don't know enough about dependencies though, unfortunately, to answer if they are needed, or not, so this is the list of dependencies I could find:
Any advice here would be appreciated.
The version on GitHub is 8.8.3 but the one on npm is 8.8.1. which I'm currently using. I have created an issue to check if npm is still being maintained. NPM version vs GitHub mermaid-js/mermaid-cli#78Edit: npm has been updated to 8.8.3-2 Should I update this in a new commit or create a new PR?