Open chenrui333 opened 1 year ago
It is super weird in the sense that we cannot reproduce outside CI.
I assume you're running this with the environment variable CI
being set?
Due to some CIs incorrectly emulating a terminal (looking at you CircleCI), we added a check for this env-var, and upon presence assume we're not writing to a proper terminal. This will essentially disable color checks and styled output.
I assume you're running this with the environment variable
CI
being set?Due to some CIs incorrectly emulating a terminal (looking at you CircleCI), we added a check for this env-var, and upon presence assume we're not writing to a proper terminal. This will essentially disable color checks and styled output.
yeah, it only happens in the CI (which is essentially github hosted runner with ubuntu 22.04), but when I actually ssh to the runner, and I can actually run tests just fine there.
When you said environment variables need to be configured, what at the environment variables did you refer to?
Try to unset CI
manually and see if it behaves: unset CI
.
I dont think we have CI
set for any of the CI runs.
Is there any way that we can pinpoint that is the issue. Say if I set the CI
for my action run (my action run were successful but that was outside the regular homebrew PR flow), I should be able to reproduce it?
CI
is automatically set by Github Actions: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
it just works when directly running inside the linux runner
runner@fv-az357-374:/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core$ env | grep "CI="
CI=true
runner@fv-az357-374:/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core$ brew test -d -v glow
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/glow.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/go.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/shared/git --version
==> Testing glow
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/test.rb (Formulary::FromPathLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/glow.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/test.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gcc@11.rb
==> /home/linuxbrew/.linuxbrew/Cellar/glow/1.5.0/bin/glow test.md
runner@fv-az357-374:/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core$
Same when I did unset CI
runner@fv-az357-374:/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core$ unset CI
runner@fv-az357-374:/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core$ env | grep "CI="
runner@fv-az357-374:/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core$ brew test -d -v glow
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/glow.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/go.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/shared/git --version
==> Testing glow
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/test.rb (Formulary::FromPathLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/glow.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/test.rb (Formulary::FormulaLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gcc@11.rb
==> /home/linuxbrew/.linuxbrew/Cellar/glow/1.5.0/bin/glow test.md
is this still a problem?
yeah, still an issue per this PR build, https://github.com/Homebrew/homebrew-core/pull/176422
per my tests here, I think this behavior change at some point, so now probably the best bet is to change the test case.
i did make it better respect colorprofiles, but it still will render the bolds and all that, even in ascii.
ah, or you can force no tty:
glow -s notty test.md
good to know, let me update the test :)
still no luck
==> /home/linuxbrew/.linuxbrew/Cellar/glow/1.5.1/bin/glow -s notty /tmp/glow-test-20240710-10155-5zgmvy/test.md
Error: glow: failed
Error: glow: failed
An exception occurred within a child process:
Minitest::Assertion: Expected /\#\ header/ to match "\n\n".
yeah, I think this is still the old version, it should work when the new one is released
👋 trying to build the latest release, but run into some build issue. The error log is as below:
test failure
``` ==> /home/linuxbrew/.linuxbrew/Cellar/glow/1.5.0/bin/glow test.md Error: glow: failed An exception occurred within a child process: Minitest::Assertion: Expected /\#\ header/ to match "\n\n". ```full build log, https://github.com/Homebrew/homebrew-core/actions/runs/4009756850/jobs/6885554006 relates to Homebrew/homebrew-core#121337