Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Check out latest stable release from Subversion repository
    Code Block
    svn co https://svn.duraspace.org/duracloud/tags/duracloud-1.0.9.0
    
  2. Set environment variables
    Code Block
    export JAVA_OPTS="-XX:MaxPermSize=256m"
    export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=1024m"
    
  3. Configure Tomcat
    1. Add to $CATALINA_HOME/conf/tomcat-users.xml
      No Format
      <tomcat-users>
        <role rolename="manager"/>
        <role rolename="admin"/>
        <user username="[ANY-USERNAME]" password="[ANY-PASSWORD]" roles="admin,manager"/>
      </tomcat-users>
      
  4. Start tomcat
    Code Block
    $CATALINA_HOME/bin/startup.sh
    
  5. Configure Maven2
    1. Add tomcat user to $M2_HOME/conf/settings.xml
      No Format
      <servers>
        <server>
          <id>tomcat-server</id>
          <username>[ANY-USERNAME]</username>
          <password>[ANY-PASSWORD]</password>
        </server>
      </servers>
      
  6. Build with only unit tests
    1. From top of source tree
      Code Block
      mvn clean install -PskipIntTests
      
      Note: Each of the maven2 project modules are configured to halt the build if there is a test failure. The only exception to this is the integration-test module which is configured to run through all of its tests regardless of failures. So the above build command can optionally exclude the '-PskipIntTests' flag if desired.
Info

Building in Windows: Currently the service projects which deploy as WAR files (beginning with WebAppUtilService) do not pass unit tests on a Windows environment due to limitations regarding the deployment of Tomcat instances. You may choose to either perform a build skipping tests "mvn clean install -DskipTests" or to allow the tests to run but not stop the build "mvn clean install -Dmaven.test.failure.ignore=true"

Build with integration tests

This step assumes the successful completion of the previous build instructions.
As mentioned above, the integration tests require credentials in order to connect to the underlying storage providers. The tests themselves are configured to acquire these credentials from a locally created, encrypted database.

  1. Create unit-test-db
    • From inside the //unit-test-db module, run:
      Code Block
      
      mvn assembly:assembly
      java -jar target/unit-test-db-[VERSION]-db-util.jar
      
  2. Running the above db util jar will provide a commandline interface for adding credentials
  3. Add credentials for s3, emc, rackspace, root-user
    1. Set the root-user to username: 'root', password: 'rpw' to just use the application default.
    2. See root user discussion below for ways of changing the default.
  4. Add the connection details for the unit-test-db to $M2_HOME/conf/settings.xml
    No Format
    
    <profile>
      <id>always</id>
      <properties>
        <duracloud.home>[LOCATION-WHERE-APPLICATION-HAS-WRITE-ACCESS]</duracloud.home>
        <unit.database.home.default>[LOCATION-WHERE-UNIT-TEST-DB-WAS-CREATED]</unit.database.home.default>
        <unit.database.password.default>[UNIT-TEST-DB-BOOT-PASSWORD]</unit.database.password.default>
      </properties>
    </profile>
    
    <activeProfiles>
      <activeProfile>always</activeProfile>
    </activeProfiles>
    
    • where duracloud.home is the directory under which the logs and osgi-container will be placed
    • where unit.database.home.default is the location of the unit-test-database created above
    • where unit.database.password.default is the boot password used during creation of the unit-test-database above
  5. The integration tests also expect a registry (read: 'space') of services to be available within the primary storage provider of service storage host
    1. The naming of the space follows the convention "duracloud-<version>-service-repo"
    2. The services to be loaded into the registry can be found in the target directories of each of the service projects
    3. See discussion below about application configuration, including the service storage host
  6. Build with unit and integration tests
    1. From top of source tree
      Code Block
      
      mvn clean install
      
  7. As mentioned before, if there are any failures in the //integration-test module, the build will still complete, but the failures will be listed
    1. Due to the length of time required to execute integration tests as well as the nature of "eventually consistent" cloud services to not cooperate with a synchronous test suite, these tests are not included in the build by default.
Build with OSGi services container integration tests

...