test(nix): run font compatibility regressions in CI

This commit is contained in:
lucannez64 committed 2026-10-20 13:57:05 +02:00
1 parent eb962b8c9f
commit c686798ddb
5 files changed
+13 -7

No files matched your search

+2
View File
@@ -21,6 +21,8 @@ jobs:
- run: python tools/riot-launcher-offline-check.py
- run: python tools/riot-runtime-cleanup-offline-check.py
- run: python tools/riot-cdn-dns-offline-check.py
- run: python -m unittest discover -s tests -p 'test_nix_fonts.py'
- run: python -m unittest discover -s tests -p 'test_nix_repairs.py'
- run: python -m unittest discover -s tests -p 'test_hidden_riot_recovery.py'
- run: python -m unittest discover -s tests -p 'test_desktop_run.py'
- run: python -m unittest discover -s tests -p 'test_urlsession_runner.py'
+4 -3
View File
@@ -215,9 +215,10 @@ the host's `/usr/share/fonts`, which the FHS environment replaces. Fonts in your
user font directories remain available. This also prevents an icon-only user
font inventory from becoming the only fallback for ordinary text.
Inherited `FONTCONFIG_PATH` and `FONTCONFIG_SYSROOT` overrides are cleared inside
the FHS environment so foreign include paths or an invalid sysroot cannot hide
the packaged fonts. Custom XDG font/configuration directories and legacy
The FHS environment selects the packaged fontconfig configuration and clears
inherited `FONTCONFIG_PATH` and `FONTCONFIG_SYSROOT` overrides. Clearing the
sysroot prevents it from redirecting the packaged configuration and font paths.
Custom XDG font/configuration directories and legacy
`~/.fonts` remain supported, including paths with spaces. The host configuration
and user font files are not modified.
+2
View File
@@ -19,6 +19,8 @@
fontDirectories = darlingFonts;
includes = [
"${pkgs.fontconfig.out}/etc/fonts/conf.d"
# makeFontsConf adds XDG font directories, but neither it nor
# conf.d/50-user.conf adds the legacy ~/.fonts directory.
(pkgs.writeText "darling-user-fonts.conf" ''
<fontconfig>
<dir>~/.fonts</dir>
+3 -3
View File
@@ -88,9 +88,9 @@ class NixFontsConfigTest(unittest.TestCase):
self.assertNotIn("FONTCONFIG_SYSROOT", resulting_env)
self.assertNotIn("FONTCONFIG_PATH", resulting_env)
self.assertTrue(
resulting_env.get("FONTCONFIG_FILE", "").startswith("/nix/store/"),
f"Unexpected FONTCONFIG_FILE: {resulting_env.get('FONTCONFIG_FILE')}",
self.assertEqual(
resulting_env.get("FONTCONFIG_FILE"),
"/nix/store/mock-darlingFontsConf",
)
self.assertEqual(resulting_env.get("XDG_DATA_HOME"), "/tmp/mock-xdg data with spaces")
self.assertEqual(resulting_env.get("XDG_CONFIG_HOME"), "/tmp/mock-xdg config with spaces")
+2 -1
View File
@@ -454,7 +454,8 @@ class SessionTests(unittest.TestCase):
self.assertIn('terminal', result.stderr.lower())
self.assertFalse((root / 'build').exists())
self.assertIn('Terminal=true', (ROOT / 'flake.nix').read_text())
self.assertIn('checks.${system}', (ROOT / 'flake.nix').read_text())
self.assertIn('packaging = pkgs.runCommand "darling-lol-packaging-tests"',
(ROOT / 'flake.nix').read_text())
def test_rootless_update_refuses_live_marker_without_build_or_stop(self):
with tempfile.TemporaryDirectory(prefix='nix-update-idle-') as directory: