Grunt with QUnit setup on Travis-CI, with SlimerJS

QUnit running on Travis-CI, with SlimerJS

Due to performance considerations, I’ve removed IndexedDB dependency completely from JSZhuyin, the Chinese IME implementation entirely in JavaScript. The program now do searches entirely in the memory with pre-built binary data (the data is built with node with JavaScript too). In order to future-proof the development I’ve enabled Travis CI to run tests with SlimerJS too. For those of you who is not familiar, SlimerJS is the Gecko (Firefox) equivalent of PhantomJS, which allow you to control a browser instance (e.g. to run a QUnit test page in this case) with JavaScript API.

Why not PhantomJS?

For starter, I don’t hate PhantomJS because it’s not Gecko. I love the tool and it’s pioneering idea, but the shipping version lacks of a lot of browser APIs needed for my project to run. It does not come with Function.prototype.bind (reason given here); nor I have no idea the version of WebKit it is shipping with, given the fact it comes with ArrayBuffer interface but without other basics like Uint16Array. Since JSZhuyin rely on these interfaces to work on binary data, I would have to set up the CI with anything other than PhantomJS.

The setup

If you are looking to run PhantomJS and QUnit, the grunt-contrib-qunit task is so easy to set up and it’s probably not warrant a post here. For testing on SlimerJS, I’ve turned to the grunt-shell task instead and run it with a shell script. Without messing up the format of the post here, please refer to the actual setup:

The first problem I hit was that SlimerJS does not return exit code due to Gecko constant. tee the output to a file and grep it solve the problem. The last small glitch I encountered when I push everything to Travis CI was the fact $TMPDIR directary is not actually writable in their VMs; so I moved the temporary file to the working directory instead.

Conclusion

I hope this post will help you get everything running. Web testing and automation is a gigantic topic in which I’ve just starting scratching it’s surface; sometimes I wish there should be a simple tool where you could set it up and forget it, but I still enjoy the alternative process before that show up.

Mozilla Summit 2013

I was invited to the last two Mozilla Summits but I always missed it. This year, I finally be able to attend the Summit.

Mozilla Summit 2013

So what is Mozilla Summit? The apparent approximation of the Summit would be to think of it as a three-day festival, to celebrate what we want to achieve and also to reaffirm our Mission; however, Summit is way, way more than that. I am humbled and comforted by the fact I got to engage in many high-level, philosophical conversations about Mozilla and the Mission itself, in a lot of breakout sessions. Some of the questions being bought up were fundamental questions like what is a Mozillian, challenges of communicate the vision to the boarder audiences like the general users (kudos to @potch on many of his insight comments), to practical questions like how to work with closed mobile industry partners, and our challenges with our current position in the mobile market, and internal organization.

These are all important conversations that I have little chance to talk about in the office, given the fact we are all caught up in daily work. To my embarrassment, I feel I should ask forgiveness on being cynical in conversations. Nonetheless, to me, it’s more important to know how we are doing than why. The summit shouldn’t be a three-day religious or self-reinforcing event where only the good news were told; I am really glad it didn’t being hold like this for the majority of the time spent. To my relieve, I am also happy to find out most of people are much more energetic and optimistic about how we are doing, and much more hopeful on whether or not we will getting there, and devoting their thoughts on what we could do more to get there.

During the keynote, the main message of the Summit given was “We’re here to build an Internet the world needs.”. I totally agree that Mozilla should expand it’s mission from simply Open Web to Open Internet, although my question about Open Hardware being the foundation of Open Internet and another eventual goal of the project was not being picked up during the QA session. I’ve also heard little discussions (expect DRM) on some of our seemly conflicting means to reach the end, which, arguably, is a good thing (because that means most of us in the Summit agrees the Mozilla way — making concessions in order to gain future influences).


toronto

On topics unrelated to the Summit directly: I found that Toronto is a really lucky city, being gifted to have the off-shore Toronto islands that serves as a getaways and an “central park”. The city itself is a bit chaotic though as they were constructions around the Union station. However the 12 hours time difference stuck me hard; I missed a few night events because I was so tired that I had to crush to bed.

By the way, best wishes to Margaret and Gavin 😀 They were call up to the stage by Jay during closing in Toronto on their #MozLove: they first met on Summit 2010 and got engaged last week. I am pretty sure they weren’t the first ones and they won’t be the last ones.

That’s us, we are the hopelessly idealistic, happy, and innocent, Mozillians.

Group.NCTU 轉信站關門

看了 DK 的《Group.NCTU.edu.tw (2003~2013)》這篇文章一陣子,才想到我也可以寫個自以為的憑弔文(?)。

2008 年的時候,仰賴了 Group.NCTU 寫了一個 Blog 文章轉信到 BBS 站個板的 WordPress Plug-in,讓 WordPress 成為 NNTP client 把部落格文章發到個人版去。當初還花滿多時間寫的呢,也有一些遠大的計畫(例如,把文章同步到個版,再把回覆或是推文同步回來作為部落格回應),不過都沒有完成。自己的 BLOG 後來也因為一些實用的問題所以把 Plug-in 停用了;甚至到 2010 年連個板都關掉了(本來在無名 BBS 後來在 PTT2)。

當年沒有 Github 所以程式碼也不知道放到哪去了。沒有做版本控制,我甚至不太確定 2008 年的我知不知道版本控制這個慨念。唯一確定的事是後來 CornGuo 那邊一直都把程式開著,偶而會在他荒廢的個板看到 WordPress 發過去的 BLOG 文章。應該跟他要一份程式碼來存檔留念,哈。

還是懷念那個雙向的 read-write Web;雖然地點多了一點、雜了一些,但是學習、演化、重混的機會比現在多太多了。要謝謝前輩們花心思建立了這些像是 Group.NCTU 的基礎建設服務,但回頭也會慚愧想想自己是不是沒有傳承。