Showing posts with label unit testing. Show all posts
Showing posts with label unit testing. Show all posts

Tuesday, September 17, 2013

Running *hidden* Firefox for Android 4.2 x86 tests

As of last night, we're running *hidden* the first two sets of Android 4.2 x86 test jobs on every Gecko 27 tree on tbpl:
https://tbpl.mozilla.org/?jobname=Android 4.2 x86&rev=2520866d5874&showall=1
More sets will be added as we green the test suites on Cedar.
Image from http://en.wikipedia.org/wiki/File:Android-x86.png
Side topic, if you have an Android x86 or Armv6 device and want to test Firefox for it please give it a shot in https://play.google.com/store/apps/details?id=org.mozilla.firefox_beta&hl=en

Back to the topic, there are various aspects of the Android x86 testing which are different from the rest of our mobile automated testing, here's a brief list:

  • We don't run them on a device like a Tegra board or a Panda board
    • We run them on Linux 64-bit in-house machines (we can't use AWS)
    • No foopies involved
  • We run them under the Android emulator for the x86 architecture
  • We test on Android 4.2 rather than on Android 2.2 or 4.0
  • We run them in parallel: four emulator instances at most
  • An Android x86 job on tbpl is called a "set"
    • All Android x86 jobs will be grouped under "Sets" rather than per suite category grouping (e.g. reftest or mochitest)
    • A set can run test suites from any category (mix mochitests with reftests)
Here's how it looks on tbpl:







From a developer's perspective here's what you need to know:
  • The jobs are currently not running visibly on tbpl
  • Android x86 is on its way to become a tier-1 platform
  • You can borrow a releng machine to run the tests on them
    • You will be able to run it on your machine if this bug gets fixed
  • We're greening more suites on Cedar and we will add them to other tbpl development trees
  • We could potentially be adding another 7 to 11 sets in the next few weeks
  • The suites on each set are currently in-flux as we move suites from orange sets to green sets
  • Android x86 testing will ride the Gecko 27 trains


    In a following blog post I will go into the technical details on how these tests are run by mozharness.

    All of this work happened under bug 895186.

    If you want to contribute on how to make them easily runnable outside of a releng machine please visit this bug.


    After several months of development, big thanks (sorted alphabetically) to aki, Callek, dminor, gbrown, rail, RyanVM and ted.

    We still have some work to go but it is good to capture this small step towards victory.

    Upcoming:





    Creative Commons License
    This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

    Thursday, January 10, 2013

    Running Gaia UI b2g panda tests on the Cedar branch

    Back in November, Release Engineering tackled with IT, the A-team and the B2G team, the undertaking of running in production the Gaia UI tests on the b2g pandas [1].

    Back in December 7th, we managed to get all the piping done for re-imaging pandas and assigning dummy jobs to them (see "B2G test jobs running on panda boards on the Cedar branch" post for details).

    Last week, after I came back from holidays, I was pleased to see that one of the last blocking bugs had been solved (bug 820617 - Add a hook to make NetworkManager not manage offline status and use it in Marionette for B2G CI) and I could now try to run the tests.

    Last Friday, we landed the code to actually run the tests [2]. This is simply run with a mozharness script like this:
    /tools/buildbot/bin/python scripts/scripts/b2g_panda.py --cfg b2g/panda_releng.py
    
    At that point in time we stopped running dummy jobs and started running tests for the first time.

    Since then, then test jobs have been failing but we are working on the last few bugs to get them to be green. See bug bug 829053 (Gaia UI tests failing with JavascriptException: TypeError: settings is null) if you're curious.

    Thirty five fixed dependent bugs later (and 2 bugs left to be fixed) I can say that it has been a great joint project and I have personally learned a lot through it.

    It would have great to have completed it a while ago but too many difficulties and code problems were found.

    I hope to write to you soon once the tests go green and we start running them every b2g branch.

    [1] https://bugzilla.mozilla.org/show_bug.cgi?id=802317
    [2] http://hg.mozilla.org/build/mozharness/rev/caf3b92e7207


    Creative Commons License
    This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

    Tuesday, April 19, 2011

    Load from March 24th to April 19th

    Last week I did a post about how high our load was for that day and to let other people know that we are looking into mitigating the bad wait times that have been happening.

    We know that we need more slaves but we also know that our masters are hitting edge cases and not being optimal. We now believe that bug 592244 is behind to some chunk of the wasted CPU by running some jobs twice. The problem comes that we have several masters that query a scheduling master and sometimes two jobs are run in two different masters. catlee has done a great job on chasing this and we hope that fixing this issue will improve significantly the wait times (it would have been hard for us without his help to narrow down this issue). If it does not help us enough to get by we will have to go back and chase other edge cases in our masters. Meanwhile IT and releng is still working on getting the next pool of test slaves.

    And now back to the load (link to page with raw data):
    • on the 11th we handled 138 pushes across all branches (the day before the aurora merge)
    • try server had a 47.5%, mozilla-central 16.9% and cedar 11.2% (/me looks at ehsan) of the whole load
    Conclusions:
    • even though we had the trip to Las Vegas, the all-hands and platform's work week we have had a very high load since we shipped Firefox 4
    I wonder what the distribution from April 18th to the end of the month will look like as it would be more representative of what the normal development would be.

    For the next post I should only grab weekdays and interpose them to see how things look from week to week.


    Creative Commons License
    This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

    Thursday, March 10, 2011

    Automated Firefox XP debug unit tests are now live

    As of this morning, we now have automated debug unit tests for Windows XP :)
    TBPL showing the row for XP debug unit tests




    We now have all desktop platforms at parity.



    This change was enabled in bug 614955 and again many thanks goes to ted for helping when I was almost loosing it.

    Kudos goes to philor for checking that the results of the test runs were good.


    Creative Commons License
    This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

    Monday, January 10, 2011

    Reftests and xpcshell test suites run slow on Windows 7 machines

    I previously blogged about xpcshell being extremely slow on Windows 7 and jimm was able to fix something which significantly reduced the time it took. In that post I compared two different operating systems one on Mac minis and the other on a mix of VMs and IX fast hardware machines.

    This time I am comparing Windows XP against Windows 7 running on the same base hardware (Mac minis - dual core 2.26GHz CPU). The comparison shows that the xpchsell and reftests test suites run significantly slower on Windows 7 than Windows XP.
    Comparison of performance and test suites between Windows XP and Windows 7

    If you believe you can give a hand write a comment on bug 617503.

    Link to raw data.


    Creative Commons License
    This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

    XP optimized unit tests enabled for Minefield

    Last week we started to run unit tests on Windows XP for every Minefield build we generate.
    This change excludes the branches mozilla-1.9.1 and mozilla-1.9.2 where we will still be running them on Win 2003 machines.

    There are several permanent oranges that philor and dholbert have filed.
    All of them are just affecting the reftests suite, hence, it is hidden until they all are tackled.
    Once everything is perma-orange-free we will discontinue running unit tests on Windows 2003 machines as it will improve wait times on the builder machines.

    We can now see XP unit tests on tbpl.mozilla.org




    Please if you find any new permanent oranges feel free to file them and add them under:
     Big thanks (again) to philor and dholbert for filling the known bugs.

     


    Creative Commons License
    This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

    Monday, December 06, 2010

    Test suites on Windows

    On my previous post I raised that xpcshell on Windows was quite bad on the minis. I assumed that it was mainly because the hardware was slower but Ted commented on the discussion groups saying that it might xpcshell might be slow because of the OS and not just the hardware change.
    Guess what? Graphs are our good friends!

    I compared all test suites and confirmed that it doesn't have to do too much with the hardware running the test suites. It seems that Win7 in it self is bad for running reftests and xpcshell.
    Look at this graph and you will see how the two lines separate quite a lot for xpcshell and reftests.



    For comparison, we can see that Win7 is constantly bad for xpcshell and reftests for debug builds as well as optimized builds.




    Creative Commons License
    This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

    Friday, December 03, 2010

    The xpcshell case on Windows

    If you care about end to end times you might want to read this post.

    I have enabled debug unit tests on the Windows 7 testing minis and I started filing the permanent oranges for them.
    After notifying one of them, philor pointed out something that caught my attention. Debug xpcshell runs on Win7 takes more than a 100 mins ( :S ) compared to 30-40 mins on the IX machines that running Win2003. That sounds like a lot!

    I decided that if we are going to disable debug unit tests on the builders (Win2003) as we did before for other platforms we should look closely and see what is going on.
    NOTE that at the time that we did the switch we did not have easy ways of tracking variations and the gain was tremendous (more CPU power and end-user OSes) compared to increasing the end to end time. We improved greatly the wait times (larger CPU available) but the end to end times were affected on some platforms since the minis have lower hardware specification (for instance on leopard we didn't loose that much).

    Now that I am back to moving Windows debug unit tests to the minis (I have been away -kind of - for more than 2 months) there is something that there wasn't at that time; ssalbiz prepared two months ago a report out of the information from our schedulerdb that has averages for our test jobs. This report was in reaction to some good discussions I had with shaver about our tear down/tear up times.

    I will break the rest of this post into data and conclusions.

    NOTE:   I am using data from mozilla-central and for Dec. 2nd, 2010.
    NOTE2: I am using averages. I know, it is what I have.
    NOTE3: Some of the statements on this post do not apply to mozilla-1.9.1 and mozilla-1.9.2
    DATA:   The spreadsheet containing the data and charts used. Please be gentle on drawing conclusions without knowing all context that I would love to help you understand.

    Everything
    How many test jobs (perf and unit tests jobs - opt and debug) do we run for mozilla-central? (I am ignoring JP, mozmill-all and mobile)
    • 177
    NOTE: We currently run concurrently debug unit tests on Win2003 and Win7. This will change.
    In the next couple of months we will also add Windows XP.
    • What is the average for each job? 
     Well, our reports can tell us now.
    • What is the job that takes the longest for each platform? MAX() to the rescue!
    If we take the worst average for any test job for each platform and we put them in a table. We can see the following.
    Table 1 - This shows for each platform the worst average for any test job. In orange xpcshell. In purple Windows platforms.
    We can see the worst for all test jobs is "debug xpcshell for Win7" with 106.18 minutes on average. Up until now it was "optimized xpcshell Win7x64" with 79.95 minutes (probably if we had debug on Win7x64 it would be even worst).
    It is also noticeable on the list of worst three offenders for each platform that xpcshell only appears for Windows. That leads me to other questions.

    Xpcshell on Windows
    • What would the world look without xpcshell? (or a shorter run of it)
    Table 2 - Let's not count xpcshell at all for Windows.
    If we remove xpcshell for Windows in our calculations we can see that there is a new worst offender for each platform combination. For instance, for Windows 7 debug type jobs we have "mochitest-other" as the test job that would take the longest. Instead of taking 106.18 mins for having a complete Windows debug coverage we would then only have to wait less than an hour; this is a decrease of 45% which is not bad!!

    Let's look now at what would the worst time for all test jobs for any platform look like with and without xpcshell being considered.
    Table 3 - Test coverages completion for all platforms
    Currently, we wait close to 80 minutes to have a complete coverage for Windows (well, kind of as we don't really pay too much attention to Win7x64 - yet).
    If Win7 debug unit tests replace the Win2003 debug unit tests we would have to wait a 32.81% more to have complete Windows coverage. That is not good!
    In the last two rows of the previous table you can see that if xpcshell was ignored the new worst offender would be Fedora mochitest-4 debug and developers would wait close to 10% less (not really as build times are in favor of Linux) regardless on where we run Windows unit tests (IX/VMs vs minis). This means that Windows would not be anymore on the way to have full platform coverage (not really as the worst build times are for Windows) but Linux.

    Xpschell on all platforms
    • How horribly does Windows compare to other platforms when running xpcshell?
    Quite bad.
    Let's look at the following chart:
    You can easily see that every other platform besides Windows ( BLUE ) takes less than 30 minutes. Debug unit tests on the IX machines takes around 40 minutes while on the minis can take up to 100 minutes.
    Something makes running xpcshells very very slow on Windows.
    All other suites on Windows are not as dramatically as bad as we can see the gains when not considering it (45% gain on debug unit tests completion for Win7).
    Ehsan suggested me to determine if xpcshell is going this slow because I/O by looking at the CPU usage that Windows provides.
    If it is the reason or not someone needs to look at how to improve it by either fixing some underlying code or breaking xpcshell for Windows into two-three pieces to make it finish on the same range as other test suites.

    As you might have noticed, this post is only considering at the times for complete coverage considering all platforms finished at the same time. This is not our reality as each platform takes a different time to finish a build (Windows debug is dramatically slow). This is worth another blog post and will be the basis for improving the left side of the equation (the build times) rather than the right side (the tests times).

    This post is to be informative and to help us discover that we can improve the infrastructure even more. After we complete off-loading the builders from unit tests jobs into the minis we have to think of improving the suites, where instead could we run the test jobs, how we can make our builds even faster and others.

    We face these new problems because we have stretched our infrastructure and to solve them we will have to reconsider many assumptions and keep on adding tools to allow us make better decisions.

    Please don't expect me to do such detailed blog posts as they are quite time consuming. I should finish my goals first!

    Questions welcome.

    [1] Spreadsheet and charts


    Creative Commons License

    Wednesday, December 01, 2010

    Upcoming switching DEBUG unit tests from Win2003 build machines to Win7 test machines

    We have enabled debug unit tests for Windows 7 Rev3 machines.
    We are now running debug unit tests on both Win2003 builders and Win7 test machines (except 1.9.1 and 1.9.2).
    You can see that we have double coverage for Windows debug unit tests
    You should start seeing them on tbpl (except crashtest, reftests and xpcshell). If not check on the tinderbox page and make sure that the builder is "active" and "scrape" is checked as well.

    We have enabled this for all branches (except 1.9.1 and 1.9.2) and we will soon adjust the try_chooser parsing to run them on the tryserver as well (it's a bug).

    When will we do the switch?
    • when we have no perma-orange
    • when all test suites are shown on tbpl
    • when all working branches are showing them on tbpl
    • when we get approval to do so
    If you have any questions, ask them on this blog post.
    If you notice any fall-outs comment on bug bug 614956.

    NOTE: This will impact slightly our wait times on the Win7 testing pool but reduce the wait times for build jobs.

    Creative Commons License
    This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

    Tuesday, August 31, 2010

    Conversing with co-workers can spark new ideas

    A couple of weeks ago, I got a chance to speak with shaver about my concern on the load on our testing pool of Rev3 minis. In short, we have switched from running unit tests on the same pool of machines that produce Firefox development builds to the pool of Rev3 Mac minis (the ones released at the end of 2009) where we run our performance tests (aka talos). Unfortunately, we've also redesigned our try server and our developers loved it so much that decided to juice it out and produce an immense amount of load that we had not expected to reach before the end of the year. Guess what? We are going to have even more load as soon as we add more super-fast hardware machines (aka IX machines - we are ordering more than 150 but not sure how many will actually be slaves and remember that we are adding Linux 64 and Windows 64 as new IX based platforms) and this will cause even more load on testing pool of slaves.

    These are some of the things we discussed:
    • There is no need to tie ourselves to Rev3 minis for unit tests. Adding another pool of faster machines will help to keep that pool to just performance tests and run the unit tests on a pool with faster machines and without the need to have the same hardware for each platform. The problem with this is that it would require us adding more maintenance for a 3rd pool of slaves and many more reference images. We can revisit this in another quarter as there are other short-term options to reduce the time that unit tests jobs take. The good thing is that our infrastructure is now capable of doing unit test jobs in different pools of slaves as we have made our code infrastructure more flexible.
    • We can shave tear up and tear down times. To run our unit tests we have to download the builds and the tests, remove everything from the previous run and checkout the tools repository to unpack the dmg mac files. We also download the symbols in case the browser crashes. We will have to determine where we can optimize steps to take shorter time and get to run the test suite before. These tear-up and tear-down steps could be greatly optimized, for instance, on Windows we determined at a quick glance that we could save between 20% to 30%.
    • We can investigate if the test framework could be optimized. I don't recall too much of this but I believe that Bob Moss' team could help us speed up our functional and performance tests. For instance we could leave it to the framework to download and unpack the symbols only if the build crashed.
    • Our minis are dual core - how could we take advantage of it?.  Could we run two buildbot instances? Could we hand off two jobs each one in a different thread? There are a lot of experimenting and technical considerations for this; specially the fact that we have to reboot every time and we would have to wait for both jobs to finish.
    • We need better tools to determine step times. Imagine if I could tell you that suite A in average wastes X% of its time on Y platform doing tear up/tear down? It would also be cool if we could determine when a spike on test runs appeared. I saw yesterday our new intern Syed playing with SQL queries to determine some of these things. Happy to see this happening :)
    • Quickformat instead of remove. The step that removes the previous build and tests can take few minutes on Windows and that is way too much time. Instead we could quickformat the drive where these gets unpacked which is supposed to be really fast. Here is the bug where the investigation is to happen. This can also help to make our talos time more reliable.
    I love discussing our problems with other people since many times it brings good ideas that can help us all. Notice that I said "discussing" and not just "hearing"; There are many considerations that most people outside of our team are not aware of when we have to make a decision and it helps them also to give us even better suggestions when we spend the back-and-forth time that a proper discussion requires.




    Creative Commons License
    This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

    Wednesday, July 21, 2010

    Unit tests on the minis - status update

    Over the last few months we have been switching to run unit tests on the minis to improve our load and use real users' OS to run our unit tests.

    We are now running unit tests on the minis for mozilla-central, try and tracemonkey branches. This change means that we have reduced the load on the builders side from running 22 jobs per push per platform to only 2 jobs per push per platform (the opt build and the debug build). Ask joduinn for how much CPU time we are saving [1].

    TraceMonkey is the first project branch to be running on the minis but next week we should have *all* other branches move to the minis as well.

    TM is the third most active branch after try and m-c and it accounts for 9% of commits (try 37% & m-c 36%). This means we are now running 82% of our unit tests' load on the minis instead of the builders (this is only for Fedora 32/64-bit and OSX 10.5/10.6 since Windows is not yet moved over).

    What comes next?
    In the next week we should see all other project branches' unit tests to be run on the minis and cut the load again on the builders' side. This will help us to move more slaves to the try pool where they are most needed.

    [1] http://oduinn.com/blog/2010/07/16/infrastructure-load-for-june-2010/


    Creative Commons License
    This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

    Thursday, June 17, 2010

    Kiss CentOS unit tests good bye (on mozilla-central)

    Hi all,
    This was discussed few weeks ago in the Tuesday planning meeting and it is now that we are able to discontinue the unit test coverage on the build machines on mozilla-central.

    We now have unit tests coverage only on the Talos/Rev3 machines on Fedora 12.
    To note that up until now we were having dual coverage (CentOS and Fedora) and we were just waiting for the right moment to stop running unit tests on the Linux build VMs.

    What does this mean for a developer? You won't see on TBPL something like this:
        Mo (1 1 2 2 3 3 4 4 5 5 oth oth)
    but instead this:
        Mo (1 2 3 4 5 oth)
    Makes sense? :)

    This will enable us to free a lot of load from the Linux builders and we can re-purpose some machines were we need them more.

    The next step will be to enable Fedora coverage on more branches but we need few improvements on the talos master before we can do it. After that and only then we will be able to disable completely the CentOS coverage for the remaining branches.

    CentOS coverage was disabled this morning in this bug:



    Creative Commons License
    This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

    Tuesday, May 18, 2010

    Fedora (32 & 64 bit) unit tests with Zarro permanent oranges :)

    Today we have reached another milestone for running unit tests on user desktop operating systems.
    Since I enabled unit tests for our Fedora testing machines today is the first time that I have all 10 different test suites enabled and visible!

    This means that we can now continue with the next stage and final part of the project:
    • disable unit tests on the CentOS machines (where we have been running unit tests up until now)
    • enable unit tests for the project branches on the Fedora machines (we now have enough machines)
    I will bring this up at the developers' meeting and make sure that everyone is fine with this final part of the project.

    For context details:

    This project got started in early March to run unit tests on real user operating systems. We have been running all Fedora test suites since April 12th. but the results were only revealed on the main reporting pages as permanent oranges got fixed. Big thanks for Ehsan Akhgari, Zack Weinberg, Dave Townsend, Marco Bonardo, David Bolter, Daniel Holbert, Boris Zbarsky, David Baron, Robert O'Callahan and Phil Ringnalda for contributing, guiding, helping and fixing all these oranges; without their help we would have not been able to accomplish this.

    Previous posts and tracking bug:



    Creative Commons License
    This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

    Tuesday, May 04, 2010

    Help finishing *all* Fedora oranges

    As you might know we are trying to run unit tests on our Fedora machines but we are still trying to bring down the number of permanent oranges.

    We are down to 2 permanent suite oranges (6 open bugs) but I need more traction from developers to get these nailed down.

    As Ben pointed out, we can provide access to our machines. For this purpose I have set aside two Fedora 32bit machines waiting for the developers involved with the oranges to work with them. I have emailed individually to the developers but if you think you can give them a hand please email me.

    * mochitest-browser-chrome:
      * bug 560878 (browser_bug435788.js)
      * bug 562663 - chrome://mochikit/content/browser/browser/components/places/tests/browser/browser_library_panel_leak.js
    * reftests - tracking bug 560882  
      * Bug 558910 - antialiasing
      * Bug 558977 - reftests/svg/objectBoundingBox-and-fePointLight-01.svg
      * Bug 559125 - reftests/bugs/180085-1.html and reftests/bugs/359903-1.html
      * Bug 559426 - layout/reftests/box-shadow/boxshadow-inner-basic.html and
    reftests/bugs/456219-1c.html

    The tracking bug is bug 554934.


    Creative Commons License
    This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

    Friday, April 23, 2010

    One more Fedora unit test suite visible (mochitest 4/5)

    Since we enabled the Fedora unit tests I have been working towards making all permanent-oranges for Fedora 32 and 64 bit builds to be green and today we have made one more test suite visible.

    One of the unit tests that was failing was mochitest 4. This was because there is a pango bug that affects Thai scripts (I think). After some fiddling around Zack came with a patch that allowed us to go green and therefore be able to enable this test suite (thanks dbaron) for developers to catch other problems.

    With this unit test going green we are down to 3 out of 10 permanent test suites that are still hidden.
    My next bug to tackle is the libm.so bug and I will keep on continuing to collaborate with developers to fix some of these remaining perma-oranges.

    Big thanks to Zack for the quick turn-around and to Ehsan in general for helping me to get traction in most of the filed oranges.

    For following the oranges you can follow bug 558911



    Creative Commons License
    This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

    Monday, April 12, 2010

    Unit tests for Fedora - UTonT project

    You can now see Fedora (32 and 64 bits) unit tests being run Firefox on mozilla-central.
    This means that we are now testing Firefox in a common user distribution rather than CentOS.
    This also means that we have new oranges (yay!) that most of us had not seen before.
    Check out the filed oranges on the fedora-oranges bug

    The permanent oranges have been hidden from tinderbox and tinderbox-pushlog:
    http://tinderbox.mozilla.org/showbuilds.cgi?tree=Firefox

    To see the permanent oranges you will have to use this view instead:
    http://tinderbox.mozilla.org/showbuilds.cgi?tree=Firefox&noignore=1

    This is one more step of the UTonT project that we have been working on since last quarter.

    Happy new OS testing!



    Creative Commons License
    This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

    Wednesday, March 31, 2010

    UTonT project (Unit tests on talos)

    This is a great project I have been able to take part of with anodelman, jhford and lsblakk; in which, we have been figuring out the steps to get to run unit tests on talos machines rather than build machines.

    This is a project that will helps us have:
    • new platforms to test Firefox on:
      • Fedora, Fedora64, Snow Leopard (64 bits), XP, Windows 7 and Windows 7 (64 bits). (running unit tests on real user machines, are we crazy? :P)
    This project is composed of the following pieces:
    • make sure that our new platforms have the infrastructure requirements to run packaged unit tests
      • for instance, having mercurial installed to checkout all the repositories needed
    • work with developers to fix oranges of the new platforms
      • For instance fixing oranges found for Fedora
    • move unit test load from the build-slaves-pool to the talos-slaves-pool
      • for some time we will have to report the build slaves unit tests to another tinderbox page
    • get more talos rev3 machines to keep up with the extra load
    For now the plan is to get this out per stages:
    • Leopard and Snow Leopard which have been green
      • we have deployed Mercurial today and tomorrow we will turn this on
    • Fedora and Fedora 64
      • we might turn Fedora 64 on even if it is orange since we have never run unit tests for it. We will see.
      • we need developers commitment to fix the oranges for Fedora
    • Windows XP
      • deploying Mercurial to it through OPSI will make this platform go before Windows 7
    • Windows 7 and Windows 7 (64 bits)
      • it will probably require Mercurial to deployed manually to all slaves (I just wish I won't have to do it :P)
     There is probably more problems that these (which we will definitely hit) and the plan is just out of my own thinking (we will see if it matches what the rest of my team and other interested parties want).

    Happy unit testing on real operating systems!



    Creative Commons License
    This work by Zambrano Gasparnian, Armen is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

    Sunday, January 13, 2008

    My initial plan for the project

    After three days I can only have these initial goals and I have ordered in the order I have understood it should happen:
    1. Initially, I want to run manually the mochitests (one of the interactive types of tests) and the xpcshell based test units (aka "make check") - (This last one already accomplished)
    2. I have chosen tunit ("make check") to be the first one to be working with try-server capability
    3. Learn how to run the rest of different tests (reftest and crashtest)
    4. Integrate one by one the rest of the tests to be have try-server capabilities
    5. Add regression search Buildbot improvement (read note below)

    NOTE: I believe that Tunit tests is just an abbreviation of Test Unit, I think is not something like Junit or Nunit

    NOTE2: About == Regression Search Buildbot improvement ==

    I [http://ted.mielczarek.org/code/mozilla/regression-search.html setup a
    buildbot] using [http://db48x.net/regression-search/ db48x's
    regression-search script] to make it easy to write a mochitest or
    reftest and automatically find out when something regressed. Currently
    it's still not terribly easy to use, and it's also hosted on my home
    machine, so I often forget to restart it. This could be improved by
    making it more reliable, and making it easier to use.

    Sess5 - xpcshell-based unit tests - Tunits (aka "make check")

    First of all, I have build a non-static build of firefox without --disable-tests

    Running xpcshell-based unit tests (reading from Writing_xpcshell-based_unit_tests )
    • To run one test example, go to OBJDIR and run:
      make -C tools/test-harness/xpcshell-simple/example check
    • If you just want to run ONE MODULE, cd to the module or component under the OBJDIR folder like ($OBJDIR)/browser and run "make check" to run all tests of that module
    • To run all xpcshell based unit tests do:
      make check //which took around 4 mins in my laptop
      which runs all the tests in ($OBJDIR)/_tests/, inside there we have the "xpcshell-simple" folder with all the xpcshell-based unit tests
    NOTE: If you want to the results of a "make check" have a look at this file (makeCheckResults.txt)

    The xpcshell-simple folder, who is there and how does it look like
    • In that folder we have more folders that most of them have the prefix "test" (test_autocomplete, test_browser_feeds, test_intl_uconv and others...)
    • Inside each of these folders you will find out a "unit" folder or a "test" folder (which also contains one level down a "unit" folder)
    • Each "unit" folder contains javascript files that are the actual tests.
    • You can also realize that the tests can have this format, test_.js, which is normally (if not mistaken) the number of the associated bug being tested
    • Another thing is that you get the result of the test in a log file in the same place where a xpcshell test is with a file name like this: test_.js.log. These logs look like this:
      *** test pending
      *** test pending
      *** test finished
      *** running event loop
      *** test finished
      *** exiting
      *** PASS ***

      which are also the messages that you get when doing "make check"

    • To read more about how to write a test read this (Writing_xpcshell-based_unit_tests)


    More info on how things get generated
    When you do a "make -f client.mk build", the make arrives to the "Makefiles.in" and read something like this (modules/libpref/test/Makefile.in ):
      46 MODULE          = test_libpref
    47
    48 XPCSHELL_TESTS = unit
    Therefore it creates a folder "test_libref" in the "xpcshell-simple" folder (under (OBJDIR)/_tests) and inside the "test_libref" folder it creates a folder "unit" with the exact content on the source (source/modules/libpref/test/ ), which is a bunch of tests written on javascript.

    When we run "make check" from the ($OBJDIR), the make goes through each folder looking (I think) for all the Makefile.in files that have XPCSHELL_TESTS defined and runs the tests that are in ($OBJDIR)/_tests/xpcshell-simple/MODULE/XPCSHELL_TESTS

    It is not always easy to map back to the original file by following the folder structure in the "_tests" folder, i. e. embed/tests/unit which doesn't map to source/embed/tests/unit but it maps back to source/embedding/tests/unit/

    The best way is to look for one of the Javascript tests inside of the "unit" folder, i.e. the file _tests/xpcshell-simple/embed/tests/unit/test_wwauthpromptfactory.js by doing a search for file "test_wwauthpromptfactory.js" we find it in MXR by searching for the filename

    "try-server" and automated testing

    This semester I am switching to a new project that will allows to learn a lot aobut automated testing on BuildBot.

    My problem right now is that I have been reading too much and will be difficult to structure this blog post and I didn't want to split it into several posts. Please bar with me

    Context of the project
    First things first, to put you into context:
    Links to read:
    People involved:
    • Rob Campbell, Robert Helmer,Ben Hearsum,Robert Sayre,Mike Shaver, Adam Delyea, Dave Humphrey and Armen Zambrano G. (me ;)
    Related Blog posts:
    Concepts involved:
    • Buildbot
    • try-server
    • These are the tests they run in Mozilla: 1)reftest, 2)mochitest, 3)tunit, crashtest (from which tunit aka "make check" seems to be the easiest)
    Unit Testing in Mozilla
    NOTE from Writing_xpcshell-based_unit_tests:
    "If you want to execute the test, you must create a non-static build of the browser without --disable-tests"

    How do I run Mochitests?
    • cd ($OBJ_DIR)/_tests/testing/mochitest (Note that the working directory matters for runtests.pl!)
    • perl runtests.pl --autorun

    How do I run Tunits ("make check")?

    On http://tinderbox.mozilla.org/showbuilds.cgi?tree=Firefox I read on the left side this:
    unit test Builds source then runs test suites. Build only after checkin, buildbot, VM, QA administered (robcee).
    and from what I see in the page, they dedicate some servers to build and test while in the other they just build and others they do performance test