git@vger.kernel.org mailing list mirror (one of many)
 help / Atom feed
* [PATCH] t7400: encapsulate setup code in test_expect_success
@ 2018-06-12 21:25 Stefan Beller
  2018-06-12 21:36 ` Eric Sunshine
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Beller @ 2018-06-12 21:25 UTC (permalink / raw)
  To: git; +Cc: Stefan Beller

When running t7400 in a shell you observe more output than expected:

    ...
    ok 8 - setup - hide init subdirectory
    ok 9 - setup - repository to add submodules to
    ok 10 - submodule add
    [master (root-commit) d79ce16] one
     Author: A U Thor <author@example.com>
     1 file changed, 1 insertion(+)
     create mode 100644 one.t
    ok 11 - redirected submodule add does not show progress
    ok 12 - redirected submodule add --progress does show progress
    ok 13 - submodule add to .gitignored path fails
    ...

Fix the output by encapsulating the setup code in test_expect_success

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 t/t7400-submodule-basic.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 1a33040d94d..c6e1f749639 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -126,8 +126,10 @@ test_expect_success 'submodule add' '
 	test_cmp empty untracked
 '
 
-test_create_repo parent &&
-test_commit -C parent one
+test_expect_success 'setup parent and one repository for further tests' '
+	test_create_repo parent &&
+	test_commit -C parent one
+'
 
 test_expect_success 'redirected submodule add does not show progress' '
 	git -C addtest submodule add "file://$submodurl/parent" submod-redirected \
-- 
2.18.0.rc1.244.gcf134e6275-goog


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

* Re: [PATCH] t7400: encapsulate setup code in test_expect_success
  2018-06-12 21:25 [PATCH] t7400: encapsulate setup code in test_expect_success Stefan Beller
@ 2018-06-12 21:36 ` Eric Sunshine
  2018-06-18 23:41   ` Stefan Beller
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Sunshine @ 2018-06-12 21:36 UTC (permalink / raw)
  To: Stefan Beller; +Cc: Git List

On Tue, Jun 12, 2018 at 5:25 PM, Stefan Beller <sbeller@google.com> wrote:
> When running t7400 in a shell you observe more output than expected:
>     ...
>     ok 10 - submodule add
>     [master (root-commit) d79ce16] one
>      Author: A U Thor <author@example.com>
>      1 file changed, 1 insertion(+)
>      create mode 100644 one.t
>     ok 11 - redirected submodule add does not show progress
>     ...
> Fix the output by encapsulating the setup code in test_expect_success
>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
> diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
> @@ -126,8 +126,10 @@ test_expect_success 'submodule add' '
> -test_create_repo parent &&
> -test_commit -C parent one
> +test_expect_success 'setup parent and one repository for further tests' '

Nit: "for further tests" is implied for actions performed by a "setup"
function, so a bit redundant to say so.

> +       test_create_repo parent &&
> +       test_commit -C parent one
> +'

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

* [PATCH] t7400: encapsulate setup code in test_expect_success
  2018-06-12 21:36 ` Eric Sunshine
@ 2018-06-18 23:41   ` Stefan Beller
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Beller @ 2018-06-18 23:41 UTC (permalink / raw)
  To: sunshine; +Cc: git, sbeller

When running t7400 in a shell you observe more output than expected:

    ...
    ok 8 - setup - hide init subdirectory
    ok 9 - setup - repository to add submodules to
    ok 10 - submodule add
    [master (root-commit) d79ce16] one
     Author: A U Thor <author@example.com>
     1 file changed, 1 insertion(+)
     create mode 100644 one.t
    ok 11 - redirected submodule add does not show progress
    ok 12 - redirected submodule add --progress does show progress
    ok 13 - submodule add to .gitignored path fails
    ...

Fix the output by encapsulating the setup code in test_expect_success

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 t/t7400-submodule-basic.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 2f532529b82..812db137b8d 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -126,8 +126,10 @@ test_expect_success 'submodule add' '
 	test_cmp empty untracked
 '
 
-test_create_repo parent &&
-test_commit -C parent one
+test_expect_success 'setup parent and one repository' '
+	test_create_repo parent &&
+	test_commit -C parent one
+'
 
 test_expect_success 'redirected submodule add does not show progress' '
 	git -C addtest submodule add "file://$submodurl/parent" submod-redirected \
-- 
2.18.0.rc1.244.gcf134e6275-goog


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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-12 21:25 [PATCH] t7400: encapsulate setup code in test_expect_success Stefan Beller
2018-06-12 21:36 ` Eric Sunshine
2018-06-18 23:41   ` Stefan Beller

git@vger.kernel.org mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox