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

Tests are failing because of color schema changes #345

Open
abitrolly opened this issue May 20, 2022 · 6 comments
Open

Tests are failing because of color schema changes #345

abitrolly opened this issue May 20, 2022 · 6 comments

Comments

@abitrolly
Copy link
Collaborator

Tests are failing, because ANSI markup is different. This is a server bug, but need to check it is only for https://cht.sh or if it is repeated with local server in Docker container. Need to turn off upstream query for Docker tests.

-^[[38;5;246;03m# To display everything in <dir>, excluding hidden files:^[[39;00m
+^[[38;5;248;03m# To display everything in <dir>, excluding hidden files:^[[39;00m
@pkhanpara
Copy link

Is it okay, if I take a look at this issue? I would appreciate it if you have any pointers on how to approach it.

@abitrolly
Copy link
Collaborator Author

@poojankhanpara sure. The problem is conversion between cheat text into ANSI sequences. As you see, in ;246; in tests is replaced by ;248; in docker. The ANSI codes look like incomplete 24-bit code https://en.wikipedia.org/wiki/ANSI_escape_code#24-bit Maybe they are invalid.

@pkhanpara
Copy link

Thanks! I tried using both ;246; and ;248; and it turns out it changes the color of the comments to a bit brighter shade of gray. Where is the color added to the comments? Maybe there is no need to turn off upstream tests for docker if we can get the same colored comment on docker too.

@pkhanpara
Copy link

Thinking of adding an option to remove ansi styling with the help of ?T option in run_tests.sh. And carefully recapture the output.

@nega0
Copy link

nega0 commented Aug 9, 2022

The change from ;246;;248; is a result of an update to pygments (pygments/pygments@1458c66). Running

$ CHEATSH_UPDATE_TESTS_RESULTS=YES bash tests/run-tests.sh

will update the results files (tests/results/*) in your working directory. Updating tests/results/* will also take care of some content updates in the various cheatsheet repositories.

Note that there were recent updates to colored that can also trip you up... See #355.

@pkhanpara
Copy link

I tried to run a local server with legacy pygments and colored module and I am still getting the same color change difference.

Somehow tests on live production are passing.
CHEATSH_TEST_STANDALONE="NO" CHTSH_URL="https://cheat.sh" bash tests/run-tests.sh

I have a feeling that recapturing the output might hide the real problem.

@abitrolly abitrolly pinned this issue Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants