Re: [Django] #32641: Log the number of tests found in DiscoverRunner.build_suite()

2021-06-02 Thread Django
#32641: Log the number of tests found in DiscoverRunner.build_suite()
-+-
 Reporter:  Chris Jerdonek   |Owner:  Girish
 Type:   |  Sontakke
  Cleanup/optimization   |   Status:  closed
Component:  Testing framework|  Version:  dev
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
  DiscoverRunner,build_suite |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by GitHub ):

 In [changeset:"1b4d1675b230cd6d47c2ffce41893d1881bf447b" 1b4d1675]:
 {{{
 #!CommitTicketReference repository=""
 revision="1b4d1675b230cd6d47c2ffce41893d1881bf447b"
 Refs #32641 -- Made DiscoverRunner's "Found X tests" message work for
 finding one test.

 This also removes passing level to log() as logging.INFO is the default.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.8bc2bc7369e4f6725988ab87f62f6beb%40djangoproject.com.


Re: [Django] #32641: Log the number of tests found in DiscoverRunner.build_suite()

2021-06-02 Thread Django
#32641: Log the number of tests found in DiscoverRunner.build_suite()
-+-
 Reporter:  Chris Jerdonek   |Owner:  Girish
 Type:   |  Sontakke
  Cleanup/optimization   |   Status:  closed
Component:  Testing framework|  Version:  dev
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
  DiscoverRunner,build_suite |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Chris Jerdonek):

 > I would use "Found 1 test(s)."

 I made a PR for this: https://github.com/django/django/pull/14476

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.b5f2aa9d796b0f622e1e6cec676ed15b%40djangoproject.com.


Re: [Django] #32641: Log the number of tests found in DiscoverRunner.build_suite()

2021-04-15 Thread Django
#32641: Log the number of tests found in DiscoverRunner.build_suite()
-+-
 Reporter:  Chris Jerdonek   |Owner:  Girish
 Type:   |  Sontakke
  Cleanup/optimization   |   Status:  closed
Component:  Testing framework|  Version:  dev
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
  DiscoverRunner,build_suite |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Mariusz Felisiak):

 > Here is how that's handled in the similar message saying, "System check
 identified N issues...":

 I would use `Found 1 test(s).`

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.75681afd850ea4907a6817d8497e2595%40djangoproject.com.


Re: [Django] #32641: Log the number of tests found in DiscoverRunner.build_suite()

2021-04-15 Thread Django
#32641: Log the number of tests found in DiscoverRunner.build_suite()
-+-
 Reporter:  Chris Jerdonek   |Owner:  Girish
 Type:   |  Sontakke
  Cleanup/optimization   |   Status:  closed
Component:  Testing framework|  Version:  dev
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
  DiscoverRunner,build_suite |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Chris Jerdonek):

 I was trying this out, and it looks great. Thanks, Mariusz and Girish. The
 only thing is I noticed it can say:

 {{{
 Found 1 tests.
 }}}

 when there is just one test. So while not a big deal, it would be easy to
 add polish to that one special case. :)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.f74c110f2bea9a87d387cbc62bec7339%40djangoproject.com.


Re: [Django] #32641: Log the number of tests found in DiscoverRunner.build_suite()

2021-04-15 Thread Django
#32641: Log the number of tests found in DiscoverRunner.build_suite()
-+-
 Reporter:  Chris Jerdonek   |Owner:  Girish
 Type:   |  Sontakke
  Cleanup/optimization   |   Status:  closed
Component:  Testing framework|  Version:  dev
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
  DiscoverRunner,build_suite |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mariusz Felisiak ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"a815a6a3159d5f708866ca968e8994f201ea3e43" a815a6a3]:
 {{{
 #!CommitTicketReference repository=""
 revision="a815a6a3159d5f708866ca968e8994f201ea3e43"
 Fixed #32641 -- Made DiscoverRunner print the number of found tests.

 Thanks Chris Jerdonek for reviews.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.837cb808d6671f6f74eda9e2055d27ce%40djangoproject.com.


Re: [Django] #32641: Log the number of tests found in DiscoverRunner.build_suite()

2021-04-15 Thread Django
#32641: Log the number of tests found in DiscoverRunner.build_suite()
-+-
 Reporter:  Chris Jerdonek   |Owner:  Girish
 Type:   |  Sontakke
  Cleanup/optimization   |   Status:  assigned
Component:  Testing framework|  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
  DiscoverRunner,build_suite |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * needs_tests:  1 => 0
 * stage:  Accepted => Ready for checkin


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.5ec9f3d3cf8c374196f70e03567a5704%40djangoproject.com.


Re: [Django] #32641: Log the number of tests found in DiscoverRunner.build_suite()

2021-04-14 Thread Django
#32641: Log the number of tests found in DiscoverRunner.build_suite()
-+-
 Reporter:  Chris Jerdonek   |Owner:  Girish
 Type:   |  Sontakke
  Cleanup/optimization   |   Status:  assigned
Component:  Testing framework|  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  DiscoverRunner,build_suite |
Has patch:  1|  Needs documentation:  0
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * has_patch:  0 => 1
 * needs_tests:  0 => 1


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.c79109ad030a732b18157c7311d7197c%40djangoproject.com.


Re: [Django] #32641: Log the number of tests found in DiscoverRunner.build_suite()

2021-04-14 Thread Django
#32641: Log the number of tests found in DiscoverRunner.build_suite()
-+-
 Reporter:  Chris Jerdonek   |Owner:  Girish
 Type:   |  Sontakke
  Cleanup/optimization   |   Status:  assigned
Component:  Testing framework|  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  DiscoverRunner,build_suite |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Girish Sontakke):

 [https://github.com/django/django/pull/14261 PR]

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.55a72f3b006516feb87ac68f5a138c9a%40djangoproject.com.


Re: [Django] #32641: Log the number of tests found in DiscoverRunner.build_suite()

2021-04-13 Thread Django
#32641: Log the number of tests found in DiscoverRunner.build_suite()
-+-
 Reporter:  Chris Jerdonek   |Owner:  Girish
 Type:   |  Sontakke
  Cleanup/optimization   |   Status:  assigned
Component:  Testing framework|  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  DiscoverRunner,build_suite |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Girish Sontakke):

 * owner:  nobody => Girish Sontakke
 * status:  new => assigned


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.d3987ec4b88a9b04cb897fe9bf340b24%40djangoproject.com.


Re: [Django] #32641: Log the number of tests found in DiscoverRunner.build_suite()

2021-04-13 Thread Django
#32641: Log the number of tests found in DiscoverRunner.build_suite()
-+-
 Reporter:  Chris Jerdonek   |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Testing framework|  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  DiscoverRunner,build_suite |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * easy:  0 => 1
 * stage:  Unreviewed => Accepted


Comment:

 An extra line in the output should be fine.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.1f6aa1739252c73d97c7b3933b5249cb%40djangoproject.com.


Re: [Django] #32641: Log the number of tests found in DiscoverRunner.build_suite()

2021-04-13 Thread Django
#32641: Log the number of tests found in DiscoverRunner.build_suite()
-+-
 Reporter:  Chris Jerdonek   |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Testing framework|  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
  DiscoverRunner,build_suite |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Description changed by Chris Jerdonek:

Old description:

> Currently, when running tests with `DiscoverRunner`, the number of tests
> is displayed only at the very end of the test run.
>
> However, knowing this number at the ''beginning'' of a test run could I
> think provide an increase in usability. For example, you'd be able to
> notice right away if a new test you're working was or wasn't included as
> expected, based on whether the number is the same or different from the
> previous run. Similarly, the early feedback would be helpful as a sanity
> check if you're trying to reduce the number of tests using different
> command-line options, and you're not sure if your invocation is correct.
>
> Thus, I'd like to suggest that `DiscoverRunner` display by default the
> number of tests discovered (and that match any filters) at the earliest
> point where this is known. This could be done inside
> `DiscoverRunner.build_suite()`.
>
> The code change could be as simple as:
>
> {{{
> diff --git a/django/test/runner.py b/django/test/runner.py
> index f187107157..c975ed92be 100644
> --- a/django/test/runner.py
> +++ b/django/test/runner.py
> @@ -652,7 +652,8 @@ class DiscoverRunner:
>  # _FailedTest objects include things like test modules that
> couldn't be
>  # found or that couldn't be loaded due to syntax errors.
>  test_types = (unittest.loader._FailedTest, *self.reorder_by)
> -all_tests = reorder_tests(all_tests, test_types, self.reverse)
> +all_tests = list(reorder_tests(all_tests, test_types,
> self.reverse))
> +print('Found %d tests' % len(all_tests))
>  suite = self.test_suite(all_tests)
>
>  if self.parallel > 1:
> }}}
>
> If there is any concern about adding an additional message, another
> possibility would be to display the current "Testing against Django
> installed in ..." message later in the test run, only after the number of
> tests is known, and include the test count in that message.

New description:

 Currently, when running tests with `DiscoverRunner`, the number of tests
 is displayed only at the very end of the test run.

 However, knowing this number at the ''beginning'' of a test run could I
 think provide an increase in usability. For example, you'd be able to
 notice right away if a new test you're working on was or wasn't included
 as expected, based on whether the number is the same or different from the
 previous run. Similarly, the early feedback would be helpful as a sanity
 check if you're trying to reduce the number of tests using different
 command-line options, and you're not sure if your invocation is correct.

 Thus, I'd like to suggest that `DiscoverRunner` display by default the
 number of tests discovered (and that match any filters) at the earliest
 point where this is known. This could be done inside
 `DiscoverRunner.build_suite()`.

 The code change could be as simple as:

 {{{
 diff --git a/django/test/runner.py b/django/test/runner.py
 index f187107157..c975ed92be 100644
 --- a/django/test/runner.py
 +++ b/django/test/runner.py
 @@ -652,7 +652,8 @@ class DiscoverRunner:
  # _FailedTest objects include things like test modules that
 couldn't be
  # found or that couldn't be loaded due to syntax errors.
  test_types = (unittest.loader._FailedTest, *self.reorder_by)
 -all_tests = reorder_tests(all_tests, test_types, self.reverse)
 +all_tests = list(reorder_tests(all_tests, test_types,
 self.reverse))
 +if self.verbosity >= 1:
 +print('Found %d tests' % len(all_tests))
  suite = self.test_suite(all_tests)

  if self.parallel > 1:
 }}}

 If there is any concern about adding an additional message, another
 possibility would be to display the current "Testing against Django
 installed in ..." message later in the test run, only after the number of
 tests is known, and include the test count in that message.

--

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You receive

[Django] #32641: Log the number of tests found in DiscoverRunner.build_suite()

2021-04-13 Thread Django
#32641: Log the number of tests found in DiscoverRunner.build_suite()
-+-
   Reporter:  Chris  |  Owner:  nobody
  Jerdonek   |
   Type: | Status:  new
  Cleanup/optimization   |
  Component:  Testing|Version:  dev
  framework  |   Keywords:
   Severity:  Normal |  DiscoverRunner,build_suite
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 Currently, when running tests with `DiscoverRunner`, the number of tests
 is displayed only at the very end of the test run.

 However, knowing this number at the ''beginning'' of a test run could I
 think provide an increase in usability. For example, you'd be able to
 notice right away if a new test you're working was or wasn't included as
 expected, based on whether the number is the same or different from the
 previous run. Similarly, the early feedback would be helpful as a sanity
 check if you're trying to reduce the number of tests using different
 command-line options, and you're not sure if your invocation is correct.

 Thus, I'd like to suggest that `DiscoverRunner` display by default the
 number of tests discovered (and that match any filters) at the earliest
 point where this is known. This could be done inside
 `DiscoverRunner.build_suite()`.

 The code change could be as simple as:

 {{{
 diff --git a/django/test/runner.py b/django/test/runner.py
 index f187107157..c975ed92be 100644
 --- a/django/test/runner.py
 +++ b/django/test/runner.py
 @@ -652,7 +652,8 @@ class DiscoverRunner:
  # _FailedTest objects include things like test modules that
 couldn't be
  # found or that couldn't be loaded due to syntax errors.
  test_types = (unittest.loader._FailedTest, *self.reorder_by)
 -all_tests = reorder_tests(all_tests, test_types, self.reverse)
 +all_tests = list(reorder_tests(all_tests, test_types,
 self.reverse))
 +print('Found %d tests' % len(all_tests))
  suite = self.test_suite(all_tests)

  if self.parallel > 1:
 }}}

 If there is any concern about adding an additional message, another
 possibility would be to display the current "Testing against Django
 installed in ..." message later in the test run, only after the number of
 tests is known, and include the test count in that message.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.f8bf883cbe768d5a2833509d28f41bbb%40djangoproject.com.