Discussion:
Help on test-patch
Ping Liu
2017-09-02 07:36:58 UTC
Permalink
I have a patch for an Hadoop Jira issue. I need test the patch. I am
following TestingPatchTips at https://wiki.apache.org/hadoop/TestPatchTips.

I have difficulty in understanding the command option basedir and
reset-repo.

The best example is in Recommended Usage, the last part, where both basedir
and reset-repo are used.

*Recommended Usage*
In general, the easiest way to use test-patch.sh is to use two repos. One
repo is used to build patches. The other repo is used to to test them.
$ git diff --no-prefix trunk > /tmp/1.patch$ dev-support/bin/test-patch --resetrepo --run-tests --basedir=/test/repo /tmp/1.patch
This will run the freshly built patch against the tests in a fresh repo.
In above example, my understand is

1. current location $ is the working repo - it contains changes and is
where the patch is created from.

2. dev-support/bin/test-patch is under $, therefore we need get into $ in
order to run test-patch.

3. /test/repo is the clean repo from current trunk.

4. when running test-patch command, patch will be applied to /test/repo.

Please let me know if my understanding is correct.

So
--basedir means the repo where the patch will be applied to and test
will be performed on?

--resetrepo means

1. basedir (/test/repo) but not the current dir $ is allowed to be
modified?
2. also modified what? What kind of modification is it?
3. BTW, is resetrepo a typo for --reset-repo (missing a hyphen)?

Any idea is highly appreciated!

Ping
Ajay Kumar
2017-09-06 17:51:54 UTC
Permalink
Hi Ping,
I think your assumptions are correct.
I usually test patch with same repo after hard resetting that repo to its latest state. (i.e ./dev-support/bin/test-patch /tmp/1.patch)

Ajay

On 9/2/17, 12:37 AM, "Ping Liu" <***@gmail.com<mailto:***@gmail.com>> wrote:

I have a patch for an Hadoop Jira issue. I need test the patch. I am
following TestingPatchTips at https://wiki.apache.org/hadoop/TestPatchTips.

I have difficulty in understanding the command option basedir and
reset-repo.

The best example is in Recommended Usage, the last part, where both basedir
and reset-repo are used.

*Recommended Usage*
In general, the easiest way to use test-patch.sh is to use two repos. One
repo is used to build patches. The other repo is used to to test them.
$ git diff --no-prefix trunk > /tmp/1.patch$ dev-support/bin/test-patch --resetrepo --run-tests --basedir=/test/repo /tmp/1.patch
This will run the freshly built patch against the tests in a fresh repo.
In above example, my understand is

1. current location $ is the working repo - it contains changes and is
where the patch is created from.

2. dev-support/bin/test-patch is under $, therefore we need get into $ in
order to run test-patch.

3. /test/repo is the clean repo from current trunk.

4. when running test-patch command, patch will be applied to /test/repo.

Please let me know if my understanding is correct.

So
--basedir means the repo where the patch will be applied to and test
will be performed on?

--resetrepo means

1. basedir (/test/repo) but not the current dir $ is allowed to be
modified?
2. also modified what? What kind of modification is it?
3. BTW, is resetrepo a typo for --reset-repo (missing a hyphen)?

Any idea is highly appreciated!

Ping
Ping Liu
2017-09-06 18:27:59 UTC
Permalink
Hi Ajay,

Thank you very much for your message.

Yes, you are right. Using the same repo is most straight forward. The
advantage to use two repos is to allow hard reset to the base repo while
keeping the development repo as is. The patch is created from development
repo (delta on top of trunk) and will be applied to base repo (which need
to be hard reset already). I was able to try it.

Unfortunately, I am not able to run the full process successfully as my
environment apparently lacks some settings such as snappy. The instruction
and online resource are quite vague. I don't know what is the correct way
to install and configure it. But this is different story, of course.

Thanks Ajay!

Ping
Post by Ajay Kumar
Hi Ping,
I think your assumptions are correct.
I usually test patch with same repo after hard resetting that repo to its
latest state. (i.e ./dev-support/bin/test-patch /tmp/1.patch)
Ajay
I have a patch for an Hadoop Jira issue. I need test the patch. I am
following TestingPatchTips at https://wiki.apache.org/
hadoop/TestPatchTips.
I have difficulty in understanding the command option basedir and
reset-repo.
The best example is in Recommended Usage, the last part, where both basedir
and reset-repo are used.
*Recommended Usage*
In general, the easiest way to use test-patch.sh is to use two
repos. One
repo is used to build patches. The other repo is used to to test
them.
$ git diff --no-prefix trunk > /tmp/1.patch$
dev-support/bin/test-patch --resetrepo --run-tests --basedir=/test/repo
/tmp/1.patch
This will run the freshly built patch against the tests in a fresh
repo.
In above example, my understand is
1. current location $ is the working repo - it contains changes and is
where the patch is created from.
2. dev-support/bin/test-patch is under $, therefore we need get into $ in
order to run test-patch.
3. /test/repo is the clean repo from current trunk.
4. when running test-patch command, patch will be applied to /test/repo.
Please let me know if my understanding is correct.
So
--basedir means the repo where the patch will be applied to and test
will be performed on?
--resetrepo means
1. basedir (/test/repo) but not the current dir $ is allowed to be
modified?
2. also modified what? What kind of modification is it?
3. BTW, is resetrepo a typo for --reset-repo (missing a hyphen)?
Any idea is highly appreciated!
Ping
Ajay Kumar
2017-09-06 18:33:12 UTC
Permalink
Hi Ping,

I don’t know what OS you are using but it’s easy to install most of those dependencies using pip or brew.

Ajay

From: Ping Liu <***@gmail.com>
Date: Wednesday, September 6, 2017 at 11:28 AM
To: Ajay Kumar <***@hortonworks.com>
Cc: "***@hadoop.apache.org" <***@hadoop.apache.org>
Subject: Re: Help on test-patch

Hi Ajay,
Thank you very much for your message.
Yes, you are right. Using the same repo is most straight forward. The advantage to use two repos is to allow hard reset to the base repo while keeping the development repo as is. The patch is created from development repo (delta on top of trunk) and will be applied to base repo (which need to be hard reset already). I was able to try it.

Unfortunately, I am not able to run the full process successfully as my environment apparently lacks some settings such as snappy. The instruction and online resource are quite vague. I don't know what is the correct way to install and configure it. But this is different story, of course.
Thanks Ajay!
Ping



On Wed, Sep 6, 2017 at 10:51 AM, Ajay Kumar <***@hortonworks.com<mailto:***@hortonworks.com>> wrote:
Hi Ping,
I think your assumptions are correct.
I usually test patch with same repo after hard resetting that repo to its latest state. (i.e ./dev-support/bin/test-patch /tmp/1.patch)

Ajay

On 9/2/17, 12:37 AM, "Ping Liu" <***@gmail.com<mailto:***@gmail.com>> wrote:

I have a patch for an Hadoop Jira issue. I need test the patch. I am
following TestingPatchTips at https://wiki.apache.org/hadoop/TestPatchTips.

I have difficulty in understanding the command option basedir and
reset-repo.

The best example is in Recommended Usage, the last part, where both basedir
and reset-repo are used.

*Recommended Usage*
In general, the easiest way to use test-patch.sh is to use two repos. One
repo is used to build patches. The other repo is used to to test them.
$ git diff --no-prefix trunk > /tmp/1.patch$ dev-support/bin/test-patch --resetrepo --run-tests --basedir=/test/repo /tmp/1.patch
This will run the freshly built patch against the tests in a fresh repo.
In above example, my understand is

1. current location $ is the working repo - it contains changes and is
where the patch is created from.

2. dev-support/bin/test-patch is under $, therefore we need get into $ in
order to run test-patch.

3. /test/repo is the clean repo from current trunk.

4. when running test-patch command, patch will be applied to /test/repo.

Please let me know if my understanding is correct.

So
--basedir means the repo where the patch will be applied to and test
will be performed on?

--resetrepo means

1. basedir (/test/repo) but not the current dir $ is allowed to be
modified?
2. also modified what? What kind of modification is it?
3. BTW, is resetrepo a typo for --reset-repo (missing a hyphen)?

Any idea is highly appreciated!

Ping

Loading...