Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I...

40
Testing in WebKit-EFL From 0% to 99% in 6 months Leandro Pereira ProFUSION Embedded Systems http://profusion.mobi February 04, 2012

Transcript of Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I...

Page 1: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Testing in WebKit-EFLFrom 0% to 99% in 6 months

Leandro Pereira

ProFUSION Embedded Systemshttp://profusion.mobi

February 04, 2012

Page 2: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

WebKit

Page 3: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

WebKit

Page 4: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

WebKit

I Heart of Epiphany,Chromium, Safari,Konqueror, and Eve

I Good standards compliance

I Comprised of WebCore,JavaScriptCore, one WebKitfor each port

Page 5: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

WebKit

I Heart of Epiphany,Chromium, Safari,Konqueror, and Eve

I Good standards compliance

I Comprised of WebCore,JavaScriptCore, one WebKitfor each port

Page 6: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

WebKit

I Heart of Epiphany,Chromium, Safari,Konqueror, and Eve

I Good standards compliance

I Comprised of WebCore

,JavaScriptCore, one WebKitfor each port

Page 7: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

WebKit

I Heart of Epiphany,Chromium, Safari,Konqueror, and Eve

I Good standards compliance

I Comprised of WebCore,JavaScriptCore

, one WebKitfor each port

Page 8: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

WebKit

I Heart of Epiphany,Chromium, Safari,Konqueror, and Eve

I Good standards compliance

I Comprised of WebCore,JavaScriptCore, one WebKitfor each port

Page 9: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

WebKit

I Heart of Epiphany,Chromium, Safari,Konqueror, and Eve

I Good standards compliance

I Comprised of WebCore,JavaScriptCore, one WebKitfor each port, and WTF.

Page 10: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Testing in WebKit

I Bug fixed → new test

I New feature → new testI Over 9000 28000 tests

I Some imported fromother test suites (W3C,Mozilla, etc)

I Some written by WebKitcontributors

I One of the reasonsWebKit repo is so large(1.8GiB just for tests andexpected results)

I Most tests areport-independent

I Test results are mostlyport-dependent

Page 11: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Testing in WebKit

I Bug fixed → new test

I New feature → new test

I Over 9000 28000 testsI Some imported from

other test suites (W3C,Mozilla, etc)

I Some written by WebKitcontributors

I One of the reasonsWebKit repo is so large(1.8GiB just for tests andexpected results)

I Most tests areport-independent

I Test results are mostlyport-dependent

Page 12: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Testing in WebKit

I Bug fixed → new test

I New feature → new testI Over 9000 28000 tests

I Some imported fromother test suites (W3C,Mozilla, etc)

I Some written by WebKitcontributors

I One of the reasonsWebKit repo is so large(1.8GiB just for tests andexpected results)

I Most tests areport-independent

I Test results are mostlyport-dependent

Page 13: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Testing in WebKit

I Bug fixed → new test

I New feature → new testI Over 9000 28000 tests

I Some imported fromother test suites (W3C,Mozilla, etc)

I Some written by WebKitcontributors

I One of the reasonsWebKit repo is so large(1.8GiB just for tests andexpected results)

I Most tests areport-independent

I Test results are mostlyport-dependent

Page 14: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Testing in WebKit

I Bug fixed → new test

I New feature → new testI Over 9000 28000 tests

I Some imported fromother test suites (W3C,Mozilla, etc)

I Some written by WebKitcontributors

I One of the reasonsWebKit repo is so large(1.8GiB just for tests andexpected results)

I Most tests areport-independent

I Test results are mostlyport-dependent

Page 15: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Testing toolsDumpRenderTree (DRT)

I Works just like an automated web browser; JavaScript:I Controls the output typeI Injects keypressesI Tells when the test is done

I Historical nameI Dumps the render treeI Dumps the textual representationI Dumps screenshots

Page 16: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Testing toolsDumpRenderTree (DRT)

I Works just like an automated web browser; JavaScript:I Controls the output typeI Injects keypressesI Tells when the test is done

I Historical nameI Dumps the render treeI Dumps the textual representationI Dumps screenshots

Page 17: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Testing toolsDumpRenderTree (DRT)

Page 18: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Testing toolsImageDiff

I Just like diff, but for images

I Output is another image

I Used to compare screenshots

Page 19: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Testing toolsrun-webkit-tests

I Runs DumpRenderTree

I Compares output with eiter standard Unix diff or ImageDiff

I If it’s equal to the baseline, the test passes

I Port-independent

I Changed recently from a blob of Perl code to much nicerPython

I New version is multiprocessing-aware, more resilient tocrashing tests, and works better with flaky tests

Page 20: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Testing toolsrun-webkit-tests

I Runs DumpRenderTree

I Compares output with eiter standard Unix diff or ImageDiff

I If it’s equal to the baseline, the test passes

I Port-independent

I Changed recently from a blob of Perl code to much nicerPython

I New version is multiprocessing-aware, more resilient tocrashing tests, and works better with flaky tests

Page 21: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Testing toolsrun-webkit-tests

I Runs DumpRenderTree

I Compares output with eiter standard Unix diff or ImageDiff

I If it’s equal to the baseline, the test passes

I Port-independent

I Changed recently from a blob of Perl code to much nicerPython

I New version is multiprocessing-aware, more resilient tocrashing tests, and works better with flaky tests

Page 22: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Other toolsDon’t you love scripts?

I find-drt-baselines.pyI Compares output of EFL’s DRT with other ports expected filesI If blocks are the same, and their geometry is within a certain

threshold, consider EFL’s output correct

I Kind of cheating, but changes in behaviour are noticedI Hacky code, so not upstreamed

Page 23: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Other toolsDon’t you love scripts?

I find-drt-baselines.pyI Compares output of EFL’s DRT with other ports expected filesI If blocks are the same, and their geometry is within a certain

threshold, consider EFL’s output correctI Kind of cheating, but changes in behaviour are noticedI Hacky code, so not upstreamed

Page 24: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

75%

I 75% of tests passes in WebKit-EFL using port-independentbaselines

I But we don’t implement everything...

I ...so we have about 75% of coverage

I Even then, to get to 99% of these was hard

Page 25: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

75%

I 75% of tests passes in WebKit-EFL using port-independentbaselines

I But we don’t implement everything...

I ...so we have about 75% of coverage

I Even then, to get to 99% of these was hard

Page 26: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

75%

I 75% of tests passes in WebKit-EFL using port-independentbaselines

I But we don’t implement everything...

I ...so we have about 75% of coverage

I Even then, to get to 99% of these was hard

Page 27: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)
Page 28: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Debugging WebKit is bad for the environment

I Linking with debuggingsymbols takes a good while

I Machine is pretty muchuseless while linking

I gdb crashes

Page 29: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

At least there is icecc

Page 30: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Amount of patches

I In 6 months, around 100 patches were produced toimplement DRT, ImageDiff and fix bugs

I 60% of these were bug fixes

I The rest were infrastructure changes and the tools themselves

Page 31: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Milestones

Period Milestone

1 month DumpRenderTree running2 months 75% of tests passing3 months 80% of tests passing4 months 87% of tests passing5 months 92% of tests passing5.5 months 99% of tests passing6 months EFL baselines upstreamed

Page 32: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Lessons learned

I WebKit is a C++ library: don’t code in C like you’d do on aPDP – even if others do the same.

I Smart pointers are your friend. Except when they’re not.

I Don’t trust your debugger.

I But do trust Valgrind.

I Don’t try linking WebKit with debugging symbols on aPandaboard. Unless you can spare around 20h to link. Set upa cross-compiler early.

I Set up 32- and 64-bit machines early.

I 4GB of RAM is not enough.

Page 33: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Lessons learned

I WebKit is a C++ library: don’t code in C like you’d do on aPDP – even if others do the same.

I Smart pointers are your friend. Except when they’re not.

I Don’t trust your debugger.

I But do trust Valgrind.

I Don’t try linking WebKit with debugging symbols on aPandaboard. Unless you can spare around 20h to link. Set upa cross-compiler early.

I Set up 32- and 64-bit machines early.

I 4GB of RAM is not enough.

Page 34: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Lessons learned

I WebKit is a C++ library: don’t code in C like you’d do on aPDP – even if others do the same.

I Smart pointers are your friend. Except when they’re not.

I Don’t trust your debugger.

I But do trust Valgrind.

I Don’t try linking WebKit with debugging symbols on aPandaboard. Unless you can spare around 20h to link. Set upa cross-compiler early.

I Set up 32- and 64-bit machines early.

I 4GB of RAM is not enough.

Page 35: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Lessons learned

I WebKit is a C++ library: don’t code in C like you’d do on aPDP – even if others do the same.

I Smart pointers are your friend. Except when they’re not.

I Don’t trust your debugger.

I But do trust Valgrind.

I Don’t try linking WebKit with debugging symbols on aPandaboard. Unless you can spare around 20h to link. Set upa cross-compiler early.

I Set up 32- and 64-bit machines early.

I 4GB of RAM is not enough.

Page 36: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Lessons learned

I WebKit is a C++ library: don’t code in C like you’d do on aPDP – even if others do the same.

I Smart pointers are your friend. Except when they’re not.

I Don’t trust your debugger.

I But do trust Valgrind.

I Don’t try linking WebKit with debugging symbols on aPandaboard. Unless you can spare around 20h to link. Set upa cross-compiler early.

I Set up 32- and 64-bit machines early.

I 4GB of RAM is not enough.

Page 37: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Lessons learned

I WebKit is a C++ library: don’t code in C like you’d do on aPDP – even if others do the same.

I Smart pointers are your friend. Except when they’re not.

I Don’t trust your debugger.

I But do trust Valgrind.

I Don’t try linking WebKit with debugging symbols on aPandaboard. Unless you can spare around 20h to link. Set upa cross-compiler early.

I Set up 32- and 64-bit machines early.

I 4GB of RAM is not enough.

Page 38: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Lessons learned

I WebKit is a C++ library: don’t code in C like you’d do on aPDP – even if others do the same.

I Smart pointers are your friend. Except when they’re not.

I Don’t trust your debugger.

I But do trust Valgrind.

I Don’t try linking WebKit with debugging symbols on aPandaboard. Unless you can spare around 20h to link. Set upa cross-compiler early.

I Set up 32- and 64-bit machines early.

I 4GB of RAM is not enough.

Page 39: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Lessons learned

I WebKit is a C++ library: don’t code in C like you’d do on aPDP – even if others do the same.

I Smart pointers are your friend. Except when they’re not.

I Don’t trust your debugger.

I But do trust Valgrind.

I Don’t try linking WebKit with debugging symbols on aPandaboard. Unless you can spare around 20h to link. Set upa cross-compiler early.

I Set up 32- and 64-bit machines early.

I 4GB of RAM is not enough.

Page 40: Testing in WebKit-EFL - FOSDEM · Testing in WebKit I Bug xed ! new test I New feature ! new test I Over 9000 28000 tests I Some imported from other test suites (W3C, Mozilla, etc)

Thank [email protected]

acidx on Freenode