ReLaXed
ReLaXed copied to clipboard
Tests failing on arch
running npm test on master currently results on all behavior tests failing on the pixel diff step on my machine running arch.
This seems to be a font issue, see attached screenshots for the bibliography test.
Diff

Expected

Last_test_result

Damn. The tests use the "Times New Roman" (not sure why, but this is the default chrome font on my machine and on travis). We should enforce the font in the tests, to something like Helvetica to make sure all machines have it. Will fix soon.
@Zulko see https://www.cssfontstack.com/Times-New-Roman
?
For the needed CSS rules to set the right font (including the fallback fonts).
Since the tests are only run on Chrome, just setting body {font-family: Georgia} (or any other web-safe font) should be enough, right ? Edit: maybe with a fixed font size too.
Georgia is (almost) the same, we just need to add the fallback fonts. These are all websafe fonts in general.
https://www.cssfontstack.com/Georgia
Keep an eye on the usage stats (the 99.xx% values).
We can't use fallback fonts in our case, because we want the tests to generate the same image on all machines. A priori, the Helvetica solution I propose in my first comment should work.
same
But not equal ;-) We still accept 1% difference in the tests afaik. See https://github.com/RelaxedJS/ReLaXed/blob/master/test/test.js#L62
Helvetica is a non free font which is not bundled with many systems.
7% Windows https://www.cssfontstack.com/Helvetica
oh wow. georgia it is then
After lots of tries, i believe the right solution it to enforce the font in the tests, while making sure that the font is supported everywhere. From what i understand Chrome provides some fonts, or at least defaults to some fonts, which are either Times New Roman or Arial. I have enforced all fonts to Arial in tests, but even then I noticed problems in some cases (chinese characters). So that might be an open issue for some time.
This is also a strong reminder that the same source may produce different results on different people's machines if the CSS specs are not precise enough... which is unfortunate.
Should the issue be renamed accordingly ?
Could you first test if the tests now pass on your machine ? If yes, then we can close this one and maybe reopen a more general one later.