Speed up macro development cycle

Follow

Comments

4 comments

  • Avatar
    Jay Mitchell

    Hi Ben,

    We have some stories written to speed up macro deployment. Unfortunately, those stories haven't been implemented yet. However, we do have some suggestions on how to speed up the macro development cycle at this point.

    <preaching choir="true">
    The first thing to keep in mind is that unit tests are significantly faster than integration tests, and integration tests are significantly faster than deploying to Mingle. Anything you can do to move the development cycle closer to unit and integration testing, the faster your feedback loop will become. The macro development toolkit creates the following tasks for your macro:
    rake test:units # runs all unit tests
    rake test:integration # runs all integration tests

    Internally, we have also added this rake task, which runs both unit and integration tests:
    desc "Run all tests"
    task :test => ['test:units', 'test:integration']
    </preaching>

    Obviously, tests can only get you so far and at some point you'll need to test your macro by deploying it to Mingle. To speed up the start-up time you'll need to modify the web.xml file on your development instance. I've attached the web.xml that we use for our selenium tests as an example. The key idea is that we get down to one runtime with no background jobs. This will give you a faster startup time.

    Another thing that can speed up the process is to write a rake task to stop Mingle, redeploy the plugin, and start Mingle.

    We've found the above suggestions speed up macro development. It's not perfect, but it does make the process much better.

    Thanks for your feedback,
    Jay

  • Avatar
    Benjamin Butler-Cole

    Thanks, Jay, that's helpful. I don't see that attachment anywhere though...


    Ben

  • Avatar
    Jay Mitchell

    Sorry, I keep attaching the file to that comment, but it doesn't seem to get uploaded. I'm trying it again on this new comment.

  • Avatar
    Jay Mitchell

    OK, file doesn't seem to upload. Here is the content of the file....


    <?xml version="1.0" encoding="ISO-8859-1"?>

    <!DOCTYPE web-app
            PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
            "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">

    <web-app>
        <context-param>
            <param-name>jruby.standalone</param-name>
            <param-value>false</param-value>
        </context-param>
       
        <!-- this determines the maximum number of jruby runtimes in
             the pool (active + idle). increasing this number can increase
             the number of users that can be concurrently supported, but 
             requires that you also increase the maximum heap size for the JVM.
             likewise, this number can be decreased to support a small team, and,
             accordingly, the JVM max heap size can be lowered.
             we do not recommend setting this number to lower than 5, as
             there are background jobs that also make use of this pool.
             the default configuration is a maxObjects value of 8 paired
             a max JVM heap size of 1024m (and max JVM perm gen size of 128m).
             you can see a report on the jruby pool at /runtime-admin  you will
             also see a java heap report there. note that the JVM will typically
             use most of the heap that you allow it to, so do not assume something
             is wrong if the 'total' or 'in use' values is close to the 'max' value. -->
        <context-param>
            <param-name>jruby.pool.maxObjects</param-name>
            <param-value>1</param-value>
        </context-param>
       
        <!-- a background thread will ensure that there are always
             this number of idle jruby runtimes, so long as
             active + idle does not exceed maxObjects -->
        <context-param>
            <param-name>jruby.pool.minIdle</param-name>
            <param-value>1</param-value>
        </context-param>
       
        <context-param>
            <param-name>jruby.pool.initialSize</param-name>
            <param-value>1</param-value>
        </context-param>
       
        <context-param>
            <param-name>jruby.pool.checkInterval</param-name>
            <param-value>500</param-value>
        </context-param>
       
        <context-param>
            <param-name>jruby.pool.maxWait</param-name>
            <param-value>60000</param-value>
        </context-param>
       
        <context-param>
            <param-name>jruby.session_store</param-name>
            <param-value>db</param-value>
        </context-param>
       
        <context-param>
            <param-name>rails.env</param-name>
            <param-value>test</param-value>
        </context-param>
       
        <listener>
            <listener-class>com.thoughtworks.mingle.MingleRailsContextListener</listener-class>
        </listener>
       
        <listener>
          <listener-class>com.thoughtworks.mingle.BootstrapListener</listener-class>
        </listener>

        <filter>
            <filter-name>startupFilter</filter-name>
            <filter-class>com.thoughtworks.mingle.StartupFilter</filter-class>
            <init-param>
                <param-name>forwardToWhileStarting</param-name>
                <param-value>/startup.html</param-value>
            </init-param>
        </filter>
       
        <servlet>
            <servlet-name>MemcachedServlet</servlet-name>
            <servlet-class>com.thoughtworks.mingle.MemcachedServlet</servlet-class>
            <load-on-startup>-2</load-on-startup>
        </servlet>
       
        <!-- This servlet provides ActiveMQ connection factory for other servlets -->
        <servlet>
            <servlet-name>ActiveMQSupportServlet</servlet-name>
            <servlet-class>com.thoughtworks.mingle.ActiveMQSupportServlet</servlet-class>
            <load-on-startup>-1</load-on-startup>
        </servlet>

        <servlet>
            <servlet-name>TestMurmurServlet</servlet-name>
            <servlet-class>com.thoughtworks.mingle.TestMurmursServlet</servlet-class>
            <load-on-startup>3</load-on-startup>
        </servlet>

       
        <servlet>
          <servlet-name> bootstrap_status </servlet-name>
          <servlet-class>com.thoughtworks.mingle.BootstrapStatusServlet</servlet-class>
          <load-on-startup>2</load-on-startup>
        </servlet>

        <servlet>
          <servlet-name>eval</servlet-name>
          <servlet-class>com.thoughtworks.mingle.EvalServlet</servlet-class>
          <load-on-startup>2</load-on-startup>
        </servlet>

        <servlet>
          <servlet-name>class_method_call</servlet-name>
          <servlet-class>com.thoughtworks.mingle.ClassMethodServlet</servlet-class>
          <load-on-startup>2</load-on-startup>
        </servlet>
       
        <servlet>
            <servlet-name>rails</servlet-name>
            <servlet-class>com.thoughtworks.mingle.MingleRailsServlet</servlet-class>
            <load-on-startup>2</load-on-startup>
        </servlet>
       
        <servlet>
            <servlet-name>status</servlet-name>
            <servlet-class>com.thoughtworks.mingle.RuntimeStatusServlet</servlet-class>
            <load-on-startup>2</load-on-startup>
        </servlet>   

        <servlet>
            <servlet-name>files</servlet-name>
            <servlet-class>org.jruby.webapp.FileServlet</servlet-class>
            <init-param>
              <param-name>defaultServlet</param-name>
              <param-value>rails</param-value>
            </init-param>
            <init-param>
              <param-name>maxAge</param-name>
              <param-value>1</param-value><!-- 1 sec -->
            </init-param>
            <load-on-startup>2</load-on-startup>
        </servlet>

        <servlet>
            <servlet-name>mingleFiles</servlet-name>
            <servlet-class>com.thoughtworks.mingle.DataDirFileServlet</servlet-class>
            <init-param>
              <param-name>maxAge</param-name>
              <param-value>1</param-value><!-- 1 sec -->
            </init-param>
            <load-on-startup>2</load-on-startup>
        </servlet>
       
        <filter-mapping>
            <filter-name>startupFilter</filter-name>
            <url-pattern>*</url-pattern>
        </filter-mapping>
       
        <servlet-mapping>
            <servlet-name>files</servlet-name>
            <url-pattern>/</url-pattern>
        </servlet-mapping>
       
        <servlet-mapping>
            <servlet-name>status</servlet-name>
            <url-pattern>/status/*</url-pattern>
        </servlet-mapping>
       
        <servlet-mapping>
            <servlet-name>bootstrap_status</servlet-name>
            <url-pattern>/bootstrap_status/*</url-pattern>
        </servlet-mapping>

        <servlet-mapping>
            <servlet-name>eval</servlet-name>
            <url-pattern>/_eval/*</url-pattern>
        </servlet-mapping>

        <servlet-mapping>
            <servlet-name>class_method_call</servlet-name>
            <url-pattern>/_class_method_call/*</url-pattern>
        </servlet-mapping>

        <servlet-mapping>
            <servlet-name>mingleFiles</servlet-name>
            <url-pattern>/attachments/*</url-pattern>
        </servlet-mapping>

        <servlet-mapping>
            <servlet-name>mingleFiles</servlet-name>
            <url-pattern>/project/*</url-pattern>
        </servlet-mapping>

        <servlet-mapping>
            <servlet-name>TestMurmurServlet</servlet-name>
            <url-pattern>/test_murmurs/*</url-pattern>
        </servlet-mapping>

        <!-- allow users to view source of jsp files in Mingle; without it, jetty will attempt to compile file and then show error -->
        <servlet-mapping>
            <servlet-name>files</servlet-name>
            <url-pattern>*.jsp</url-pattern>
        </servlet-mapping>
       
        <session-config>
          <session-timeout>60</session-timeout>
        </session-config>   
    </web-app>

Please sign in to leave a comment.