All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] t6030: explicitly test for bisection cleanup
@ 2016-05-13 10:14 Pranit Bauva
  2016-05-27 17:57 ` Pranit Bauva
  0 siblings, 1 reply; 4+ messages in thread
From: Pranit Bauva @ 2016-05-13 10:14 UTC (permalink / raw)
  To: git; +Cc: Pranit Bauva, larsxschneider, christian.couder, chriscool

This is not an improvement in the test coverage but it helps in making
it explicit as to know what exactly is the error as other tests are
focussed on testing other things but they do indirectly test for this.

Mentored-by: Lars Schneider <larsxschneider@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>

---
I faced this problem while converting `bisect_clean_state` and the tests
where showing breakages but it wasn't clear as to where exactly are they
breaking. This will patch  will help in that. Also I tested the test
coverage of the test suite before this patch and it covers this (I did
this by purposely changing names of files in git-bisect.sh and running
the test suite).

Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
---
 t/t6030-bisect-porcelain.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index e74662b..1fb5ad9 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -894,4 +894,21 @@ test_expect_success 'bisect start takes options and revs in any order' '
 	test_cmp expected actual
 '
 
+test_expect_success 'git bisect reset cleans bisection state properly' '
+	git bisect reset &&
+	git bisect start &&
+	git bisect good $HASH1 &&
+	git bisect bad $HASH4 &&
+	git bisect reset &&
+	test -z "$(git for-each-ref "refs/bisect/*")" &&
+	! test -s "$GIT_DIR/BISECT_EXPECTED_REV" &&
+	! test -s "$GIT_DIR/BISECT_ANCESTORS_OK" &&
+	! test -s "$GIT_DIR/BISECT_LOG" &&
+	! test -s "$GIT_DIR/BISECT_RUN" &&
+	! test -s "$GIT_DIR/BISECT_TERMS" &&
+	! test -s "$GIT_DIR/head-name" &&
+	! test -s "$GIT_DIR/BISECT_HEAD" &&
+	! test -s "$GIT_DIR/BISECT_START"
+'
+
 test_done
-- 
2.8.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] t6030: explicitly test for bisection cleanup
  2016-05-13 10:14 [PATCH] t6030: explicitly test for bisection cleanup Pranit Bauva
@ 2016-05-27 17:57 ` Pranit Bauva
  2016-05-27 19:00   ` Christian Couder
  0 siblings, 1 reply; 4+ messages in thread
From: Pranit Bauva @ 2016-05-27 17:57 UTC (permalink / raw)
  To: Git List; +Cc: Pranit Bauva, Lars Schneider, Christian Couder, chriscool

On Fri, May 13, 2016 at 3:44 PM, Pranit Bauva <pranit.bauva@gmail.com> wrote:
> This is not an improvement in the test coverage but it helps in making
> it explicit as to know what exactly is the error as other tests are
> focussed on testing other things but they do indirectly test for this.
>
> Mentored-by: Lars Schneider <larsxschneider@gmail.com>
> Mentored-by: Christian Couder <chriscool@tuxfamily.org>
> Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
>
> ---
> I faced this problem while converting `bisect_clean_state` and the tests
> where showing breakages but it wasn't clear as to where exactly are they
> breaking. This will patch  will help in that. Also I tested the test
> coverage of the test suite before this patch and it covers this (I did
> this by purposely changing names of files in git-bisect.sh and running
> the test suite).
>
> Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
> ---
>  t/t6030-bisect-porcelain.sh | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
> diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
> index e74662b..1fb5ad9 100755
> --- a/t/t6030-bisect-porcelain.sh
> +++ b/t/t6030-bisect-porcelain.sh
> @@ -894,4 +894,21 @@ test_expect_success 'bisect start takes options and revs in any order' '
>         test_cmp expected actual
>  '
>
> +test_expect_success 'git bisect reset cleans bisection state properly' '
> +       git bisect reset &&
> +       git bisect start &&
> +       git bisect good $HASH1 &&
> +       git bisect bad $HASH4 &&
> +       git bisect reset &&
> +       test -z "$(git for-each-ref "refs/bisect/*")" &&
> +       ! test -s "$GIT_DIR/BISECT_EXPECTED_REV" &&
> +       ! test -s "$GIT_DIR/BISECT_ANCESTORS_OK" &&
> +       ! test -s "$GIT_DIR/BISECT_LOG" &&
> +       ! test -s "$GIT_DIR/BISECT_RUN" &&
> +       ! test -s "$GIT_DIR/BISECT_TERMS" &&
> +       ! test -s "$GIT_DIR/head-name" &&
> +       ! test -s "$GIT_DIR/BISECT_HEAD" &&
> +       ! test -s "$GIT_DIR/BISECT_START"
> +'
> +
>  test_done
> --
> 2.8.2
>

Anyone any comments?

Regards,
Pranit Bauva

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] t6030: explicitly test for bisection cleanup
  2016-05-27 17:57 ` Pranit Bauva
@ 2016-05-27 19:00   ` Christian Couder
  2016-05-27 19:22     ` Pranit Bauva
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Couder @ 2016-05-27 19:00 UTC (permalink / raw)
  To: Pranit Bauva; +Cc: Git List, Lars Schneider, chriscool

On Fri, May 27, 2016 at 7:57 PM, Pranit Bauva <pranit.bauva@gmail.com> wrote:
>
> Anyone any comments?

Maybe you could add this patch to, or squash it into, the patch that
convert bisect_clean_state to C.

Thanks,
Christian.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] t6030: explicitly test for bisection cleanup
  2016-05-27 19:00   ` Christian Couder
@ 2016-05-27 19:22     ` Pranit Bauva
  0 siblings, 0 replies; 4+ messages in thread
From: Pranit Bauva @ 2016-05-27 19:22 UTC (permalink / raw)
  To: Christian Couder; +Cc: Git List, Lars Schneider, chriscool

Hey Christian,

On Sat, May 28, 2016 at 12:30 AM, Christian Couder
<christian.couder@gmail.com> wrote:
> On Fri, May 27, 2016 at 7:57 PM, Pranit Bauva <pranit.bauva@gmail.com> wrote:
>>
>> Anyone any comments?
>
> Maybe you could add this patch to, or squash it into, the patch that
> convert bisect_clean_state to C.

Sure!

Regards,
Pranit Bauva

> Thanks,
> Christian.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-27 19:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-13 10:14 [PATCH] t6030: explicitly test for bisection cleanup Pranit Bauva
2016-05-27 17:57 ` Pranit Bauva
2016-05-27 19:00   ` Christian Couder
2016-05-27 19:22     ` Pranit Bauva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.