diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2022-09-01 12:47:53 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2022-09-01 12:47:53 -0400 |
commit | 03aea08e2ce2ecabcebb618ee9f6d18a909c41d4 (patch) | |
tree | 632cd57017810527b9d24ff35fed315b312f4f7f /tests | |
parent | b62e04aca672c0894638035ca777035f7658a05a (diff) | |
download | b4-03aea08e2ce2ecabcebb618ee9f6d18a909c41d4.tar.gz |
tests: test partial reroll correctness
When rerolling partial series, check that the trailers are applied
correctly.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/samples/trailers-followup-partial-reroll-ref-defaults.txt | 73 | ||||
-rw-r--r-- | tests/samples/trailers-followup-partial-reroll.mbox | 147 | ||||
-rw-r--r-- | tests/test___init__.py | 1 |
3 files changed, 221 insertions, 0 deletions
diff --git a/tests/samples/trailers-followup-partial-reroll-ref-defaults.txt b/tests/samples/trailers-followup-partial-reroll-ref-defaults.txt new file mode 100644 index 0000000..7fbaa03 --- /dev/null +++ b/tests/samples/trailers-followup-partial-reroll-ref-defaults.txt @@ -0,0 +1,73 @@ +From git@z Thu Jan 1 00:00:00 1970 +Subject: [PATCH v3 1/2] Simple test 1 +From: Test Test <test@example.com> +Date: Tue, 30 Aug 2022 11:19:07 -0400 +Message-Id: <patch-1-message@example.com> +To: Some List <list-1@lists.example.com> +Cc: Dev Eloper1 <dev-eloper1@example.com>, Dev Eloper2 <dev-eloper2@example.com> +In-Reply-To: <cover-message@example.com> +References: <cover-message@example.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 7bit + +Follow-up trailer collating test patch 1. + +Fixes: abcdef01234567890 +Reviewed-by: Original Reviewer <original-reviewer@example.com> +Link: https://msgid.link/some@msgid.here +Signed-off-by: Original Submitter <original-submitter@example.com> +Signed-off-by: Test Override <test-override@example.com> +--- + +diff --git a/b4/junk.py b/b4/junk.py +index 12345678..23456789 100644 +--- a/b4/junk.py +--- b/b4/junk.py +@@@ -1,1 +1,1 @@ def junk(): + + +-junk1 ++junk2 + + +-- +2.wong.fu + +From git@z Thu Jan 1 00:00:00 1970 +Subject: [PATCH v3 2/2] Simple test 2 +From: Test Test <test@example.com> +Date: Tue, 30 Aug 2022 11:19:07 -0400 +Message-Id: <patch-v3-2-message@example.com> +To: Some List <list-1@lists.example.com> +Cc: Dev Eloper1 <dev-eloper1@example.com>, Dev Eloper2 <dev-eloper2@example.com> +In-Reply-To: <patch-2-message@example.com> +References: <cover-message@example.com> <patch-2-message@example.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 7bit + +Follow-up trailer collating test patch 2. +Partial reroll test. + +Fixes: abcdef01234567890 +Reviewed-by: Original Reviewer <original-reviewer@example.com> +Link: https://msgid.link/some@msgid.here +Signed-off-by: Original Submitter <original-submitter@example.com> +Signed-off-by: Test Override <test-override@example.com> +--- + +diff --git a/b4/bogus.py b/b4/bogus.py +index 12345678..23456789 100644 +--- a/b4/bogus.py +--- b/b4/bogus.py +@@@ -1,1 +1,1 @@ def bogus(): + + +-bogus1 ++bogus2 + + +-- +2.wong.fu + diff --git a/tests/samples/trailers-followup-partial-reroll.mbox b/tests/samples/trailers-followup-partial-reroll.mbox new file mode 100644 index 0000000..0a5644f --- /dev/null +++ b/tests/samples/trailers-followup-partial-reroll.mbox @@ -0,0 +1,147 @@ +From foo@z Thu Jan 1 00:00:00 1970 +From: Test Test <test@example.com> +Subject: [PATCH v2 0/2] Simple cover +To: Some List <list-1@lists.example.com> +Cc: Dev Eloper1 <dev-eloper1@example.com>, + Dev Eloper2 <dev-eloper2@example.com> +Date: Tue, 30 Aug 2022 11:19:07 -0400 +Message-Id: <cover-message@example.com> + +This is a cover letter. It has a diffstat. + +--- +b4/junk.py | 1 - +b4/bupkes.py | 1 - +2 files changed, 2 insertions(+), 2 deletions(-) + + +From foo@z Thu Jan 1 00:00:00 1970 +From: Test Test <test@example.com> +Subject: [PATCH v2 1/2] Simple test 1 +To: Some List <list-1@lists.example.com> +Cc: Dev Eloper1 <dev-eloper1@example.com>, + Dev Eloper2 <dev-eloper2@example.com> +Date: Tue, 30 Aug 2022 11:19:07 -0400 +Message-Id: <patch-1-message@example.com> +In-Reply-To: <cover-message@example.com> +References: <cover-message@example.com> + +Follow-up trailer collating test patch 1. + +Fixes: abcdef01234567890 +Reviewed-by: Original Reviewer <original-reviewer@example.com> +Link: https://msgid.link/some@msgid.here +Signed-off-by: Original Submitter <original-submitter@example.com> +--- + +diff --git a/b4/junk.py b/b4/junk.py +index 12345678..23456789 100644 +--- a/b4/junk.py +--- b/b4/junk.py +@@@ -1,1 +1,1 @@ def junk(): + + +-junk1 ++junk2 + + +-- +2.wong.fu + +From foo@z Thu Jan 1 00:00:00 1970 +From: Test Test <test@example.com> +Subject: [PATCH v2 2/2] Simple test 2 +To: Some List <list-1@lists.example.com> +Cc: Dev Eloper1 <dev-eloper1@example.com>, + Dev Eloper2 <dev-eloper2@example.com> +Date: Tue, 30 Aug 2022 11:19:07 -0400 +Message-Id: <patch-2-message@example.com> +In-Reply-To: <cover-message@example.com> +References: <cover-message@example.com> + +Follow-up trailer collating test patch 2. + +Fixes: abcdef01234567890 +Reviewed-by: Original Reviewer <original-reviewer@example.com> +Link: https://msgid.link/some@msgid.here +Signed-off-by: Original Submitter <original-submitter@example.com> +--- + +diff --git a/b4/bupkes.py b/b4/bupkes.py +index 12345678..23456789 100644 +--- a/b4/bupkes.py +--- b/b4/bupkes.py +@@@ -1,1 +1,1 @@ def bupkes(): + + +-bupkes1 ++bupkes2 + + +-- +2.wong.fu + +From foo@z Thu Jan 1 00:00:00 1970 +From: Followup Reviewer1 <followup-reviewer1@example.com> +Subject: Re: [PATCH v2 2/2] Simple test 2 +Date: Tue, 30 Aug 2022 11:19:07 -0400 +Message-Id: <fwup-message-1@example.com> +In-Reply-To: <patch-2-message@example.com> +References: <patch-2-message@example.com> <cover-message@example.com> + +> This is a simple trailer parsing test. + +Reviewed-by: Followup Reviewer1 <followup-reviewer1@example.com> + +-- +My sig + +From foo@z Thu Jan 1 00:00:00 1970 +From: Followup Reviewer1 <followup-reviewer1@example.com> +Subject: Re: [PATCH v2 0/2] Simple cover +Date: Tue, 30 Aug 2022 11:19:07 -0400 +Message-Id: <fwup-message-2@example.com> +In-Reply-To: <cover-message@example.com> +References: <cover-message@example.com> + +> This is a simple trailer parsing test. + +Reviewed-by: Coverletter Reviewer1 <followup-reviewer1@example.com> + +-- +My sig + +From foo@z Thu Jan 1 00:00:00 1970 +From: Test Test <test@example.com> +Subject: [PATCH v3 2/2] Simple test 2 +To: Some List <list-1@lists.example.com> +Cc: Dev Eloper1 <dev-eloper1@example.com>, + Dev Eloper2 <dev-eloper2@example.com> +Date: Tue, 30 Aug 2022 11:19:07 -0400 +Message-Id: <patch-v3-2-message@example.com> +In-Reply-To: <patch-2-message@example.com> +References: <cover-message@example.com> <patch-2-message@example.com> + +Follow-up trailer collating test patch 2. +Partial reroll test. + +Fixes: abcdef01234567890 +Reviewed-by: Original Reviewer <original-reviewer@example.com> +Link: https://msgid.link/some@msgid.here +Signed-off-by: Original Submitter <original-submitter@example.com> +--- + +diff --git a/b4/bogus.py b/b4/bogus.py +index 12345678..23456789 100644 +--- a/b4/bogus.py +--- b/b4/bogus.py +@@@ -1,1 +1,1 @@ def bogus(): + + +-bogus1 ++bogus2 + + +-- +2.wong.fu + diff --git a/tests/test___init__.py b/tests/test___init__.py index f97e166..4beeb91 100644 --- a/tests/test___init__.py +++ b/tests/test___init__.py @@ -92,6 +92,7 @@ def test_parse_trailers(source, expected): ('custody', {}, {'addmysob': True, 'copyccs': True}, 'unordered', {}), ('custody', {}, {'addmysob': True, 'copyccs': True}, 'ordered', {'trailer-order': 'Cc,Fixes*,Link*,Suggested*,Reviewed*,Tested*,*'}), + ('partial-reroll', {}, {'addmysob': True}, 'defaults', {}), ]) def test_followup_trailers(source, serargs, amargs, reference, b4cfg): b4.USER_CONFIG = { |