diff mbox

Don't retest patches that have already been tested

Message ID 1461129092-24748-1-git-send-email-ruscur@russell.cc
State Accepted
Delegated to: Andrew Donnellan
Headers show

Commit Message

Russell Currey April 20, 2016, 5:11 a.m. UTC
Currently when snowpatch is running in endless/daemon mode, once it's
tested all the series it will go back and do it all again.  This is a
waste of time and resources, so let's not do that.

If Jenkins tests are once again parallelised, and the Patchwork polling
interval is set to something low, there's a chance that the test state
of a series will not be reported and that something will still be tested
twice.  We can deal with that when/if it happens.

Closes: #12 ("'Endless' mode retests series")
Signed-off-by: Russell Currey <ruscur@russell.cc>
---
This might require a fixup or something since it's right next to stuff
touched by the linkname patch.
---
 src/main.rs | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Andrew Donnellan April 20, 2016, 5:22 a.m. UTC | #1
On 20/04/16 15:11, Russell Currey wrote:
> Currently when snowpatch is running in endless/daemon mode, once it's
> tested all the series it will go back and do it all again.  This is a
> waste of time and resources, so let's not do that.
>
> If Jenkins tests are once again parallelised, and the Patchwork polling
> interval is set to something low, there's a chance that the test state
> of a series will not be reported and that something will still be tested
> twice.  We can deal with that when/if it happens.
>
> Closes: #12 ("'Endless' mode retests series")
> Signed-off-by: Russell Currey <ruscur@russell.cc>

As you noted, it did need a small fixup.

Applied to master: d7f650899146e0fa473a2b1b3f95911e520f07e1

Thanks,
diff mbox

Patch

diff --git a/src/main.rs b/src/main.rs
index b18206c..a119067 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -267,6 +267,11 @@  fn main() {
     'daemon: loop {
         let series_list = patchwork.get_series_query().unwrap().results.unwrap();
         for series in series_list {
+            // If it's already been tested, we can skip it
+            if series.test_state.is_some() {
+                continue;
+            }
+
             match settings.projects.get(&series.project.name) {
                 None => continue,
                 Some(project) => {