Skip to content

Fix fonts test path and cover more cases in testFontStripping - #5788

Open
janinadavydova wants to merge 2 commits into
masterfrom
davydova/fix-fonts-test-path-and-add-cases
Open

janinadavydova wants to merge 2 commits into
masterfrom
davydova/fix-fonts-test-path-and-add-cases

Conversation

@janinadavydova

@janinadavydova janinadavydova commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Describe proposed changes and the issue being fixed

  1. Fixed path in
    https://github.com/JetBrains/compose-multiplatform/blob/master/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/DesktopApplicationTest.kt#L376

Here it checks runtime/fonts, but bundled JRE fonts are located in runtime/lib/fonts and the assertion could pass even when fonts remain

  1. Added parameters to test that I think worth to check too
  • Setting omitted: fonts are stripped by default
  • stripJreFonts = false: font files remain
  1. Removed Ignore

(Optional) Follow up to CMP-10772 Strip JRE fonts from desktop distributable

Testing

N/A

Release Notes

N/A

@janinadavydova
janinadavydova force-pushed the davydova/fix-fonts-test-path-and-add-cases branch from a6812a4 to 7e8418c Compare November 3, 2026 22:40
@janinadavydova janinadavydova changed the title Fix fonts test path and cover more cases Fix fonts test path and cover more cases in testFontStripping Nov 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch on the wrong directory, thanks!

}

@ParameterizedTest(name = "stripJreFonts={0}")
@EnumSource(TriBool::class)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each test here is pretty lengthy, and there's no real need to verify all 3 options.
Especially not the "default", as that just verifies a very simple thing: the default value of stripJreFonts.

To make sure there's no false positive (such as looking at the wrong directory) it's better to make sure the directory exists in the JDK from which we're creating the runtime. If that's hard to do, then the test itself should execute the build twice.

Comment on lines +387 to +390
assertTrue(
fontsDir.walkTopDown().any { it.isFile && it.extension in setOf("ttf", "otf") },
"JBR fonts should remain when stripJreFonts is false"
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to look for the fonts themselves. Just checking the directory exists is enough.

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

Successfully merging this pull request may close these issues.

2 participants