It is a good idea to run the Ozone Acceptance and Unit tests before committing your patch. The whole process takes around 20 minutes, including the time taken to build the Ozone tarball.


  1. Ensure you have the following tools installed on your development machine.
    1. Docker
    2. jq. On MacOS, this can be installed with homebrew using brew install jq
    3. Robot Framework. On MacOS, this can be installed using brew install robot-framework

  2. Build an Ozone tarball and docker images with (see Try out Ozone for details):

    mvn clean install -DskipTests=true
  3. Run the Tests.
    1. Smoke Tests. This will launch docker containers, run tests, and create a report named report.html in the directory hadoop-ozone/dist/target/ozone-<<version>>. Here <<version>> denotes the ozone version. This will execute all the tests in all the available environments. Open the report file in a browser and if the page background is green, we are good.

      cd hadoop-ozone/dist/target/ozone-<<version>>/compose
      bash ./test-all.sh
      open report.html

      Note: you can also execute tests just for one specific environment:

      cd hadoop-ozone/dist/target/ozone-<<version>>/compose/ozone
      bash ./test.sh
    2. Fault Injection Tests. This test suite is designed to inject network latency, disk corruptions into Ozone cluster for verifying the cluster can perform correctly in some extreme conditions.

      cd hadoop-ozone/fault-injection-test
      mvn verify -Pit
    3. HDDS Unit Tests.

      cd hadoop-hdds
      mvn test
      
    4. Ozone Unit Tests.

      cd hadoop-ozone
      mvn test

Look at the results and then commit the patch.


Troubleshooting

If the acceptance tests fail, retry the above steps running on a clean branch (without your changes). If they continue to fail then it is likely that docker containers did not start correctly. You should see error messages on the terminal.

Also try out the following:

  1. Ensure that the directory ./hadoop-ozone/dist/target/ozone-<<VERSION>>/compose/ozone/ exists in your source tree after the build completes.
  2. Go to ./hadoop-ozone/dist/target/ozone-<<VERSION>>/compose/ozone/ and run 'docker-compose up'.
  3. Ensure that Ozone services start up correctly in the docker containers.
  4. If this step fails, check that the file .env exists and has a line like the following (the exact version may be different).
    • HDDS_VERSION=0.4.0-SNAPSHOT


These steps were originally compiled by Anu Engineer (Apache ID aengineer).

  • No labels