Repository navigation
C++ (render) test runner - #14941
C++ (render) test runner#14941
Conversation
e81c681 to
b27bbf3
Compare
d5dddf3 to
9c50269
Compare
|
@mapbox/gl-native please review. |
| metadata.diff = mbgl::encodePNG(diff); | ||
|
|
||
| #if !TEST_READ_ONLY | ||
| mbgl::util::write_file(base + "/diff.png", metadata.diff); |
There was a problem hiding this comment.
What about if we write the new test expectations only if the diff fails?
There was a problem hiding this comment.
We only overwrite the test expectation when UPDATE envvar is set - which is the same logic inherited from the Node.js test suite. We always overwrite the test actual result and the diff on each test run, which also follows the prior logic.
|
Kudos big time for working on this! |
9c50269 to
3da6499
Compare
|
|
||
| pixels = // implicitly converting from uint64_t | ||
| mapbox::pixelmatch(actual.data.get(), expected.data.get(), expected.size.width, | ||
| expected.size.height, diff.data.get(), 0.16); // GL JS uses 0.1285 |
There was a problem hiding this comment.
post merging comment:
0.16); // GL JS uses 0.1285
This is significant change. 0.1285 is set because we had some failures passing under the radar.
Let's not remove node render tests until the tolerance is the same - we could have node render tests running on one bot at least.
This PR:
cppcodecdependency: for encoding data in base64 format - we encode PNG images in base64 format when generating the render tests HTML results page.DefaultFileSourceto disable cache-only requests support. This is needed to mimic the Node.js file source behavior, and to avoid the tile loader from populating the tile pyramid with intermediary tiles that could cause a render test failure.expression-tests/to-number/2-ary- for some reason macOS' clang compiler does not capture the incomingstd::invalid_argumentexception, so using a generic...instead.For the C++ render test runner, we're no longer relying on NPM dependencies, thus adding
mvt-fixturesandmapbox-gl-stylesas submodule dependencies instead. We're also no longer relying on adding a macro to the custom Makefile, but instead using pure CMake build commands. These two changes cause the C++ render test runner to be easily built and run in an embedded/mobile environment.This PR also adds two new CI jobs:
macos-render-testsandlinux-render-tests, and removes the render test step fromnode-macos-releaseandnode-clang39-release. Eventually, once the expression tests and query tests have been ported to C++, we could then remove these last two CI jobs.One caveat I found when adding CI support for macOS was that
RunLoop::runOnce()(used inHeadlessFrontend::renderwhen rendering a still image) was not causing the run loop to eventually become idle again, thus blocking the test execution. The only workaround I could find so far was adding a minimal 16ms here: https://github.com/mapbox/mapbox-gl-native/blob/master/platform/darwin/src/run_loop.cpp#L41