Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] support/testing/run-tests: add a nose2 debug option
@ 2024-08-08 20:48 Julien Olivain
  2024-08-09 22:13 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Julien Olivain @ 2024-08-08 20:48 UTC (permalink / raw)
  To: buildroot; +Cc: Julien Olivain, Ricardo Martincoski

This commit adds the -D/--debug command line options to the
support/testing/run-tests script.

Using one of those options will pass "--log-level debug" to the
nose2 invocations. This can be useful to debug nose2 internal
behaviors. See:
https://github.com/nose-devs/nose2/blob/0.15.1/nose2/main.py#L209

For example, calling:

    support/testing/run-tests --list --debug

will output:

    List of tests
    DEBUG:nose2.main:logging initialized debug
    ...

Signed-off-by: Julien Olivain <ju.o@free.fr>
---
For info, this patch was written for a small investigation asked by
Thomas in the discussion at:
https://lists.buildroot.org/pipermail/buildroot/2024-August/759983.html
This debug option might be useful in some other cases...
---
 support/testing/run-tests | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/support/testing/run-tests b/support/testing/run-tests
index 485811b746..2f670c03b8 100755
--- a/support/testing/run-tests
+++ b/support/testing/run-tests
@@ -36,6 +36,8 @@ def main():
                         help='BR2_JLEVEL to use for each testcase')
     parser.add_argument('--timeout-multiplier', type=int, default=1,
                         help='increase timeouts (useful for slow machines)')
+    parser.add_argument('-D', '--debug', action='store_true',
+                        help='enable debug log')
 
     args = parser.parse_args()
 
@@ -47,10 +49,15 @@ def main():
 
     if args.list:
         print("List of tests")
-        nose2.discover(argv=[script_path,
-                             "-s", test_dir,
-                             "-v",
-                             "--collect-only"],
+        nose2_args = [
+            script_path,
+            "-s", test_dir,
+            "-v",
+            "--collect-only"
+        ]
+        if args.debug:
+            nose2_args += ["--log-level", "debug"]
+        nose2.discover(argv=nose2_args,
                        plugins=["nose2.plugins.collect"])
         return 0
 
@@ -125,6 +132,9 @@ def main():
                   "-s", test_dir,
                   "-c", os.path.join(test_dir, "conf/unittest.cfg")]
 
+    if args.debug:
+        nose2_args += ["--log-level", "debug"]
+
     if args.testname:
         nose2_args += args.testname
 
-- 
2.46.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] support/testing/run-tests: add a nose2 debug option
  2024-08-08 20:48 [Buildroot] [PATCH 1/1] support/testing/run-tests: add a nose2 debug option Julien Olivain
@ 2024-08-09 22:13 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-08-09 22:13 UTC (permalink / raw)
  To: Julien Olivain; +Cc: Ricardo Martincoski, buildroot

On Thu,  8 Aug 2024 22:48:11 +0200
Julien Olivain <ju.o@free.fr> wrote:

> This commit adds the -D/--debug command line options to the
> support/testing/run-tests script.
> 
> Using one of those options will pass "--log-level debug" to the
> nose2 invocations. This can be useful to debug nose2 internal
> behaviors. See:
> https://github.com/nose-devs/nose2/blob/0.15.1/nose2/main.py#L209
> 
> For example, calling:
> 
>     support/testing/run-tests --list --debug
> 
> will output:
> 
>     List of tests
>     DEBUG:nose2.main:logging initialized debug
>     ...
> 
> Signed-off-by: Julien Olivain <ju.o@free.fr>
> ---
> For info, this patch was written for a small investigation asked by
> Thomas in the discussion at:
> https://lists.buildroot.org/pipermail/buildroot/2024-August/759983.html
> This debug option might be useful in some other cases...
> ---
>  support/testing/run-tests | 18 ++++++++++++++----
>  1 file changed, 14 insertions(+), 4 deletions(-)

Applied to next, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2024-08-09 22:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-08 20:48 [Buildroot] [PATCH 1/1] support/testing/run-tests: add a nose2 debug option Julien Olivain
2024-08-09 22:13 ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox