All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Hilliard <james.hilliard1@gmail.com>
To: buildroot@buildroot.org
Cc: James Hilliard <james.hilliard1@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: [Buildroot] [PATCH buildroot-test 1/1] scripts/autobuild-run: add support for --branch option
Date: Tue,  7 Jun 2022 17:12:11 -0600	[thread overview]
Message-ID: <20220607231211.533086-1-james.hilliard1@gmail.com> (raw)

In some cases it only makes sense to run tests against a specific
branch, such as when testing new genrandconfig flags.

Add a config option to override the branch selection.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 scripts/autobuild-run | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/scripts/autobuild-run b/scripts/autobuild-run
index 337644f..ceb9daf 100755
--- a/scripts/autobuild-run
+++ b/scripts/autobuild-run
@@ -207,7 +207,7 @@ class SystemInfo:
 class Builder:
     def __init__(self, instance, njobs, sysinfo,
                  http_url, http_login, http_password,
-                 submitter, make_opts, nice, toolchains_csv,
+                 submitter, make_opts, branch, nice, toolchains_csv,
                  repo, upload, buildpid, debug):
         self.instance = instance
         self.njobs = njobs
@@ -217,6 +217,7 @@ class Builder:
         self.http_password = http_password
         self.submitter = submitter
         self.make_opts = make_opts
+        self.branch = branch
         self.nice = nice
         self.toolchains_csv = toolchains_csv
         self.repo = repo
@@ -264,6 +265,8 @@ class Builder:
         list. This way, branches with a higher weight are more likely to
         be selected.
         """
+        if self.branch:
+            return self.branch
         csv_branches = []
         with urlopen_closing(urlparse.urljoin(self.http_url, 'branches')) as r:
             for l in r.readlines():
@@ -802,6 +805,11 @@ def main():
                         help="string of extra options to pass to Buildroot "
                              "make, such as specific command wrappers",
                         type=str)
+    parser.add_argument("--branch",
+                        help="Restrict builds to a specific branch. "
+                             "Useful for situations where it only makes sense "
+                             "to run tests on a specific branch.",
+                        type=str)
     parser.add_argument("--pid-file",
                         help="path to a file where to store the PID",
                         type=pathlib.Path, default=pathlib.Path("/tmp/buildroot-autobuild.pid"))
@@ -890,6 +898,7 @@ def main():
             http_password = args.http_password,
             submitter = args.submitter,
             make_opts = (args.make_opts or ''),
+            branch = args.branch,
             nice = (args.nice or 0),
             toolchains_csv = args.toolchains_csv,
             repo = args.repo,
-- 
2.25.1

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

             reply	other threads:[~2022-06-07 23:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07 23:12 James Hilliard [this message]
2023-02-08 15:15 ` [Buildroot] [PATCH buildroot-test 1/1] scripts/autobuild-run: add support for --branch option Thomas Petazzoni via buildroot
2023-02-08 16:46   ` James Hilliard
2023-02-09 20:19     ` Arnout Vandecappelle
2023-02-09 20:32       ` James Hilliard
2023-02-09 20:44         ` Arnout Vandecappelle
2023-02-09 21:42           ` James Hilliard
2023-02-15 20:19             ` Arnout Vandecappelle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220607231211.533086-1-james.hilliard1@gmail.com \
    --to=james.hilliard1@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.