Monthly Archives: January 2016

Watching – Creating Well-tested Applications in Go @ PluralSight

It was a great course which covers wide range of topics around testing in golang. I once saw some descriptions that golang has very simple verification syntax, and I was assuming that it only has limited testing functionalities. It was wrong and golang comes with various and extensive toolsets for testings.

Among the topics, what I found interesting are,

  • Blackbox Testing
    • “testing/quick” package (https://golang.org/pkg/testing/quick/) provides utility functions to help with black box testing. It’s kind of property-based testing, which verifies against randomly generated values.
  • Example Testing
    • Examples can be used for both documentation and behavior verification (https://golang.org/pkg/testing/). It’s kind of doctest with nice StdOut hooking.
  • Performance Profiling

Other languages have similar functionalities, but these ones in golang sounds simple and solid, and I would like to try out.

Elixir + Phoenixframework + Heroku (SpawnViewer Updated)

http://www.phoenixframework.org/
https://github.com/parroty/spawn_viewer

As an exercise for catching up latest Phoenixframework features, I’ve updated an fairly old heroku app to the latest (v0.4.0 -> v1.1.1) version. It was harder than expected, and leaving some struggle notes here.

  • Basically, the official document (http://www.phoenixframework.org/docs/heroku) covers the procedure to deploy phoenix application to heroku.
    • Struggled on the error around missing config/prod.secret.exs which is described in the document.
    • Also, there’re some configuration settings required around config/prod.exs and it seems difficult to apply heroku button with fixed parameters.
    • As phoenix requires node verison >= 5.0, and node_version in phoenix_static_buildpack.config needed to be specified by following the buildpack README description.
  • The controller’s json/2 expects data model which Poison can encode into JSON (changed from JSON data itself). I was using exjsx and needed to change the data accordingly as keyword lists couldn’t be encoded.
  • Reloading pages seems not working on Chrome + Ghostery, and just showing blank. It was confusing for isolating the issues.
  • New asset compilation with Brunch was a difficult for me, as I don’t much experience on JS developments. The js files using global variables (highlight.js) needed to be stored in vendor directory instead of js as in the following document.

Anyway, re-realized upgrading from actively developed v0.x.y framework is very hard…