Skip to contentSkip to conversation

DEVELOPERS: add Ricardo Martincoski for support/testing

PATCH New Ricardo Martincoski 3 participants 13 messages Jul 23, 2017 – Jul 25, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 DEVELOPERS: add Ricardo Martincoski for support/testing

While at it, also move my professional entry near my personal one.

---
 DEVELOPERS | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
DEVELOPERS +4 -3
index 0c22ffcd0c..23999a3127 100644
@@ -1398,13 +1398,14 @@ F:	package/ustream-ssl/
 N:	Renaud Aubin <[email protected]>
 F:	package/libhttpparser/
 
-N:	Ricardo Martincoski <[email protected]>
-F:	package/atop/
-
 N:	Rhys Williams <[email protected]>
 F:	package/lirc-tools/
 
+N:	Ricardo Martincoski <[email protected]>
+F:	package/atop/
+
 N:	Ricardo Martincoski <[email protected]>
+F:	support/testing/
 F:	utils/check-package
 F:	utils/checkpackagelib/
 
Signature · 1 line
2.13.0
#1 lore raw

PATCH 2/4 testing/infra/builder: dump config to log

The config is composed on-the-fly by test infra + tests.

Dump it to the logfile before running 'make olddefconfig' so it can easily analysed when debugging.

---
 support/testing/infra/builder.py | 3 +++
 1 file changed, 3 insertions(+)
support/testing/infra/builder.py +3 -0
index a475bb0a30..dc128cdd8a 100644
@@ -17,6 +17,9 @@ class Builder(object):
         config_file = os.path.join(self.builddir, ".config")
         with open(config_file, "w+") as cf:
             cf.write(self.config)
+        # dump the config to the logfile for easy debugging
+        self.logfile.write("> config:\n" + self.config)
+        self.logfile.flush()
 
         cmd = ["make",
                "O={}".format(self.builddir),
Signature · 1 line
2.13.0
#2 lore raw

PATCH 2/4 testing/infra/builder: dump config to log

Ricardo, All,

On 2017-07-23 01:20 -0300, Ricardo Martincoski spake thusly:

Quoted 15 lines

The config is composed on-the-fly by test infra + tests.

Dump it to the logfile before running 'make olddefconfig' so it can easily analysed when debugging.

---
 support/testing/infra/builder.py | 3 +++
 1 file changed, 3 insertions(+)
support/testing/infra/builder.py +0 -0
index a475bb0a30..dc128cdd8a 100644

support/testing/infra/builder.py class Builder(object): · line 22

Quoted 6 lines
support/testing/infra/builder.py +3 -0
@@ -17,6 +17,9 @@ class Builder(object):
         config_file = os.path.join(self.builddir, ".config")
         with open(config_file, "w+") as cf:
             cf.write(self.config)
+        # dump the config to the logfile for easy debugging
+        self.logfile.write("> config:\n" + self.config)
+        self.logfile.flush()

Although the variable is named 'comfig', it is in fact a defconfig.

Also, it is easy to miss exactly where the end of the config is, so maybe:

- prefix all lines with 'config: ',
or
- add 'start config' and 'end config'.

Otherwise;

Regards,
Yann E. MORIN.

Quoted 10 lines
support/testing/infra/builder.py +0 -0
         cmd = ["make",
                "O={}".format(self.builddir),
Signature · 6 lines
2.13.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 2/4 testing/infra/builder: dump config to log

Hello,

Quoted 1 line · Yann E. MORIN

On 2017-07-23 01:20 -0300, Ricardo Martincoski spake thusly:

[snip]

Quoted 7 lines

support/testing/infra/builder.py class Builder(object): · line 22

Quoted 5 lines

with open(config_file, "w+") as cf:
cf.write(self.config)

support/testing/infra/builder.py +3 -0
+        # dump the config to the logfile for easy debugging
+        self.logfile.write("> config:\n" + self.config)
+        self.logfile.flush()

Although the variable is named 'comfig', it is in fact a defconfig.

Good point. I will rename it (not the variable, of course) in the commit log and in the logfile.

Quoted 6 lines

Also, it is easy to miss exactly where the end of the config is, so maybe:

- prefix all lines with 'config: ',
or
- add 'start config' and 'end config'.

The second one seems nicer to me, I will use '> start defconfig' and '> end defconfig'.

Quoted 4 lines

Otherwise;

This is the only tag I won't keep, since I am changing this patch.

I will also account for your comment on the last patch. Thank you for the hint.

I am marking patches 2 to 4 as Changes Requested. Patch 1 (developers file only) I will keep in patchwork as-is.

Regards,
Ricardo

#4 lore raw

PATCH v2 1/3 testing/infra/builder: dump defconfig to log

In reply to Ricardo Martincoski

The defconfig is composed on-the-fly by test infra + tests.

Dump it to the logfile before running 'make olddefconfig' so it can easily analysed when debugging.

---
Changes v1 -> v2:
- it's really a defconfig, not a config (Yann E. MORIN);
- make clear on the logfile where the defconfig ends (Yann E. MORIN);
- remove tested-by tag since I changed the patch;
- patch renumbered since I kept the old patch 1 (developers file only)

    in the patchwork as-is;
---
 support/testing/infra/builder.py | 4 ++++
 1 file changed, 4 insertions(+)
support/testing/infra/builder.py +4 -0
index a475bb0a30..905b127c91 100644
@@ -17,6 +17,10 @@ class Builder(object):
         config_file = os.path.join(self.builddir, ".config")
         with open(config_file, "w+") as cf:
             cf.write(self.config)
+        # dump the defconfig to the logfile for easy debugging
+        self.logfile.write("> start defconfig\n" + self.config +
+                           "> end defconfig\n")
+        self.logfile.flush()
 
         cmd = ["make",
                "O={}".format(self.builddir),
Signature · 1 line
2.13.0
#5 lore raw

PATCH v2 2/3 support/testing: fix run-tests -j

Since commit cf3cd4388a652c9af27ef1c35622e2d0a55b99a9 the -j option is silently ignored.

The configuration lines are processed using '\n'.join(). This function adds intervening occurrences of the separator, but the resulting string does not end at a separator.

Quoted 1 line
Quoted 1 line
Quoted 1 line

"n".join(["a","b"])

'anb'
It results in a defconfig that does not end in a newline.

When BR2_JLEVEL is added by -j logic to the defconfig it ends up concatenated to the last line of the defconfig.
BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM=yBR2_JLEVEL=7
The resulting .config has the default BR2_JLEVEL=0.

Instead of just workaround this problem by adding a newline before BR2_JLEVEL when -j is used, make the defconfig to end in a newline since it is a more future-proof solution.

---
Changes v1 -> v2:
- no functional change;
- commit log adjusted to be consistent with previous patch

    (config->defconfig, based on comment from Yann E. MORIN in the
    previous patch);
  - patch renumbered since I kept the old patch 1 (developers file only)
    in the patchwork as-is;
---
 support/testing/infra/basetest.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
support/testing/infra/basetest.py +2 -1
index 07c180e232..29e7872572 100644
@@ -41,7 +41,8 @@ class BRTest(unittest.TestCase):
         self.testname = self.__class__.__name__
         self.builddir = self.outputdir and os.path.join(self.outputdir, self.testname)
         self.emulator = None
-        self.config = '\n'.join([line.lstrip() for line in self.config.splitlines()])
+        self.config = '\n'.join([line.lstrip() for line in
+                                 self.config.splitlines()]) + '\n'
 
     def show_msg(self, msg):
         print "{} {:40s} {}".format(datetime.datetime.now().strftime("%H:%M:%S"),
Signature · 1 line
2.13.0
#6 lore raw

PATCH v2 3/3 testing/infra/basetest: move jlevel logic to constructor

In reply to Ricardo Martincoski

As suggested by Arnout in [1].

While at it, simplify the logic by always appending the BR2_JLEVEL and defaulting to 0 (the value copied from Config.in is used for 5 years now and is very unlikely to change).

[1] http://patchwork.ozlabs.org/patch/790525/

---
Changes v1 -> v2:
- no functional change;
- keep Cc: in commit log (Yann E. MORIN);
- patch renumbered since I kept the old patch 1 (developers file only)

    in the patchwork as-is;
---
 support/testing/infra/basetest.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
support/testing/infra/basetest.py +3 -5
index 29e7872572..431605b23f 100644
@@ -34,7 +34,7 @@ class BRTest(unittest.TestCase):
     outputdir = None
     logtofile = True
     keepbuilds = False
-    jlevel = None
+    jlevel = 0
 
     def __init__(self, names):
         super(BRTest, self).__init__(names)
@@ -43,16 +43,14 @@ class BRTest(unittest.TestCase):
         self.emulator = None
         self.config = '\n'.join([line.lstrip() for line in
                                  self.config.splitlines()]) + '\n'
+        self.config += "BR2_JLEVEL={}\n".format(self.jlevel)
 
     def show_msg(self, msg):
         print "{} {:40s} {}".format(datetime.datetime.now().strftime("%H:%M:%S"),
                                     self.testname, msg)
     def setUp(self):
         self.show_msg("Starting")
-        config = self.config
-        if self.jlevel:
-            config += "BR2_JLEVEL={}\n".format(self.jlevel)
-        self.b = Builder(config, self.builddir, self.logtofile)
+        self.b = Builder(self.config, self.builddir, self.logtofile)
 
         if not self.keepbuilds:
             self.b.delete()
Signature · 1 line
2.13.0
#7 lore raw

PATCH v2 1/3 testing/infra/builder: dump defconfig to log

In reply to Ricardo Martincoski

Hello,

Quoted 13 lines · Ricardo Martincoski

The defconfig is composed on-the-fly by test infra + tests.

Dump it to the logfile before running 'make olddefconfig' so it can easily analysed when debugging.

---
Changes v1 -> v2:
- it's really a defconfig, not a config (Yann E. MORIN);
- make clear on the logfile where the defconfig ends (Yann E. MORIN);
- remove tested-by tag since I changed the patch;
- patch renumbered since I kept the old patch 1 (developers file only)

Quoted 4 lines
    in the patchwork as-is;
---
 support/testing/infra/builder.py | 4 ++++
 1 file changed, 4 insertions(+)

Series applied. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#8 lore raw

PATCH 3/4 support/testing: fix run-tests -j

In reply to Ricardo Martincoski

Since commit cf3cd4388a652c9af27ef1c35622e2d0a55b99a9 the -j option is silently ignored.

The configuration lines are processed using '\n'.join(). This function adds intervening occurrences of the separator, but the resulting string does not end at a separator.

Quoted 1 line
Quoted 1 line
Quoted 1 line

"n".join(["a","b"])

'anb'
It results in a config that does not end in a newline.

When BR2_JLEVEL is added by -j logic to the config it ends up concatenated to the last line of the config.
BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM=yBR2_JLEVEL=7
The resulting .config has the default BR2_JLEVEL=0.

Instead of just workaround this problem by adding a newline before BR2_JLEVEL when -j is used, make the config to end in a newline since it is a more future-proof solution.

Cc Arnout Vandecappelle <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Yann E. MORIN <[email protected]>
---
 support/testing/infra/basetest.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
support/testing/infra/basetest.py +2 -1
index 07c180e232..29e7872572 100644
@@ -41,7 +41,8 @@ class BRTest(unittest.TestCase):
         self.testname = self.__class__.__name__
         self.builddir = self.outputdir and os.path.join(self.outputdir, self.testname)
         self.emulator = None
-        self.config = '\n'.join([line.lstrip() for line in self.config.splitlines()])
+        self.config = '\n'.join([line.lstrip() for line in
+                                 self.config.splitlines()]) + '\n'
 
     def show_msg(self, msg):
         print "{} {:40s} {}".format(datetime.datetime.now().strftime("%H:%M:%S"),
Signature · 1 line
2.13.0
#9 lore raw

PATCH 3/4 support/testing: fix run-tests -j

Ricardo, All,

On 2017-07-23 01:20 -0300, Ricardo Martincoski spake thusly:

Quoted 6 lines

Since commit cf3cd4388a652c9af27ef1c35622e2d0a55b99a9 the -j option is silently ignored.

The configuration lines are processed using '\n'.join(). This function adds intervening occurrences of the separator, but the resulting string does not end at a separator.

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"n".join(["a","b"])

'anb'
It results in a config that does not end in a newline.

When BR2_JLEVEL is added by -j logic to the config it ends up concatenated to the last line of the config.
BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM=yBR2_JLEVEL=7
The resulting .config has the default BR2_JLEVEL=0.

Confirmed.

Quoted 8 lines

Instead of just workaround this problem by adding a newline before BR2_JLEVEL when -j is used, make the config to end in a newline since it is a more future-proof solution.

Cc Arnout Vandecappelle <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Yann E. MORIN <[email protected]>

Regards,
Yann E. MORIN.

Quoted 21 lines
---
 support/testing/infra/basetest.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
support/testing/infra/basetest.py +2 -1
index 07c180e232..29e7872572 100644
@@ -41,7 +41,8 @@ class BRTest(unittest.TestCase):
         self.testname = self.__class__.__name__
         self.builddir = self.outputdir and os.path.join(self.outputdir, self.testname)
         self.emulator = None
-        self.config = '\n'.join([line.lstrip() for line in self.config.splitlines()])
+        self.config = '\n'.join([line.lstrip() for line in
+                                 self.config.splitlines()]) + '\n'
 
     def show_msg(self, msg):
         print "{} {:40s} {}".format(datetime.datetime.now().strftime("%H:%M:%S"),
Signature · 1 line
2.13.0
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#10 lore raw

PATCH 4/4 testing/infra/basetest: move jlevel logic to constructor

In reply to Ricardo Martincoski

As suggested by Arnout in [1].

While at it, simplify the logic by always appending the BR2_JLEVEL and defaulting to 0 (the value copied from Config.in is used for 5 years now and is very unlikely to change).

[1] http://patchwork.ozlabs.org/patch/790525/

---
tip for git send-email:
Cc: Arnout Vandecappelle <[email protected]>

---
 support/testing/infra/basetest.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
support/testing/infra/basetest.py +3 -5
index 29e7872572..431605b23f 100644
@@ -34,7 +34,7 @@ class BRTest(unittest.TestCase):
     outputdir = None
     logtofile = True
     keepbuilds = False
-    jlevel = None
+    jlevel = 0
 
     def __init__(self, names):
         super(BRTest, self).__init__(names)
@@ -43,16 +43,14 @@ class BRTest(unittest.TestCase):
         self.emulator = None
         self.config = '\n'.join([line.lstrip() for line in
                                  self.config.splitlines()]) + '\n'
+        self.config += "BR2_JLEVEL={}\n".format(self.jlevel)
 
     def show_msg(self, msg):
         print "{} {:40s} {}".format(datetime.datetime.now().strftime("%H:%M:%S"),
                                     self.testname, msg)
     def setUp(self):
         self.show_msg("Starting")
-        config = self.config
-        if self.jlevel:
-            config += "BR2_JLEVEL={}\n".format(self.jlevel)
-        self.b = Builder(config, self.builddir, self.logtofile)
+        self.b = Builder(self.config, self.builddir, self.logtofile)
 
         if not self.keepbuilds:
             self.b.delete()
Signature · 1 line
2.13.0
#11 lore raw

PATCH 4/4 testing/infra/basetest: move jlevel logic to constructor

Ricardo, all,

On 2017-07-23 01:20 -0300, Ricardo Martincoski spake thusly:

Quoted 6 lines

As suggested by Arnout in [1].

While at it, simplify the logic by always appending the BR2_JLEVEL and defaulting to 0 (the value copied from Config.in is used for 5 years now and is very unlikely to change).

Quoted 7 lines

[1] http://patchwork.ozlabs.org/patch/790525/

---
tip for git send-email:
Cc: Arnout Vandecappelle <[email protected]>

You can (and should) leave that one below you SoB line, not after the '---' line, because it is important that it is recorded as part of the commit log.

It is not a problem that Arnout (or whoever) is named twice in a tag.

Regards,
Yann E. MORIN.

Quoted 43 lines
---
 support/testing/infra/basetest.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
support/testing/infra/basetest.py +3 -5
index 29e7872572..431605b23f 100644
@@ -34,7 +34,7 @@ class BRTest(unittest.TestCase):
     outputdir = None
     logtofile = True
     keepbuilds = False
-    jlevel = None
+    jlevel = 0
 
     def __init__(self, names):
         super(BRTest, self).__init__(names)
@@ -43,16 +43,14 @@ class BRTest(unittest.TestCase):
         self.emulator = None
         self.config = '\n'.join([line.lstrip() for line in
                                  self.config.splitlines()]) + '\n'
+        self.config += "BR2_JLEVEL={}\n".format(self.jlevel)
 
     def show_msg(self, msg):
         print "{} {:40s} {}".format(datetime.datetime.now().strftime("%H:%M:%S"),
                                     self.testname, msg)
     def setUp(self):
         self.show_msg("Starting")
-        config = self.config
-        if self.jlevel:
-            config += "BR2_JLEVEL={}\n".format(self.jlevel)
-        self.b = Builder(config, self.builddir, self.logtofile)
+        self.b = Builder(self.config, self.builddir, self.logtofile)
 
         if not self.keepbuilds:
             self.b.delete()
Signature · 6 lines
2.13.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#12 lore raw

PATCH 1/4 DEVELOPERS: add Ricardo Martincoski for support/testing

In reply to Ricardo Martincoski

Hello,

Quoted 6 lines · Ricardo Martincoski

While at it, also move my professional entry near my personal one.

---
 DEVELOPERS | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com