Category Archives: popcorn-maker

Popcorn Maker – Sync all the Medias

Rather than be quiet about the cool things I do I’m going to actually blog about this and explain it to give everyone a better idea of what MediaSync is.

So, what is it?

MediaSync is basically all about making it easy to pull in the media of the web into the tools of Webmaker and make it easy to add them to the things you are currently making. For now this is limited to Popcorn Maker and simply performing search queries against these services ( YouTube, SoundCloud, Flickr and Giphy ). In the future however this will include being able to use this in other area’s of Webmaker but also potentially from other sources and having the ability to really create your own set of media that persists with your Webmaker identity.

How do I use it?

Fear not! It’s actually fairly simple. For the already initiated to Popcorn Maker, you will first notice a new user interface for our Media editor. We have sectioned it off into tabs to make distinguishing what you are using more obvious and ( hopefully ) intuitive.

First, the My Media section. This area of the Media editor is almost identical to what was previously there with exception to some text changes. At this point, My Media is all clips/media you have added to the project currently. This will include anything added via the text box above (just like before) but also anything you add as an event when searching.

Second, the Search for Media section. This area is where all the magic happens. You simply select a service from our drop down and start typing your search into the text area and then hit the Search button that appears!

Searching functions just like it would when going to that service on your own. No hidden surprises.

If you see the dancing cat, it means he is processing your request and will return with results shortly.As you can see, the results are shown in a familiar fashion to anyone who has used Popcorn Maker before. All you have to do is click on the given thumbnail and that media will be added to your project!

You can easily find more results than what’s initially listed by clicking through our paging controls.

So find your favourite YouTube video, all the cat gifs you could possibly imagine and let your imagination fly. It’s now super easy to quickly create some cool projects!

A Year of Open Source

This last year has been quite an interesting ride for me. A year ago, basically to the day, I first met the crazy people I now work with everyday on Popcorn and Popcorn Maker: Scott Downe, Jon Buckley, David Seifried and Chris De Cairos back at a friendly gathering to watch a UFC pay per view. I was pretty much set on taking the first course in open source taught at Seneca by David Humphrey but it was rather interesting to meet these new people and learn more about it and the kinds of things they did.

A year ago I literally didn’t know much. I had the basics skills taught to me by the previous courses at Seneca but honestly they didn’t prepare me for a lot of things with the web. Working on Popcorn introduced me to a lot of things that I didn’t know, especially with javascript. Man, I remember when I had no clue how to really use an XHR request and was so stumped on what to do for my really crappy tumblr plugin. Compared to today it’s quite amazing the differences. I can’t claim I know everything or even a lot right now but I find myself able to tackle a lot of different things but more importantly I’m able to work with others on the things I can’t figure out and discuss different approaches to finding a solution for a problem.

More importantly it’s the opportunities I get working on this project. It’s so cool to work with, collaborate with and meet all the ridiculously smart people with Mozilla. Some of those include:

Bobby Richter
Secretrobotron. Pretty much a genius. He’s sort of the software lead and an awesome guy. He also likes long walks on the beach, morning sunrises and phish.

Kate Hudson
Popcorn Makers designer. Truthfully she is also one hell of a programmer and could easily just work on any of the bugs the rest of us do. Honestly quite amazing. Don’t ever get her angry though.

What’s even better has to be some of the reactions of people when we show them the software and seeing how they use it. Yesterday and today we have been doing user testing and just watching them use the app is awesome. When you write up all of this and think about user experience for the app you feel like you have it covered pretty well but then all of the sudden someone brings up something completely different. You thought maybe the purpose of something was obvious but it isn’t at all and basically get’s ignored or some cool feature that get’s overlooked completely because it isn’t apparent at all that it even exists.

Honestly, I can’t wait for what the future brings. We have so many cool things left that we want to do and I just want to keep on working harder and harder. There’s so many cool things I want to do and working on all of these has given me many ideas for what I’d like to do in the future and the best part is with open source I can easily make that happen 🙂

Anyways, back to work!

Dealing with Bugs in Other Software

This is a well over due blog post. Honestly, we’ve been so busy with Popcorn Maker it’s been hard to just stop and take sometime to write one of these up 🙂 Anyway, I wanted to talk about one of the things that came along one day out of the blue.

Sometimes there actually isn’t bugs in your code!
We’ve always been striving to make our tests better and it’s an ongoing process. However one day out of the blue we quickly discovered that our tests literally would just stop running in Firefox after the update to version 14. Now our tests load a lot of video; It’s just part of the territory when your library is involved with video on the web it’s just going to happen. Now, recently in Firefox 14 there was a limit placed on the amount threads that can be used to decode media. Combine this with a bug in the code and our test runner would literally just stall in Firefox.

This is obviously a problem and we can’t just ignore the problem and let our tests just “not work” in Firefox until it gets fixed. At this point our tests were all grouped up into single files based on what they were testing. All media module tests were in one single test file, all trackevent test files were grouped together and so on. This meant that we weren’t giving the browser as much time as possible to teardown every single piece of media. In the end what we wound up doing was breaking down every single QUnit qsyncTest block we had into it’s HTML page. This not only means that it’s easier to trace problems with failing/stalling tests but it helps solve our issue of loading too much video too quickly for the browser.

Often one solution creates another problem
As the title suggests, this only opened the door for another problem with our how we load our node server locally. To replace having to use a generic makefile system we use shell.js along with various node modules like CSLINT, JSHINT etc and this allows us to avoid writing annoying makefile code with javascript instead. In particular we use their exec command which allows us to execute typical commands on the command line. For an easy way to start our server we have a shortcut command that changes into the cornfield app’s directory and starts the server.

Now the problem here was another bug that’s present with running shell.js’ exec function asynchronously. Without it our node app would eat a lot of system resources and with it our test runner would cause the server to crash by loading so many resources quickly. If you manually started the app no problems would arrise. Alas, we were blocked by another bug.

However, a clever solution was found! Our code went from:

target.server = function() {
  echo('### Serving butter');

  cd( CORNFIELD_DIR );
  exec('node app.js', { async: true });
};

To….

target.server = function() {
  echo('### Serving butter');

  cd( CORNFIELD_DIR );

  // Use child_process.spawn here for a long-running server process
  // (replaces `exec('node app.js', { async: true });`).
  var server = spawn( 'node', [ 'app.js' ] );

  // Mostly stolen from http://nodejs.org/docs/v0.3.5/api/child_processes.html#child_process.spawn
  server.stdout.on( 'data', function( data ) {
    process.stdout.write( data );
  });

  server.stderr.on( 'data', function( data ) {
    process.stderr.write( "" + data );
  });

  server.on( 'exit', function( code ) {
    console.log( 'server process exited with code ' + code );
  });
};

This allowed us to properly have the server be started asynchronously and no longer have any issues with the tests running in Firefox!

Still need that continuous integration stuff though so we can have our tests always running upon checkin, allowing us to catch any problems earlier.

Popcorn and Popcorn Maker Testing – This is How We Do It


No jokes. I literally had that song pop into my head when trying to think of a title. Enjoy.

My primary focus over this summer has been and will be the testing we have in place for Popcorn Maker. It’s been severely lacking and we need to change that. However, I wanted to take the time to explain everything we do in both projects; what we use and why. First, let’s talk about testing in general.

So, Why is it Important?
This may be a dumb thing to talk about but I’m sure someone would want to know and for completions sake I’m going to briefly talk about it. No matter what kind of software you are writing – library or full fledged application – what you are working on will always have expected functionality. You want to have robust testing because it allows you to easily check against this expected functionality and know if you have broken any of that before you bring it out of development and into production.

Popcorn Testing
Unlike Popcorn Maker, Popcorn already has a great robust testing environment. The test suite it has is rather massive (the amount of tests is in the thousands) and it all uses QUnit based testing. For Popcorn it’s a perfect match because we can easily test ANYTHING in our library without breaking a sweat. It works perfectly for any javascript based library that isn’t reliant on a UI of any sort. The main selling point is that it allows you to easily break down tests into groups and report back useful data about any passing/failing tests. For us it really get’s the job done well and allows us to integrate with other services well such as Test Swarm. More on that later.

Popcorn Maker Testing
Popcorn Maker is a bit different here. Yes, it is all 100% javascript so from far away it would seem that QUnit would cover the job very well here also. Unfortunately it only can go so far because a lot of things need to be tested on the UI elements themselves and not just the core libraries/modules that run everything in the background. We have many QUnit based tests for our core modules, many of which I recently finished polishing up to give them the attention the deserved including many new ones. I also wrote a nice test harness that will run all of our tests together making it really easy to check over all tests at once.

However in the end this doesn’t solve the problem of the UI testing we need. In the past Chris and I played with the Selenium IDE to create some tests written in python based around our testing template. These actually worked before kindofish (totally a word by the way) until we implemented our own DragNDrop which broke these tests and to add to that when we used iframes for our editor and dialogs it was difficult to interact with them using their older Selenium RC. However I took a look recently at another option they have called the Selenium WebDriver API and see if it along with all the changes we have been making would change the results we were having in the past.

Sure enough, it did! I was able to get some basic tests working for our Export Dialog boxes and some basic drag and drop action going on track events. Here’s the code I wrote for the export dialog tests:

import unittest
import time
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException

class PM_HeaderTests(unittest.TestCase):

  def setUp(self):
    self.driver = webdriver.Firefox()
    self.action = ActionChains( self.driver )

  def test_export_dialog(self):
    driver = self.driver
    action = self.action
    templateTitle = "Basic template"
    driver.get( "http://localhost:8888/templates/test.html" )
    driver.maximize_window()

    self.assertEqual( templateTitle, driver.title )

    # Ensure the button is present on the page, then click it
    sourceButton = driver.find_element_by_id( "butter-header-source" )
    self.assertTrue( sourceButton )
    sourceButton.click()

    # Ensure an element with the class_name is present
    # Only ever have this class on the page at one time
    sourceDialog = driver.find_element_by_class_name( "butter-dialog" )
    self.assertTrue( sourceDialog )

    # Get JSON, HTML button in export dialog and their text areas
    jsonButton = driver.find_element_by_class_name( "json-button" )
    htmlButton = driver.find_element_by_class_name( "html-button" )
    jsonTextArea = driver.find_element_by_class_name( "json-export" )
    htmlTextArea = driver.find_element_by_class_name( "html-export" )
    # Ensure the elements were on the page and retrieved
    self.assertTrue( jsonButton )
    self.assertTrue( htmlButton )
    self.assertTrue( jsonTextArea )
    self.assertTrue( htmlTextArea )

    # Check that the appropriate display properties were set when switching to the JSON
    jsonButton.click()
    self.assertEqual( jsonTextArea.value_of_css_property( "display" ), "block" )
    self.assertEqual( htmlTextArea.value_of_css_property( "display" ), "none" )

    # Check that the appropriate display properties were set when switching to the HTML
    htmlButton.click()
    self.assertEqual( jsonTextArea.value_of_css_property( "display" ), "none" )
    self.assertEqual( htmlTextArea.value_of_css_property( "display" ), "block" )

    # Check pressing the ESCAPE key closes the dialog
    try:
      sourceDialog.send_keys( Keys.ESCAPE )
      sourceDialog = driver.find_element_by_class_name( "butter-dialog" )
    except NoSuchElementException as e:
      self.assertTrue( "Dialog not found, as expected" )

    sourceButton.click()
    dialogCloseButton = driver.find_element_by_class_name( "close-button" )

    # Check pressing the close button closes the dialog
    try:
      dialogCloseButton.click()
      sourceDialog = driver.find_element_by_class_name( "butter-dialog" )
    except NoSuchElementException as e:
      self.assertTrue( "Dialog not found, as expected" )

    time.sleep( 2 )

  def tearDown(self):
    self.driver.quit()

if __name__ == "__main__":
    unittest.main()

One of my first few stabs at python so don’t judge me. To summarize, when run this will:

1. Open a Firefox Browser.
2. Navigate to our test page.
3. Maximize the window.
4. Press the View Source button in our header (Export Dialog).
5. Press the View JSON button.
6. Check appropriate display styles for both JSON and HTML text areas.
7. Press the View HTML button.
8. Recheck display styles for both text areas.
9. Check if closing with the ESCAPE key works as expected.
10. Press the View Source button again and then try closing with the explicit close button.

What I’m really hoping for is to find some better sort of callback like system so I know when things are done. Right now things seem fine but I’m half worried I will run into asynchronous issues in the future.

Continuous Integration – Test Swarm
This is actually something we have sort of had for a while now however we never used it much. I would say it boiled down to two factors:

1. We haven’t spent nearly as much time on Popcorn over the last few months and this was the only project it worked with at the time.
2. It wasn’t very convenient to use. The way we had it setup to listen for/run jobs was kind of clunky and cumbersome to use.

Luckily, this has changed thanks to more work done by Jon bringing in Botio to the project and Chris by not only updating our test swarm stuff but also adding integration into our botio system. We use a pull request based system for everything change we make to the project, meaning for every ticket where changes to the code are being made a pull request is made to help review the code. With botio listening for various commands we can comment in the pull request with a particular command and then have results sent back to the pull request. It’s helped make things very efficient for us and when we add in Chris’ work for /botio try to run a job on our test swarm instance we will be golden.

Hope you enjoyed my mini novel on how we go about testing for the projects Popcorn and Popcorn Maker. There will definitely be more to come later on our advances with Selenium. If you want to learn more out what Chris has been doing, check out some of his blog posts such as Time to Automate Butter Unit Testing and Popcorn and Butter Testing.

Popcorn – Focus, Take Aim and Fire!

Big things are coming. Big decisions have been made.

The Popcorn Maker project has been scrapped.

Just kidding.

Anyway, a lot has gone down for us over the last 12 days. For starters we have some final work to finish off on our 0.6 release of Popcorn Maker and our 1.3 release of Popcorn. Both are mostly going to be polishing releases for the work we have done up until now. Popcorn itself is pretty mature and doesn’t need many big ticket features to come on in, but Popcorn Maker is in the middle of some big decisions coming down as to what we want to ship in our 1.0 for the Mozilla Festival in November. So the need for big things to happen right now isn’t very high, we just need to get more minor fixes done.

Popcorn Maker has so many big lofty goals. It really has a bright future with all the cool things we want to do. Unfortunately to make our deadline we are forced to cut away some of these features from landing in 1.0. Easily one of the coolest and most promising things we were thinking of doing was mobile support. Thanks to David Serfried and Robert Stanica we had a promising glimpse at getting some of this working. It’s disappointing to see this thing axed but we have more important things that need to be working for then.

One of those is developing some good templates. While all the new ones we have are really cool we also realize that they are kind of hard to understand and also don’t function very well other than with some of the things they were provided. Kate Hudson is steering the ship behind this with some great designs and ideas on not only templates but how we can improve the overall Popcorn Maker ecosystem to simply be more friendly and easier to pick up.

TESTS!
I’m going to finish these basic unit tests this week. Period. I feel really terrible for letting them hang this long and I’m going to make sure I put a stop to that by finishing them up this week. Part of the reasons why I feel terrible about leaving them hanging for so long is I know someone else could easily have done them much, much quicker than me. If someone else had either the interest in doing them (Wait… sorry had to stop myself from choking there) or just simply the time they could have done them in probably a day or two. Even that I think is being generous. It’s time for me to bang these out because I want to move onto something else. I want to own something else in our project or be a key part of some other area of it. Right now I’ve had my hands dipped into many corners of the project but nothing that was specifically mine started from scratch. Maybe that’s working with Kate on templates, maybe that’s working on cross browser support. We still need to sort out work for what we are doing with these new features coming out of the big meeting last week.

Combine those tests with the work Chris is doing for test swarm and we should be pretty golden. Just need to get my act into gear.

The Summer Thusfar at CDOT w/ Popcorn

A quick summary for anyone who doesn’t know what I have been up to here. My name is Matthew Schranz and I’ve been working full-time specifically on the Popcorn and Popcorn Maker projects since May but was also assisting part-time from January to April. The difference between today and the beginning of May is definitely a big leap in terms of what I understand and the kinds of things I have been able to tackle. I definitely feel like I have a better understanding of a much larger portion of the code base than I do now because of the opportunity I’ve had to tackle various different aspects within the entire Popcorn Maker ecosystem.

Confidence is a major factor. I actually feel like an important part of the team now after spending a lot of time on the project and it was easy to get that opportunity because I was willing to work for it. I’ve gone from pretty low on the totem poll for the project to someone who is counted on to get a bunch of work done and it’s been quite the learning experience getting this far. I’ve been able to work on many different areas of the code, from our server Cornfield to the templates, editors, tests and other general bug fixes. I’ve had the opportunity to expand my knowledge immensely, learn about a lot of different practices/coding styles and just working for a professional organization like Mozilla.

At the same time, I still know I have a ways to go. I feel like I have a lot left to prove and I want to continue working on this as much as possible, often meaning I’m on at night when most of the team isn’t and they think I’m crazy. None the less, I want to push as much as possible.

The rest of the summer is going to be interesting for us. Plans for the entire team/project have definitely changed a fair bit from what we all intended maybe a month ago. For one, David Seifried and Robert Stanica managed to get Popcorn Maker working on the iPad all while not a single person on the team even knew about it. I don’t know if we realistically thought we could get the app working on a mobile device before 1.0 but it’s actually looking very possible.

There are still many hurdles to overcome along with many awesome moments to be shared between now and the 1.0 in November. I just hope I get the chance to go to London for Mozfest to celebrate it 🙂

Popcorn Maker 0.5.x Releases – Story Camp

370 Tickets

That’s how many tickets we have staged/resolved for our 0.5, 0.5.1 and 0.5.2 releases and all over the span of a little more than 6 weeks (June 19). That doesn’t even include the tickets we have landed specifically in our 0.6 branch or the tickets we have landed in Popcorn that were filed/solved for Popcorn Maker. We’ve been kicking ass and taking names, although mostly kicking ourselves in the ass.

Here is a summary of how a felt whenever someone discovered a new bug over the last 2 weeks.

It’s been incredibly tiring as all of worked many, many overtime hours. It was a crazy push over the last 2 weeks but due to everyones incredible work we managed to pull it off and honestly the code feels really robust at this point. Granted, that doesn’t mean there isn’t plenty of work to still be done but there aren’t really any big features left ( that is, until the UX redesign coming in 0.7 ). However that still doesn’t change the fact that we really need to get a good testing infrastructure in place so we occur these problems less. If we could get testswarm working ( our continuous integration system for Popcorn ) in combination with botio then we could easily have our tests run whenever someone ran a simple /botio check command in a pull request.

We specifically need good UI testing in place, however the road to there has proven to be very difficult. We have tried multiple libraries ( CasperJS + Phantom, Selenium ) and none seem to have worked as well as we have wanted. Not having this stuff in place could have easily solved a lot of the bugs/problems we have been experiencing.

Mozilla Story Camp

This has been the driving reason behind why we have been pushing this much over the last bit. It is an initiative of Mozilla to get people involved with creating content on the web using all the cools tools/libraries they have been building. All kinds of events have already gotten underway and it has been really amazing to see what people have come up with thusfar. Surprisingly I haven’t seen lighthouse spammed with bug reports! Although, maybe that’s because we haven’t made it quite as accessible as we may thought we have. None the less it’s going to be an exciting summer seeing what people can come up with and just play with it in ways maybe we didn’t think of.

If you ever get a chance, please check out Popcorn Maker here. The team would love to get any feedback you have about it. User experience, bugs or whatever else you can think of. Or just pop by #popcorn on irc.mozilla.org if you want to as well!

With Great Power…… Comes more tickets

And responsibility. I don’t quite recall where I was going with that line but, I was trying to play off the idea that I recently received admin access to Mozilla’s Butter/Popcorn repos. Now I can help stage tickets as well and we aren’t completely reliant on people like Jon, David, David or Scott to do it.

Anywho, the last week has been a very busy one in Popcornia. We finished a mini release, v0.5.1, which was intended to work over the kinks and other smalls bugs that would be associated with our introduction of the Django front end that will act as the template library and project management for users. Truth be told it felt more like an extended release because we wound up just throwing in as many bugs as we can into the release, especially ones deemed ground breaking for the upcoming Story Camp with Mozilla. The week started off at about 36 tickets and we wound up getting in about 60. Whatever we couldn’t get done, but was still deemed necessary for the Django front end and “beta” release of Popcorn Maker, was pushed to v0.5.2.

It is due to be finished June 15th and it’s ticket total is at 68 with 44 still to be resolved/staged.

I definitely think that isn’t too farfetched of a total, but I know we always managed to find a good 15 more bugs in the final 2 days of a release. Oh, and we have our 0.6 release due to be finished for July 1st which still has 162 tickets left.

Needless to say, the last few weeks have been interesting and so will the next few as well. It’s like we have the pedal down the entire time, with no time to really rest much. This is where we are going to have to cherish our weekends because otherwise we won’t have much time off at all!

Canada Day long weekend camping can’t come soon enough.

That said, it’s still fun and exciting. I’m able to learn more areas of the code and I find myself able to easily take on new tickets and feel confident enough that I can’t handle them. I’m still the king of absurdly long review periods for no good reason though. No one will ever be able to take that crown away from me.

Push it to the Limit – Completing the Code Freeze

This week we finished our code freeze for 0.5. Code freezes are important because a project always needs concrete and frequent updates because these help give it presence in the community. We brought up this very issue when discussing what the team was planning on doing with our upcoming 1.3 Popcorn.js release. It’s important for a project to maintain some sort of release schedule even if the fixes are minor because it helps it helps keep the project look like it’s active and not forgotten.

One of the big advances for this release has been better support for our flash players. Most of the features have all worked pretty well with HTML Video/Audio because Popcorn.js is designed to make use of the extensive library made available by Media Elements Draft, but our Youtube/Vimeo/Soundcloud players have always had issues. They prove to be difficult because they are either missing a lot of pieces of information available to us, meaning we are forced to hack in some sort of implementation or their API wasn’t ideally designed around the experience created by Popcorn.js. There have also been a lot of fixes in the background of the code ranging from simply refactoring for efficiency or better implementations of previous features such as our config files.

Monday and Tuesday this week were intense being the final two days before the code freeze (Tuesday). I spent time polishing up our manual tests, butters test harness, other quick fixes and review lots and lots of tickets. The two days we were like a well oiled machine, firing off fixes and reviews for tickets in quick order. In total we set 180 tickets to resolved/staged over the month of May with a lot of them being some feature rewrites to smaller bugs. Truthfully that number is misleading because a lot of our bugs were exposed by things with Popcorn.js itself, which caused us to file appropriate tickets there first, fix it and then finalize things over in Popcorn Maker land. Out of the 89 tickets that have landed for the 1.3 release of Popcorn, probably 60 of them were spawned in relation to Popcorn Maker. While this week was really intense, it also allowed me to gain basic grasps of more areas of the code. For example, I now have a pretty solid grasp on a lot of our server-side stuff with cornfield because of the rewrite of tests and time spent looking at that code.

That said, we still had to reduce things down. Tuesday morning we started off with something like 30 tickets left and by mid day it dwindled down to about 23. However the entire day we were fighting with our lack of solid testing in place because we would constantly find small bugs along the way and be forced to file them, fix them and then head back to some of the bigger ones we had already knew about. By 4pm we still had around 19 tickets left because of it, forcing us to quickly to do a mini triage and push some of these to our mini release of 0.5.1. That release is focused around integration of our current system with the Django front end that has been in development for some time and is due for June 15th.

One thing I really want to push and get in soon is some sort of back end for our manual tests. I spent some time today bringing together a basic implementation of it and thus far it is looking promising. One thing I definitely want to do is force the two requests I have added for cornfield to send information to a different server/database rather than using the on local to the machine it’s being hosted on. This way whether we are running our manual tests locally on our own machine or from a hosted version elsewhere everyone’s results are posted to the same places.

I’ve also put what I imagine are the final touches on our media spawner plugin. It’s funny because I originally started that way back in January to facilitate a feature being used in a project I was working on to have embedded content as events, which eventually scrapped the idea because they wanted to ensure people with lesser performing connections could view it all. That and tiny 5 to 10 second events didn’t really fit well with loading things like youtube or vimeo videos. Since then I have changed it numerous times because of various improvements to the Popcorn API (such as Popcorn.smart) to make it more efficient/robust. Eventually this plugin became pretty important to some of the templates Kate Hudson has been working on for various projects. Several months later and I think it’s finally ready to land 🙂

Been a crazy week, but there is still plenty more crazy to come. Till next time readers (A.K.A my Mom)!

Code Code Code …. Review Review Review

Code freeze for the 0.5 release of Popcorn Maker/Butter is coming up Tuesday and we have a lot to do before we close the code merging flood gates. In addition to this week being 1 day shorter for most of us because of Victoria day, we also had people venturing off to a conference downtown Thursday making things even tighter schedule wise. Needless to say we have needed to pick up the load to nth level to make up for all the lost man power (or maybe it’s finger power?)!

This week I finished off a few things. One was adding a test harness system for Butter. Now we can have one file that will run all of our QUnit based tests all at once, helping make testing much easier. It will land Monday since it’s now the weekend and whatnot.

I also finished updating the the cornfield tests. They now are use the proper updated methods and on top of that fixing them exposed a few problems with our validation for passed in data. On top of that they are just plain better than they were before. A lot of places in the tests previous used timeouts to call QUnit’s start() method to QUnit know it could run each assertion which could cause potential issues. They now follow a “cascading” style if you will that will have subsequent calls to browserid to happen withing the callback function of the previous call, allowing us to know that the previous work has finished preventing any asynchronous issues. For example:

asyncTest("Async API", 7, function() {
 var foundProject = false;

 butter.cornfield.list( function( res ){
 ok(res, "The project list response has data" );
  equal( res.error, "okay", "Project list status is \"okay\"" );
  ok( res.projects, "There is a list of projects" );

  for( i = 0, len = res.projects.length; i < len; i++ ){
   if( res.projects[ i ].name === filename ){
    foundProject = true;
    break;
   }
  }

  equal( false, foundProject, filename + " is not present in the projects list" );

  butter.cornfield.load( filename, function( res ){
   deepEqual( res, { error: "project not found" }, "The project load response is project not found" );

   butter.cornfield.save(filename, stringedData, function(res){
    equal( res.error, "okay", "The project save response is okay" );

    filename = res.project._id;

    butter.cornfield.load(filename, function(res){
     deepEqual( JSON.parse(res.project), data.data, "The project is the same" );

     start();
    });
   });
  });
 });
});

With this setup we know start won’t be called until our servers has completed our requests with browserid and our database holding project information.

On top of that I took over the manual tests that we are making. These tests contain a list of instructions for people to run and what they expected outcome should be if they follow those instructions. They can then report if the expected results were achieved or not. Eventually these will be linked for a database of some sort where we can monitor the results people will be reporting. Most of the real issues that we had were because the tests themselves were being loaded into an iframe. This caused issues with the sources provided for various plugins and other scripts because they were relative links in our config file. I also realized we were missing some vendor prefixed versions of linear-gradient on the index.html page, causing the links for the manual tests not to appear in browsers that weren’t FF, making it look like nothing loaded at all.

On top of all this there were many reviews. While reviews require that the person doing the reviews takes their time looking over it and is a very important task, it also means that someone has sort of gained enough experience in the project that they can be “trusted” so to speak which is a nice sign that I am progressing a lot within the Butter and Popcorn projects.

Other Cool Stuff
We also have basically a complete rewrite to our flash players in the works. David Humphrey started the work to basically mimic the HTMLMediaElement spec and early testing is showing it’s going to work quite awesome.

We also have the Django front end coming up for the 0.5 release, slated to be available on June 15th. This will create a new template management system and bring a lot of new cool stuff to the project.

0.5 is slated to be about 200 tickets! Yikes.

Can’t wait for the rest 🙂