My favorite testing approach in Flutter

  Рет қаралды 2,244

Robert Brunhage

Robert Brunhage

Күн бұрын

Пікірлер: 14
@FlutterBountyHunters
@FlutterBountyHunters 2 ай бұрын
Ignoring the variance will definitely bite you. I've had goldens that fail with a 0.0% difference where the mismatch was actually relevant. In Super Editor we've taken two steps to deal with this. First, we created a golden runner that uses Docker to get as close to matching platforms no matter who runs the tests. Second, for tests that still don't match, we created a golden matcher that lets you specify the number of mismatched pixels instead of mismatched percent, because in practice, percent diffs are unpredictable. If your golden mismatch is 103 pixels due to platform differences, then you can allow up to exactly 103 pixels difference. Otherwise it fails.
@RobertBrunhage
@RobertBrunhage 2 ай бұрын
Pinning this. interesting, do you have some links? Would love to learn more here and make sure I share a better approach next time. Seen this approach in multiple large codebases as well so for sure those small differences could be valid, but they might also be so small that they haven't mattered.
@ant_code
@ant_code Ай бұрын
@@RobertBrunhage there is the opened issue on flutter github #111739 related to M1 machines golden tests mismatch.
@imamhatipoglu4040
@imamhatipoglu4040 Ай бұрын
Welcome again, awesome contents
@atreeon
@atreeon Ай бұрын
Yes to Golden tests! was waaay too slow to adopt them. Unit tests for UI stuff - yes. Also integration tests for UI stuff - better. All three? perfect!
@jayKrollin
@jayKrollin Ай бұрын
I struggle with the exact same issue but I would highly recommend to not use a tolerance. E.g. if any dev changes a padding by 1px the related test results could be false positives.
@tayabfarooq2062
@tayabfarooq2062 Ай бұрын
Your followers eagerly look for your content that you post! Please take care of them by uploading something for them as much as possible!
@RobertBrunhage
@RobertBrunhage Ай бұрын
Going to do my best haha
@tbm98
@tbm98 2 ай бұрын
the pain is the result still different between OS
@RobertBrunhage
@RobertBrunhage 2 ай бұрын
Yes, the best scenario will always be generating the tests with a single OS. I am for sure hoping people share some insights of potential better solutions. Mainly wanted to share my experience!
@artofnessa
@artofnessa 2 ай бұрын
Golden tests ftw
@aouadicharaf1038
@aouadicharaf1038 Ай бұрын
❤❤❤
@krtirtho
@krtirtho Ай бұрын
Wait a sec...u guys test in Flutter?
@coffee-is-power
@coffee-is-power Ай бұрын
you should've just changed the implementaton to instead of comparing the bytes, just open the two images and compare the *pixels* not the bytes which is what flutter should do by default but it doesn't
15 Flutter Tips That MIGHT Improve Your Work
4:10
Robert Brunhage
Рет қаралды 24 М.
Flutter Testing For Beginners - The Ultimate Guide
13:05
Robert Brunhage
Рет қаралды 60 М.
Vampire SUCKS Human Energy 🧛🏻‍♂️🪫 (ft. @StevenHe )
0:34
Alan Chikin Chow
Рет қаралды 138 МЛН
«Жат бауыр» телехикаясы І 30 - бөлім | Соңғы бөлім
52:59
Qazaqstan TV / Қазақстан Ұлттық Арнасы
Рет қаралды 340 М.
The Lost World: Living Room Edition
0:46
Daniel LaBelle
Рет қаралды 27 МЛН
-5+3은 뭔가요? 📚 #shorts
0:19
5 분 Tricks
Рет қаралды 13 МЛН
5 deadly Rust anti-patterns to avoid
13:25
Let's Get Rusty
Рет қаралды 39 М.
This is my approach to state management in Flutter
4:47
Robert Brunhage
Рет қаралды 4,2 М.
Why I'm choosing FLUTTER in 2025! | Flutter roadmap 2025
13:40
SpeedKodi
Рет қаралды 4,4 М.
Stop Writing So Many Tests
10:02
Web Dev Simplified
Рет қаралды 98 М.
React Native vs Flutter - Which should you use?
22:31
Simon Grimm
Рет қаралды 60 М.
10x Your Speed With Flutter
8:04
Flutter Mapp
Рет қаралды 86 М.
The ONLY REASON To Unit Test
8:26
Theo - t3․gg
Рет қаралды 88 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 795 М.
Programming Is Cooked
9:30
ThePrimeTime
Рет қаралды 363 М.
Dart 3 Records Are Awesome
4:31
Robert Brunhage
Рет қаралды 14 М.
Vampire SUCKS Human Energy 🧛🏻‍♂️🪫 (ft. @StevenHe )
0:34
Alan Chikin Chow
Рет қаралды 138 МЛН