Edgewall Software

I noticed there isn't really a collection of recipes available yet, so I thought it prudent that I start one. I don't have much content yet, and anyone should feel free to reorganize it.

Running Zope Tests

This is very specific to my Zope installation. I had to create the run_tests script in my SVN. I would like a more generic method. Perhaps it will be prudent to create a "zope" namespace.

<build xmlns:python="http://bitten.cmlenz.net/tools/python">

  <step id="test" description="Runs run_tests, which invokes the zope testrunner.">
    <python:exec file="run_tests.py" args="-m module.module"/>
  </step>

</build>

Complicated Maven Build

There's probably some ways I could make this simpler.

First off, we need to use an in-memory database to run our tests, hence the changes to persistence.xml.

Then, we run the tests on their own.

Then, we install the modules of the project (I'm not certain how necessary this is, but I wanted to ensure that any module dependencies would resolve to the local copies, not the ones on the remote repository).

Then, we run clover:instrument and clover:clover. Technically, we shouldn't need to do this, because it should be handled by the site generation, but there's apparently a bug somewhere, in Maven or Clover, that makes it necessary to run Clover twice to get the results we want. Yes, this does mean we run all the tests twice, or possibly three times (ugh).

Then we revert to the proper version of persistence.xml.

Then we deploy, skipping the tests.

<build xmlns:sh="http://bitten.cmlenz.net/tools/sh">

  <step id="configure_1" description="Configure Persistence.xml">
    <sh:exec executable="mv" args="UI/src/main/resources/META-INF/persistence.xml UI/src/main/resources/META-INF/PGSQLpersistence.xml" />
  </step>

  <step id="configure_2" description="Configure Persistence.xml">
    <sh:exec executable="cp" args="UI/src/main/resources/META-INF/testPersistence.xml UI/src/main/resources/META-INF/persistence.xml" />
  </step>

  <step id="test" description="Call Maven Test">
    <sh:exec executable="mvn" args="-Pbootstrap test" />
  </step>

  <step id="install" description="Call Maven Install">
    <sh:exec executable="mvn" args="-Pbootstrap install" />
  </step>

  <step id="clover_prep" description="Prepate clover">
    <sh:exec executable="mvn" args="clover:instrument clover:clover" />
  </step>

  <step id="site" description="Deploy the site">
    <sh:exec executable="mvn" args="site-deploy" />
  </step>

  <step id="configure_3" description="Configure Persistence.xml">
    <sh:exec executable="cp" args="UI/src/main/resources/META-INF/PGSQLpersistence.xml UI/src/main/resources/META-INF/persistence.xml" />
  </step>

  <step id="deploy" description="Call Maven Deploy">
    <sh:exec executable="mvn" args="-Pbootstrap -Dmaven.test.skip=true deploy" />
  </step>

</build>
Last modified 6 years ago Last modified on Oct 13, 2011 12:45:30 PM