Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fix links, minor improvements

Note: this page is

This page is a quick HOWTO explaining how to easily contribute patches to Nutch. It assumes you are using some form of Unix.

...

Building a patch

First of all, please perform some minimal non-regression tests by:

  • rebuilding the whole entire Nutch code
  • executing the whole entire unit tests.

Building Nutch

...

  • run unit tests from a single core test class (use class name without package path):

    No Format
    ant test-core -Dtestcase=TestMimeUtil
    


  • run unit tests for a specific plugin:

    No Format
    ant test-plugin -Dplugin=protocol-okhttp
    


  • or exclude test files by patterns:

    No Format
    ant -Dtest.exclude='TestCrawlDb*.java **/TestNutchServer*' test
    


See also bin/nutch junit and WritingPluginExample-1.2#Unit_testing.

...

If you are perfectionist you can also perform some functional tests by running a small crawl using Nutch. Please refer to the NutchTutorial

...

  1. try to reproduce the problem. If you're not able to reproduce a problem, it's impossible to test whether a patch really resolves it.
  2. try to get a clear understanding of the problem
  3. have a look at the patch file: Ideally, you'll get and understanding about the solution proposed by the patch (no problem if not)
  4. apply the patch, see below #Applying_patches
  5. build Nutch and test whether the problem disappeared
  6. does the patch break other things (add regressions)?

...