Tuesday, December 11, 2012

display ec2-name and ip-address as ssh-config or hosts file


Inspired by this instagram engineering blog, I wrote a python script to printout ec2 hostname and ip-address as ssh-config or hosts file format.

In our environment, unfortunately we don't have dns for ec2 hosts, for now. 
I use /etc/hosts. Some people use ssh-config file.

This script may help others who are in similar environment where using ssh-config or hosts file to manage ec2-host mapping.

Usage



ec2-printconfig script


Thursday, June 14, 2012

util method that runs TestNG test classes and verify the result



The method does:
  • run TestNG tests programmatically
  • verify the failures happened in TestNG tests run
  • If there is a failure, combine all assertion messages including stack trace, then make a single AssertionError

(I'm also using google-guava)






Sunday, March 25, 2012

run jetty on dependency resolved war in gradle



Background:
  • test classes(such as selenium tests) are in an independent module(maven project, etc.).
  • have an external dependency(mave, ivy, etc) to war file(s)
  • want to run jetty on dependent war file(s)
Gradle can start up jetty on dependency resolved war file(s).


When you want to run your tests after jetty started, set "daemon=true" and make the test task depends on your new run-war task.


Monday, March 5, 2012

run multiple jetty in gradle


Background:
I have a selenium test suite for end-to-end web testing.
Currently, it is running on jenkins box but it is taking so long to finish all the tests.
So, next step is to parallelize the selenium tests.
As a first step, I need to start multiple jetty servers using different port.

With Gradle jetty plugin, I camp up how to run the multiple jetty servers before tests.