Flutter golden tests failing on CI

Issue

I recently added a bunch of golden file tests (and generated the goldens by running flutter test --generate-goldens) to my Flutter plugin. All of the tests successfully pass on my development device, but consistently fail when they run on Circle CI (for example: https://circleci.com/gh/Sub6Resources/flutter_html/78).

Am I missing a step in creating the golden tests? Or is there maybe a configuration option I need to add to Circle CI in order for the image files to be added correctly?

Solution

Depends on operating system (windows, macos or linux) flutter generates different golden images. Usually CI services use linux machines or macos if you build for iOS. So you need just use the same OS as CI to generate golden images.

Answered By – Mikhail Tokarev

Answer Checked By – Dawn Plyler (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *