#16973 closed defect (fixed)
MapCSSRendererTest fails on Ubuntu 18.04
Reported by: | Don-vip | Owned by: | team |
---|---|---|---|
Priority: | major | Milestone: | 18.12 |
Component: | Unit tests | Version: | |
Keywords: | linux ubuntu mapcss | Cc: | ris, naoliv, michael2402, wiktorn, simon04, floscher |
Description (last modified by )
As I feared with #16688, org.openstreetmap.josm.gui.mappaint.MapCSSRendererTest
does not behave the same on Ubuntu 16.04 and Ubuntu 18.04.
https://josm.openstreetmap.de/jenkins/job/JOSM/lastCompletedBuild/testReport/
I don't know why, but this is problematic as we need it to run on both versions now we have updated to 18.04 but Travis CI is still using 16.04.
Test | Reference | Result | Difference |
---|---|---|---|
area-text | |||
eval | |||
node-text | |||
node-text2 | |||
way-text |
Attachments (15)
Change History (30)
comment:1 by , 6 years ago
comment:3 by , 6 years ago
@ris Wich JVM are you using and which OS?
The problem seems to be that they differ in rendering and the tests are doing a hard comparison of the images. We could add a threshold but judging visual similarity using a simple algorithm is difficult.
comment:4 by , 6 years ago
JVM is the same:
https://packages.ubuntu.com/xenial/amd64/openjdk-8-jre
https://packages.ubuntu.com/bionic/amd64/openjdk-8-jre
I think it comes from another package.
follow-up: 7 comment:5 by , 6 years ago
I will test it
Does anyone know the ant equivalent to the gradle --tests
parameter (that only executes specific tests)?
comment:6 by , 6 years ago
OpenJDK 8, linux.
@michael2402 incidentally I added a tool to the testutils recently for making lenient checks on simple image content - ImagePatternMatching
: https://github.com/openstreetmap/josm/blob/46e9e88b6de60be69bba0e8615d93c85222fef89/test/unit/org/openstreetmap/josm/testutils/ImagePatternMatching.java
Essentially allows you to make assertions about strips of the image using regular expressions.
comment:7 by , 6 years ago
Replying to michael2402:
Does anyone know the ant equivalent to the gradle
--tests
parameter (that only executes specific tests)?
It's a bit complicated right now, see wiki/DevelopersGuide/Compiling
It used to be easy from Eclipse (right click on test, "run as Junit") but currently more difficult, see #17012
comment:8 by , 6 years ago
Milestone: | 18.11 → 18.12 |
---|
comment:9 by , 6 years ago
Cc: | added |
---|
@team does anyone have a lead to fix the issue? The build is failing since we updated the server to latest version of Ubuntu.
comment:10 by , 6 years ago
Priority: | normal → major |
---|
comment:11 by , 6 years ago
When the test differs for Java version why not add different reference test data after verifying that the new data is only different, but not wrong?
comment:12 by , 6 years ago
We can just re-generate all data using the new configuration. Then visually check if it looks OK. Those are just problems with anti-aliasing and some rounding issues that are one pixel of.
The test is mostly there to be able to see if some map features just got "lost" during a refactoring (e.g. labels not being rendered, ...). For that, we don't need to be able to run it in every environment, although it would be nice.
by , 6 years ago
Attachment: | area-text-reference.png added |
---|
by , 6 years ago
Attachment: | area-text-test-differences.png added |
---|
by , 6 years ago
Attachment: | area-text-test-output.png added |
---|
by , 6 years ago
Attachment: | eval-reference.png added |
---|
by , 6 years ago
Attachment: | eval-test-differences.png added |
---|
by , 6 years ago
Attachment: | eval-test-output.png added |
---|
by , 6 years ago
Attachment: | node-text-reference.png added |
---|
by , 6 years ago
Attachment: | node-text-test-differences.png added |
---|
by , 6 years ago
Attachment: | node-text-test-output.png added |
---|
by , 6 years ago
Attachment: | node-text2-reference.png added |
---|
by , 6 years ago
Attachment: | node-text2-test-differences.png added |
---|
by , 6 years ago
Attachment: | node-text2-test-output.png added |
---|
by , 6 years ago
Attachment: | way-text-reference.png added |
---|
by , 6 years ago
Attachment: | way-text-test-differences.png added |
---|
by , 6 years ago
Attachment: | way-text-test-output.png added |
---|
comment:13 by , 6 years ago
Description: | modified (diff) |
---|
comment:15 by , 6 years ago
I don't think it's ever a good idea to expect pixel-perfect results from a test unless you're in control of the whole rendering process. In this case we defer the font rendering to swing, which in turn defers it I imagine to a platform-dependent font renderer, in this case freetype.
Tying the test to bit-perfect results will also make a test platform-dependent and probably making local results or travis results rather valueless. I've done this using my ImagePatternMatching
tool, but in this case it might be more useful to use a "perceptual" diff or hash like e.g. http://pdiff.sourceforge.net/ or https://www.phash.org/
Do we know which JVM versions were used in both cases? I think I noticed differences between SUN and OpenJDK some time in the past.