linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kunit: capture stderr on all make subprocess calls
@ 2020-07-08 21:35 Will Chen
  2020-07-09 21:27 ` Brendan Higgins
  0 siblings, 1 reply; 2+ messages in thread
From: Will Chen @ 2020-07-08 21:35 UTC (permalink / raw)
  To: brendanhiggins, davidgow
  Cc: Will Chen, linux-kselftest, kunit-dev, linux-kernel

Direct stderr to subprocess.STDOUT so error messages get included in the
subprocess.CalledProcessError exceptions output field. This results in
more meaningful error messages for the user.

This is already being done in the make_allyesconfig method. Do the same
for make_mrproper, make_olddefconfig, and make methods.

With this, failures on unclean trees [1] will give users an error
message that includes:
"The source tree is not clean, please run 'make ARCH=um mrproper'"

[1] https://bugzilla.kernel.org/show_bug.cgi?id=205219

Signed-off-by: Will Chen <chenwi@google.com>
---
 tools/testing/kunit/kunit_kernel.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py
index 63dbda2d029f..e20e2056cb38 100644
--- a/tools/testing/kunit/kunit_kernel.py
+++ b/tools/testing/kunit/kunit_kernel.py
@@ -34,7 +34,7 @@ class LinuxSourceTreeOperations(object):
 
 	def make_mrproper(self):
 		try:
-			subprocess.check_output(['make', 'mrproper'])
+			subprocess.check_output(['make', 'mrproper'], stderr=subprocess.STDOUT)
 		except OSError as e:
 			raise ConfigError('Could not call make command: ' + e)
 		except subprocess.CalledProcessError as e:
@@ -47,7 +47,7 @@ class LinuxSourceTreeOperations(object):
 		if build_dir:
 			command += ['O=' + build_dir]
 		try:
-			subprocess.check_output(command, stderr=subprocess.PIPE)
+			subprocess.check_output(command, stderr=subprocess.STDOUT)
 		except OSError as e:
 			raise ConfigError('Could not call make command: ' + e)
 		except subprocess.CalledProcessError as e:
@@ -77,7 +77,7 @@ class LinuxSourceTreeOperations(object):
 		if build_dir:
 			command += ['O=' + build_dir]
 		try:
-			subprocess.check_output(command)
+			subprocess.check_output(command, stderr=subprocess.STDOUT)
 		except OSError as e:
 			raise BuildError('Could not call execute make: ' + e)
 		except subprocess.CalledProcessError as e:
-- 
2.27.0.383.g050319c2ae-goog


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

* Re: [PATCH] kunit: capture stderr on all make subprocess calls
  2020-07-08 21:35 [PATCH] kunit: capture stderr on all make subprocess calls Will Chen
@ 2020-07-09 21:27 ` Brendan Higgins
  0 siblings, 0 replies; 2+ messages in thread
From: Brendan Higgins @ 2020-07-09 21:27 UTC (permalink / raw)
  To: Will Chen
  Cc: David Gow, open list:KERNEL SELFTEST FRAMEWORK,
	KUnit Development, Linux Kernel Mailing List

On Wed, Jul 8, 2020 at 2:37 PM Will Chen <chenwi@google.com> wrote:
>
> Direct stderr to subprocess.STDOUT so error messages get included in the
> subprocess.CalledProcessError exceptions output field. This results in
> more meaningful error messages for the user.
>
> This is already being done in the make_allyesconfig method. Do the same
> for make_mrproper, make_olddefconfig, and make methods.
>
> With this, failures on unclean trees [1] will give users an error
> message that includes:
> "The source tree is not clean, please run 'make ARCH=um mrproper'"
>
> [1] https://bugzilla.kernel.org/show_bug.cgi?id=205219
>
> Signed-off-by: Will Chen <chenwi@google.com>

Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Tested-by: Brendan Higgins <brendanhiggins@google.com>

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

end of thread, other threads:[~2020-07-09 21:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-08 21:35 [PATCH] kunit: capture stderr on all make subprocess calls Will Chen
2020-07-09 21:27 ` Brendan Higgins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).