[snowpatch] [PATCH] main: Post test result when using --patch

Andrew Donnellan ajd at linux.ibm.com
Thu Jun 6 19:59:03 AEST 2019


For some reason, we weren't posting test results when invoked with --patch
rather than --series. Fix this.

Closes: #57 ("Post test result when using --patch")
Signed-off-by: Andrew Donnellan <ajd at linux.ibm.com>

---

completely untested
---
 src/main.rs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/main.rs b/src/main.rs
index 5ec0c37b2d7f..c3c128faeb6f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -398,7 +398,12 @@ fn run() -> Result<(), Box<Error>> {
                 } else {
                     patchwork.get_patch_mbox(&patch)
                 };
-                test_patch(&settings, &client, &project, &mbox, true);
+                let results = test_patch(&settings, &client, &project, &mbox, true);
+                if project.push_results {
+                    for result in results {
+                        patchwork.post_test_result(&result, &patch.checks).unwrap();
+                    }
+                }
             }
         }
         return Ok(());
-- 
2.20.1



More information about the snowpatch mailing list