From patchwork Fri Jul 20 11:57:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell Currey X-Patchwork-Id: 946847 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41X8Xr3g0Bz9s7c for ; Fri, 20 Jul 2018 21:58:20 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=russell.cc Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="eh1o6xC3"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41X8Xr1S9fzDqGL for ; Fri, 20 Jul 2018 21:58:20 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=russell.cc Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="eh1o6xC3"; dkim-atps=neutral X-Original-To: snowpatch@lists.ozlabs.org Delivered-To: snowpatch@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=russell.cc (client-ip=64.147.123.21; helo=wout5-smtp.messagingengine.com; envelope-from=ruscur@russell.cc; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=russell.cc Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="eh1o6xC3"; dkim-atps=neutral Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41X8Xc1MNhzDqC3 for ; Fri, 20 Jul 2018 21:58:08 +1000 (AEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 19FB6370; Fri, 20 Jul 2018 07:58:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 20 Jul 2018 07:58:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=YOlLzVPl2cAeIs+0SH24W/Jru1WYu+hRU+WJCqOgQkY=; b=eh1o6xC3 DwFmgK7YseCqoTOG44AJncpjPmugNgl4bDja0FX1IhUBc1sm+vGgrBH4MFGkmsGf DyyrkNn9NfwOjwGmSLaOK6L5sjttYVnCTgslZ4tOhsQCWdeDZi3O9T9t8cRKJET7 0audnJatXaVO85C3nN01Z76MowzkYx3Xm8sbjNtxFgrIUAhhbDYAKg4CUhyPlPQD 4m6BjZraovt0oC5EmI5K6+5UIE8LAtUoLt+5WcrFZgvdbPOggpysQjUoWh6lpwSY 98ZZzGop3un9u3eBBIYpe7KoHujXr4qMqj0C34W4MfDyjyx44A6cJroCW4lODChA uG7CMykN4nidgQ== X-ME-Proxy: X-ME-Sender: Received: from snap.ozlabs.ibm.com (unknown [122.99.82.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 13F2C1026A; Fri, 20 Jul 2018 07:58:03 -0400 (EDT) From: Russell Currey To: snowpatch@lists.ozlabs.org, andrew.donnellan@au1.ibm.com Date: Fri, 20 Jul 2018 21:57:27 +1000 Message-Id: <20180720115728.19312-7-ruscur@russell.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180720115728.19312-1-ruscur@russell.cc> References: <20180720115728.19312-1-ruscur@russell.cc> Subject: [snowpatch] [PATCH 7/8] Implement sending results to Patchwork for --patch X-BeenThere: snowpatch@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Continuous Integration for patch-based workflows List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Russell Currey MIME-Version: 1.0 Errors-To: snowpatch-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "snowpatch" Signed-off-by: Russell Currey Reviewed-by: Andrew Donnellan --- src/main.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 5d34b36..e3b36f2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -374,7 +374,16 @@ fn main() { Some(project) => { let dependencies = patchwork.get_patch_dependencies(&patch); let mbox = patchwork.get_patches_mbox(dependencies); - test_patch(&settings, &client, project, &mbox, true); + let results = test_patch(&settings, &client, project, &mbox, true); + + // Delete the temporary directory with the patch in it + fs::remove_dir_all(mbox.parent().unwrap()) + .unwrap_or_else(|err| error!("Couldn't delete temp directory: {}", err)); + if project.push_results { + for result in results { + patchwork.post_test_result(result, &patch.checks).unwrap(); + } + } } } return;