http://git-wip-us.apache.org/repos/asf/yetus/blob/1a20466f/documentation/in-progress/precommit-apidocs/smart-apply-patch/index.html ---------------------------------------------------------------------- diff --git a/documentation/in-progress/precommit-apidocs/smart-apply-patch/index.html b/documentation/in-progress/precommit-apidocs/smart-apply-patch/index.html new file mode 100644 index 0000000..f7ce6e5 --- /dev/null +++ b/documentation/in-progress/precommit-apidocs/smart-apply-patch/index.html @@ -0,0 +1,441 @@ + + + + + + Apache Yetus + + + + + + + + + + + + + + + +
+ + + + +
+ +

Public/Stable/Not Replaceable

+ +

setup_defaults

+ + +
setup_defaults
+
+ + + +

Setup the default global variables

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableNo
+ +

yetus_usage

+ + +
yetus_usage
+
+ + + +

Print the usage information

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableNo
+ +

None/None/Not Replaceable

+ + + + +
add_footer_table
+
+ + + +

None

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudienceNone
StabilityNone
ReplaceableNone
+ +

add_test

+ + +
add_test
+
+ + + +

None

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudienceNone
StabilityNone
ReplaceableNone
+ +

add_vote_table

+ + +
add_vote_table
+
+ + + +

None

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudienceNone
StabilityNone
ReplaceableNone
+ +

big_console_header

+ + +
big_console_header
+
+ + + +

None

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudienceNone
StabilityNone
ReplaceableNone
+ +

Private/Evolving/Not Replaceable

+ +

import_core

+ + +
import_core
+
+ + + +

import core library routines

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePrivate
StabilityEvolving
ReplaceableNone
+ +
+
+
+ +
+ + + http://git-wip-us.apache.org/repos/asf/yetus/blob/1a20466f/documentation/in-progress/precommit-apidocs/test-patch/index.html ---------------------------------------------------------------------- diff --git a/documentation/in-progress/precommit-apidocs/test-patch/index.html b/documentation/in-progress/precommit-apidocs/test-patch/index.html new file mode 100644 index 0000000..dc942c4 --- /dev/null +++ b/documentation/in-progress/precommit-apidocs/test-patch/index.html @@ -0,0 +1,1844 @@ + + + + + + Apache Yetus + + + + + + + + + + + + + + + +
+ + + + +
+ +

Public/Stable/Replaceable

+ +

relative_dir

+ + +
relative_dir path
+
+ + + +

is a given directory relative to BASEDIR?

+ + + +

@returns 1 - no, path

+ +

@returns 0 - yes, path - BASEDIR

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableYes
+ +

verify_multijdk_test

+ + +
verify_multijdk_test test
+
+ + + +

Verify if a given test is multijdk

+ + + +

1 = yes

+ +

0 = no

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableYes
+ +

Public/Stable/Not Replaceable

+ + + + +
add_footer_table subsystem string
+
+ + + +

Add to the footer of the display. @@BASE@@ will get replaced with the correct location for the local filesystem in dev mode or the URL for Jenkins mode.

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableNo
+ +

add_header_line

+ + +
add_header_line string
+
+ + + +

Add to the header of the display

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableNo
+ +

add_test_table

+ + +
add_test_table failurereason testlist
+
+ + + +

Special table just for unit test failures

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableNo
+ +

add_vote_table

+ + +
add_vote_table +1/0/-1/null subsystem string
+
+ + + +

Add to the output table. If the first parameter is a number that is the vote for that column and calculates the elapsed time based upon the last start_clock(). If it the string null, then it is a special entry that signifies extra content for the final column. The second parameter is the reporting subsystem (or test) that is providing the vote. The second parameter is always required. The third parameter is any extra verbage that goes with that subsystem.

+ + + +

Elapsed time display

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableNo
+ +

big_console_header

+ + +
big_console_header string
+
+ + + +

Large display for the user console

+ + + +

large chunk of text

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableNo
+ +

clock_display

+ + +
clock_display seconds
+
+ + + +

Convert time in seconds to m + s

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableNo
+ +

echo_and_redirect

+ + +
echo_and_redirect filename command [..]
+
+ + + +

Print the command to be executing to the screen. Then run the command, sending stdout and stderr to the given filename This will also ensure that any directories in ${BASEDIR} have the exec bit set as a pre-exec step.

+ + + +

@returns $?

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableNo
+ +

generate_stack

+ + +
generate_stack
+
+ + + +

generate a stack trace when in debug mode

+ + + +

exits

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableNo
+ +

module_file_fragment

+ + +
module_file_fragment module
+
+ + + +

Convert the given module name to a file fragment

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableNo
+ +

offset_clock

+ + +
offset_clock seconds
+
+ + + +

Add time to the local timer

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableNo
+ +

setup_defaults

+ + +
setup_defaults
+
+ + + +

Setup the default global variables

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableNo
+ +

start_clock

+ + +
start_clock
+
+ + + +

Activate the local timer

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableNo
+ +

stop_clock

+ + +
stop_clock
+
+ + + +

Print the elapsed time in seconds since the start of the local timer

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableNo
+ +

Public/Stable/Not Replaceable

+ +

write_comment

+ + +
write_comment ## @params filename
+
+ + + +

Write the contents of a file to all of the bug systems (so content should avoid special formatting)

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableNone
+ +

Public/Stable/Not Replaceable

+ +

yetus_usage

+ + +
yetus_usage
+
+ + + +

Print the usage information

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityStable
ReplaceableNo
+ +

Public/Evolving/Not Replaceable

+ +

bugsystem_linecomments

+ + +
bugsystem_linecomments filename
+
+ + + +

Write comments onto bug systems that have code review support. File should be in the form of “file:line:comment”

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityEvolving
ReplaceableNo
+ +

calcdiffs

+ + +
calcdiffs
+
+ + + +

Calculate the differences between the specified files and output it to stdout.

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityEvolving
ReplaceableNo
+ +

clear_personality_queue

+ + +
clear_personality_queue
+
+ + + +

Reset the queue for tests

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityEvolving
ReplaceableNo
+ +

compile

+ + +
compile branch|patch
+
+ + + +

Execute the compile phase. This will callout to _compile

+ + + +

0 on success

+ +

1 on failure

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityEvolving
ReplaceableNo
+ +

compile_cycle

+ + +
compile_cycle branch|patch
+
+ + + +

Execute the static analysis test cycle. This will callout to _precompile, compile, _postcompile and _rebuild

+ + + +

0 on success

+ +

1 on failure

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityEvolving
ReplaceableNo
+ +

distclean

+ + +
distclean
+
+ + + +

Wipe the repo clean to not invalidate tests

+ + + +

0 on success

+ +

1 on failure

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityEvolving
ReplaceableNo
+ +

generic_count_probs

+ + +
generic_count_probs
+
+ + + +

Helper routine for plugins to ask projects, etc to count problems in a log file and output it to stdout.

+ + + +

number of issues

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityEvolving
ReplaceableNo
+ +

generic_post_handler

+ + +
generic_post_handler origlog testtype multijdkmode run commands
+
+ + + +

Generic post-patch handler

+ + + +

0 on success

+ +

1 on failure

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityEvolving
ReplaceableNo
+ +

generic_postlog_compare

+ + +
generic_postlog_compare origlog testtype multijdkmode
+
+ + + +

Generic post-patch log handler

+ + + +

0 on success

+ +

1 on failure

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityEvolving
ReplaceableNo
+ +

generic_pre_handler

+ + +
generic_pre_handler testype multijdk
+
+ + + +

Helper routine for plugins to do a pre-patch prun

+ + + +

1 on failure

+ +

0 on success

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityEvolving
ReplaceableNo
+ +

initialize

+ + +
initialize $@
+
+ + + +

Setup to execute

+ + + +

0 on success

+ +

1 on failure

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityEvolving
ReplaceableNo
+ +

module_status

+ + +
module_status module runtime
+
+ + + +

Add a test result

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityEvolving
ReplaceableNo
+ +

modules_messages

+ + +
modules_messages repostatus testtype mvncmdline
+
+ + + +

Utility to print standard module errors

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityEvolving
ReplaceableNo
+ +

modules_reset

+ + +
modules_reset
+
+ + + +

Reset the test results

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityEvolving
ReplaceableNo
+ +

modules_workers

+ + +
modules_workers repostatus testtype mvncmdline
+
+ + + +

run the tests for the queued modules

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityEvolving
ReplaceableNo
+ +

patchfiletests

+ + +
patchfiletests branch|patch
+
+ + + +

Execute the patch file test phase. Calls out to to _patchfile

+ + + +

0 on success

+ +

1 on failure

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityEvolving
ReplaceableNo
+ +

personality_enqueue_module

+ + +
personality_enqueue_module module profiles/flags/etc
+
+ + + +

Build the queue for tests

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePublic
StabilityEvolving
ReplaceableNo
+ +

Private/Stable/Replaceable

+ +

finish_docker_stats

+ + +
finish_docker_stats
+
+ + + +

Put docker stats in various tables

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePrivate
StabilityStable
ReplaceableYes
+ + + + +
prepopulate_footer
+
+ + + +

Put the opening environment information at the bottom of the footer table

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePrivate
StabilityStable
ReplaceableYes
+ +

report_jvm_version

+ + +
report_jvm_version ## @params       directory
+
+ + + +

Report the JVM version of the given directory

+ + + +

@returns version

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePrivate
StabilityStable
ReplaceableYes
+ +

Private/Evolving/Replaceable

+ +

verify_patchdir_still_exists

+ + +
verify_patchdir_still_exists
+
+ + + +

Verify that the patch directory is still in working order since bad actors on some systems wipe it out. If not, recreate it and then exit

+ + + +

@returns may exit on failure

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePrivate
StabilityEvolving
ReplaceableYes
+ +

Private/Evolving/Not Replaceable

+ +

import_core

+ + +
import_core
+
+ + + +

import core library routines

+ + + +

Nothing

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePrivate
StabilityEvolving
ReplaceableNone
+ +

prechecks

+ + +
prechecks
+
+ + + +

perform prechecks

+ + + +

exits on failure

+ + + + + + + + + + + + + + + + + + + +
ClassificationLevel
AudiencePrivate
StabilityEvolving
ReplaceableNone
+ +
+
+
+ +
+ + + http://git-wip-us.apache.org/repos/asf/yetus/blob/1a20466f/documentation/in-progress/precommit-architecture/index.html ---------------------------------------------------------------------- diff --git a/documentation/in-progress/precommit-architecture/index.html b/documentation/in-progress/precommit-architecture/index.html new file mode 100644 index 0000000..83f64bd --- /dev/null +++ b/documentation/in-progress/precommit-architecture/index.html @@ -0,0 +1,226 @@ + + + + + + Apache Yetus + + + + + + + + + + + + + + + +
+ + +

Some Philosophy

+ + + +

Phases

+ +

test-patch works effectively under several different phases:

+ +

Initialize

+ +

This is where test-patch configures and validates the environment. Some things done in this phase:

+ + + +

Precheck

+ +

Checks done here are fatal.

+ +

This acts as a verification of all of the setup parts and is the final place to short-cut the full test cycle. The most significant built-in check done here is verifying the patch file is a valid.

+ +

Patch File Tests

+ +

Tests that only require the patch file are run. Note that the repository is still from the initial checkout!

+ +

Compile Cycle (Branch)

+ +

When compilation must be done, we follow these five steps:

+ + + +

The first time this is done is with the pristine checkout. This is called the “branch compile”. For this pass, this is where the ‘before’ work is handled. Some things that typically get checked in this phase:

+ + + +

Distribution Clean

+ +

This step is to wipe the repository clean back to a pristine state such that the previous cycle will not impact the next cycle.

+ +

Patch Application

+ +

The patch gets applied.

+ +

Compile Cycle (Patch)

+ +

Now that the patch has been applied the steps to compile we outlined in the compilation (branch) phase are repeated but with the patch applied. This is where a lot of 'after’ checks are performed.

+ +

Unit Tests

+ +

Since unit tests are generally the slowest part of the precommit process, they are run last. At this point, all the prerequisites to running them should be in place and ready to go.

+ +

Reporting

+ +

Finally, the results are reported to the screen and, optionally, to JIRA and/or whatever bug system has been configured.

+ +

Test Flow

+ +

The basic workflow for many of the sub-items in individual phases are:

+ +
    +
  1. print a header, so the end user knows that something is happening
  2. +
  3. verify if the test is needed. If so, continue on. Otherwise, return success and let the next part of the phase execute.
  4. +
  5. Ask the personality about what modules and what flags should get used
  6. +
  7. Execute maven (or some other build tool) in the given modules with the given flags. Log the output and record the time and result code.
  8. +
  9. Do any extra work as appropriate (diffs, counts, etc) and either accept the status and message given by the maven run or change the vote, message, log file, etc, based upon this extra work.
  10. +
  11. Add the outcome(s) to the report generator
  12. +
+ +

As one can see, the modules list is one of the key inputs into what actually gets executed. As a result, projects must full flexibility in either adding, modifying, or even removing modules from the test list. If a personality removes the entire list of modules, then that test should just be ignored.

+ +
+
+
+ +
+ + + http://git-wip-us.apache.org/repos/asf/yetus/blob/1a20466f/documentation/in-progress/precommit-basic/index.html ---------------------------------------------------------------------- diff --git a/documentation/in-progress/precommit-basic/index.html b/documentation/in-progress/precommit-basic/index.html new file mode 100644 index 0000000..0f51c09 --- /dev/null +++ b/documentation/in-progress/precommit-basic/index.html @@ -0,0 +1,351 @@ + + + + + + Apache Yetus + + + + + + + + + + + + + + + +
+ + +

test-patch

+ + + +

Purpose

+ +

As part of Apache Hadoop’s commit process, all patches to the source base go through a precommit test that does some (relatively) light checking to make sure the proposed change does not break unit tests and/or passes some other prerequisites such as code formatting guidelines. This is meant as a preliminary check for committers so that the basic patch is in a known state and for contributors to know if they have followed the project’s guidelines. This check, called test-patch, along with a helper program, called smart-apply-patch, may also be used by individual developers to verify a patch prior to sending to the Apache Hadoop QA systems.

+ +

Other projects have adopted a similar methodology after seeing great success in the Apache Hadoop model. Some have even gone as far as forking Apache Hadoop’s precommit code and modifying it to meet their project’s needs.

+ +

One of the key facets of Apache Yetus is to bring together all of these forks under a common code base to help software development +as a whole.

+ +

Pre-requisites

+ +

test-patch and smart-apply-patch are written in bash for maximum portability. As such, it mostly assumes the locations of commands to be in the file path. However, in many cases, this assumption may be overridden via command line options.

+ +

For Solaris and Solaris-like operating systems, the default location for the POSIX binaries is in /usr/xpg4/bin and the default location for the GNU binaries is /usr/gnu/bin.

+ +

Base Requirements

+ +

test-patch requires these installed components to execute:

+ + + +

Optional Requirements

+ +

Features are plug-in based and enabled either individually or collectively on the command line. From there, these are activated based upon tool availability, the languages being tested, etc. The external dependencies of plug-ins may have different licensing requirements than Apache Yetus.

+ +

Bug Systems:

+ + + +

Unit Test Formats:

+ + + +

Language Support, Licensing, and more:

+ + + +

Basic Usage

+ +

The first step for a successful deployment is determining which features/plug-ins to enable:

+
$ test-patch.sh --list-plugins
+
+ +

This option will list all of the available plug-ins that are installed in the default location. From this list, the specific plug-ins can be enabled:

+
$ test-patch.sh --plugins="ant,maven,shellcheck,xml" <other options>
+
+ +

As a short-cut, every plug-in may be enabled via the special ‘all’ type:

+
$ test-patch.sh --plugins="all" <other options>
+
+ +

--plugins also allows some basic “arithmetic”:

+
$ test-patch.sh --plugins="all,-checkstyle,-findbugs" <other options>
+
+ +

This will enable all plug-ins for potential usage, except for checkstyle and findbugs.

+ +

NOTE: The examples in this section will assume that the necessary --plugins option has been set on the command line as appropriate for your particular installation.

+ +

This command will execute basic patch testing against a patch file stored in “filename”:

+
$ cd <your repo>
+$ test-patch.sh --dirty-workspace --project=projectname <filename>
+
+ +

The --dirty-workspace flag tells test-patch that the repository is not clean and it is ok to continue. By default, unit tests are not run since they may take a significant amount of time.

+ +

To do turn them on, we need to provide the –run-tests option:

+
$ cd <your repo>
+$ test-patch.sh --dirty-workspace --run-tests <filename>
+
+ +

This is the same command, but now runs the unit tests.

+ +

A typical configuration is to have two repositories. One with the code you are working on and another, clean repository. This means you can:

+
$ cd <workrepo>
+$ git diff master > /tmp/patchfile
+$ cd ../<testrepo>
+$ test-patch.sh --basedir=<testrepo> --resetrepo /tmp/patchfile
+
+ +

We used two new options here. –basedir sets the location of the repository to use for testing. –resetrepo tells test patch that it can go into destructive mode. Destructive mode will wipe out any changes made to that repository, so use it with care!

+ +

After the tests have run, there is a directory that contains all of the test-patch related artifacts. This is generally referred to as the patchprocess directory. By default, test-patch tries to make something off of /tmp to contain this content. Using the --patch-dir option, one can specify exactly which directory to use. This is helpful for automated precommit testing so that Jenkins or other automated workflow system knows where to look to gather up the output.

+ +

For example:

+
$ test-patch.sh --jenkins --patch-dir=${WORKSPACE}/patchprocess --basedir=${WORKSPACE}/source ${WORKSPACE}/patchfile
+
+ +

… will trigger test-patch to run in fully automated Jenkins mode, using ${WORKSPACE}/patchprocess as its scratch space, ${WORKSPACE}/source as the source repository, and ${WORKSPACE}/patchfile as the name of the patch to test against.

+ +

Build Tool

+ +

Out of the box, test-patch is built to use maven. But what if the project is built using something else, such as ant?

+
$ test-patch.sh (other options) --build-tool=ant
+
+ +

will tell test-patch to use ant instead of maven to drive the project.

+ +

Providing Patch Files

+ +

JIRA

+ +

It is a fairly common practice within the Apache community to use Apache’s JIRA instance to store potential patches. As a result, test-patch supports providing just a JIRA issue number. test-patch will find the last attachment, download it, then process it.

+ +

For example:

+
$ test-patch.sh (other options) HADOOP-9905
+
+ +

… will process the patch file associated with this JIRA issue.

+ +

If the Apache JIRA system is not in use, then override options may be provided on the command line to point to a different JIRA instance.

+
$ test-patch.sh --jira-issue-re='^PROJECT-[0-9]+$' --jira-base-url='https://example.com/jira' PROJECT-90
+
+ +

… will process the patch file attached to PROJECT-90 on the JIRA instance located on the example.com server.

+ +

GITHUB

+ +

test-patch has some basic support for Github. test-patch supports many forms of providing pull requests to work on:

+
$ test-patch.sh --github-repo=apache/pig 99
+
+ +

or

+
$ test-patch.sh https://github.com/apache/pig/pulls/99
+
+ +

or

+
$ test-patch.sh https://github.com/apache/pig/pulls/99.patch
+
+ +

… will process PR #99 on the apache/pig repo.

+ +

Generic URLs

+ +

Luckily, test-patch supports provide ways to provide unified diffs via URLs.

+ +

For example:

+
$ test-patch.sh (other options) https://example.com/webserver/file.patch
+
+ +

… will download and process the file.patch from the example.com webserver.

+ +

Project-specific Capabilities

+ +

Due to the extensible nature of the system, test-patch allows for projects to define project-specific rules which we call personalities. (How to build those rules is covered elsewhere.) There are two ways to specify which personality to use:

+ +

Direct Method

+
$ test-patch.sh (other options) --personality=(filename)
+
+ +

This tells test-patch to use the personality in the given file.

+ +

Project Method

+ +

However, test-patch can detect if it is a personality that is in its “personality” directory based upon the project name:

+
$ test-patch.sh (other options) --project=(project)
+
+ +

MultiJDK

+ +

For many projects, it is useful to test Java code against multiple versions of JDKs at the same time. test-patch can do this with the –multijdkdirs option:

+
$ test-patch.sh (other options) --multijdkdirs="/j/d/k/1,/j/d/k/2"
+
+ +

Not all Java tests support this mode, but those that do will now run their tests with all of the given versions of Java consecutively (e.g., javac–the Java compliation test). Tests that do not support MultiJDK mode (e.g., checkstyle, mvn install) will use JAVA_HOME.

+ +

NOTE: JAVA_HOME is always appended to the list of JDKs in MultiJDK mode. If JAVA_HOME is in the list, it will be moved to the end.

+ +

Docker

+ +

test-patch also has a mode to utilize Docker:

+
$ test-patch.sh (other options) --docker
+
+ +

This will do some preliminary setup and then re-execute itself inside a Docker container. For more information on how to provide a custom Dockerfile, see the advanced guide.

+ +

In Closing

+ +

test-patch has many other features and command line options for the basic user. Many of these are self-explanatory. To see the list of options, run test-patch.sh without any options or with –help.

+ +
+
+
+ +
+ + +