0

Lately we've been looking at ways to improve automated testing and related tooling of our enterprise-level GWT web app. I've realized that in some ways, GWT is a bit hostile to automated testing, mainly because of the nature of the long GWT compile times from Java to JS. This makes unit testing somewhat challenging, but it also puts some roadblocks up for testing in a CI environment. I've also found out that some of our build and deployment processes are somewhat complicated due to the nature of GWT's compile process.

Is this a general problem for "compile to JS" frameworks for webapps? I don't have much experience with them, but I can see some potential problems for automated testing and continuous integration and deployment. Some issues I see:

  • Long build and compile times preventing quick deployments
  • Language the app is developed in != JS, preventing good unit testing
  • Obfuscated JS in the actual app makes it more like a executable than a web app

Are these issues present in other similar frameworks, or is this more a GWT issue?

  • Do you have to recompile everything all the time with each change? – JeffO Nov 11 '13 at 16:05
  • @JeffO Probably not, but a full rebuild could be helpful on a nightly basis, or even multiple times a day, if possible. – joshin4colours Nov 11 '13 at 16:09
  • Sure: night time, coffee break, lunch, meeting, other non-programming task, etc. Seems continuous enough. – JeffO Nov 11 '13 at 19:42
6

We factor our GWT code out into "core" and "gwt" projects. The "core" project contains 100% pure Java, non-GWT code, and can be unit tested easily using regular JUnit.

How long does your build take? Ours, with about 100 classes takes 1-2 minutes, barely noticeable.

With regards to your initial question -- I treat "compile to JavaScript" much the same as "compile to bytecode" or "compile to machine code", don't see why it would affect continuous integration.

| improve this answer | |
  • Depending on the settings, the GWT build can take over 20 min. The separation of pure Java/GWT makes some sense, actually. – joshin4colours Nov 11 '13 at 16:07
  • 3
    20 minutes does sound like a lot, why does it take so long? Suggestions to reduce are: ensure you are building only the permutations you need; ensure you are using the latest version of GWT; look at upgrading your build machine. – funkybro Nov 11 '13 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.