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

test_colors and test_markup_style fail when run in a clean environment #110

Open
Groctel opened this issue Aug 9, 2024 · 7 comments
Open

Comments

@Groctel
Copy link

Groctel commented Aug 9, 2024

I have a script that runs tests for this package before uploading update to the AUR. The two tests mentioned in the title fail when run in this clean environment. Here's a full log of a run of the script displaying the failure: manimpango-log.txt.

I've found issues with other packages that depend on X11 and would fail in my Wayland desktop or in the script, which doesn't support either. Could it be that, like in that case, the SVG processing routines are being leveraged on some system dependency that behaves differently depending on the environment?

Another hypothesis is that there's a version mismatch in some dependency, but I am able to run the tests successfully after updating in my host machine, so I would discard that.

Do you have any idea what could be causing this?

@naveen521kk
Copy link
Member

I don't have any idea why this could be happening. My guess would be an old version of Cairo - maybe try updating it?

@Groctel
Copy link
Author

Groctel commented Sep 17, 2024

The Cairo version is the same for both envs. I've done some research and test_wrap_text only works when the system locales are set to something UTF-8, which makes sense as the assertion error starts with assert '<?xml version="1.0" encoding="UTF-8"?>. I'm figuring out the other two failures, but I may take a while as these are being exceptionally busy weeks for me.

@Groctel
Copy link
Author

Groctel commented Sep 24, 2024

I have isolated the failure of the tests to the presence of cantarell-fonts, which is a package that doesn't pull any dependencies, has no sonames and provides a very conservative amount of installed files.

Does this make any sense to you? At a glance, I don't find any appearances of cantarell in the repo. I see that fontconfig is used for some things, but the package's file doesn't look suspicious at first. If you can't make sense of this either, I'll keep investigating.

@Groctel
Copy link
Author

Groctel commented Sep 25, 2024

After some testing, I'm pretty sure that this is related to a pacman hook that's run when a font is installed. I have tried to run the hook's command manually but I need more knowledge because they always hang 🤔 I''ve added a font to checkdepends to force the hooks to run at least once and then remove it. It's not the cleanest, but it does the trick.

From my side, it's solved albeit not perfect. Feel free to close the issue :)

@naveen521kk
Copy link
Member

If I understand correctly, installing the package cantarell-fonts makes the test suite pass, right? Or is it the other way around?

If that's the case, I think the system didn't have any fonts installed - which is required for the test cases to pass (I could remove that if you want - but manim won't be able to render text that way though).

Could send me the SVG files generated by those test cases, it would be better to see what's happening then. You can probably use https://docs.pytest.org/en/6.2.x/tmpdir.html#the-default-base-temporary-directory and send over the directory as a zip.

@Groctel
Copy link
Author

Groctel commented Sep 27, 2024

Yes, it's only when the font package is installed. It's not an issue having to add at least one font as a check dependency with a note. No need to break manim just for this xD Here's the archive with the test files, thanks for the guide!

tests.zip

@naveen521kk
Copy link
Member

It's not an issue having to add at least one font as a check dependency with a note.

It would be best if you moved it as a dependency or an optional dependency at least. Because without a font installed manim/manimpango can't render text at all (unless using the register_font method).

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

2 participants