From patchwork Sun Jun 14 05:34:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Marusich X-Patchwork-Id: 22703 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id ABCA727BBE4; Sun, 14 Jun 2020 06:35:08 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 3429527BBE3 for ; Sun, 14 Jun 2020 06:35:08 +0100 (BST) Received: from localhost ([::1]:58622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jkLIR-0007Kk-MK for patchwork@mira.cbaines.net; Sun, 14 Jun 2020 01:35:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jkLIM-0007KQ-5b for guix-patches@gnu.org; Sun, 14 Jun 2020 01:35:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59431) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jkLIL-0005q6-Sg for guix-patches@gnu.org; Sun, 14 Jun 2020 01:35:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jkLIL-0007Lx-Ql for guix-patches@gnu.org; Sun, 14 Jun 2020 01:35:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41845] [PATCH] tests: lint: Add origin patch file name test cases. Resent-From: Chris Marusich Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 14 Jun 2020 05:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41845 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?utf-8?q?Court=C3=A8s?= Cc: 41845@debbugs.gnu.org X-Debbugs-Original-Cc: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159211287028205 (code B ref -1); Sun, 14 Jun 2020 05:35:01 +0000 Received: (at submit) by debbugs.gnu.org; 14 Jun 2020 05:34:30 +0000 Received: from localhost ([127.0.0.1]:42735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jkLHq-0007Kr-4b for submit@debbugs.gnu.org; Sun, 14 Jun 2020 01:34:30 -0400 Received: from lists.gnu.org ([209.51.188.17]:60896) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jkLHo-0007Kj-MM for submit@debbugs.gnu.org; Sun, 14 Jun 2020 01:34:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jkLHo-0007Ib-Er for guix-patches@gnu.org; Sun, 14 Jun 2020 01:34:28 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:38214) by eggs.gnu.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jkLHm-0005bH-IC; Sun, 14 Jun 2020 01:34:28 -0400 Received: by mail-pj1-x1033.google.com with SMTP id d6so5647495pjs.3; Sat, 13 Jun 2020 22:34:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:user-agent:mime-version; bh=G0M33l79kgNdCuPJ9AVQ1voF82isNnM2YRRyIVp/bQM=; b=WrGtLjDUM9kfhUUEm2oYXLvJj2WFKNdhoBU1XmvscUq+yH0MVOEHV3fGBDGiZv9Eag T4S4faWL8nnTuljX6XyI0uRrxYScqR/pW40B2OOFLqrgQQvExxoxyUIF8qZvi857Y57d NchhY2lF0zuF7BDZCyNthsBfZD082Ipds/oTkTTCHfrj4KHEfRfW87t0ob6mX5S8ODmT g2yZO+Q+90YP1GXrRohX59h7A2zjWPm4phMIrFebChlYztooGv9R+CnriwCdBo5H61jn H3YV36J49uSk7A7q1iXZel5raSOa3XPncR0+IdfxxO/+HxJ05JFFdhgr8KSOuL/0mPPP TE9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :mime-version; bh=G0M33l79kgNdCuPJ9AVQ1voF82isNnM2YRRyIVp/bQM=; b=B2Zn739K7xAMmrcXvxXg4iFpj/xCQTxtnkChU0YC+ZEaOIVqcBpJDjxvRaLvNtdTkt pfS4XPmTqlH5tIYPEMN7FkNyqAxM9rGCEwJu3rKY5o3nm6HzijNQ7RcHi1exw/ZxBnfV hvehSn5pF7zCfQwS4zAenRqoEqUNP/Qf/qvBK7uHcytW7ohEVCJpxKuUCkLlHVrgxILC bQ2ckFJCAk+Y6unQgFz84vc5zGD1ulV/Q90teyQwHbQmiTHXZBdyNOxoSiXK601l6cxS GEtcSgzHwHQI+JszqEvZnko+xAGEXiRq/MBmsXpwgoHvrLrCyvMR+jlL/p2XzP3iY72W fEUw== X-Gm-Message-State: AOAM532sIIvJzVcBC8PLFP0XSzApWUqb1Srpeyv0VQCjfgHur6f0me4x hEC5ERuWGJ09Clrbm7KJBFU07hidgd8= X-Google-Smtp-Source: ABdhPJx0X7Qbby+enI9/XPl28C3L/W8bjxpzXLcf+WisQlz/DmtmbN9yRKdbdN35eO24cWf17NLhLA== X-Received: by 2002:a17:90b:252:: with SMTP id fz18mr5730043pjb.96.1592112854182; Sat, 13 Jun 2020 22:34:14 -0700 (PDT) Received: from garuda-lan (c-73-97-103-127.hsd1.wa.comcast.net. [73.97.103.127]) by smtp.gmail.com with ESMTPSA id d5sm10600435pfd.124.2020.06.13.22.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jun 2020 22:34:13 -0700 (PDT) From: Chris Marusich Date: Sat, 13 Jun 2020 22:34:11 -0700 Message-ID: <878sgqi52k.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=cmmarusich@gmail.com; helo=mail-pj1-x1033.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hi Ludo and others, Here's a patch to add some missing lint test cases. I confirmed that all the lint tests pass. I also confirmed that the new " patches: same file name -> no warnings" test case fails (as expected) when commit 21887021b9acf60157b1b0a39c16f2ec6498021b is reverted, so the new tests do seem to be working as intended. Thank you for encouraging me to add these test cases, Ludo! From 5fa2156f8561afb87d7f9a63de0243334e9da53b Mon Sep 17 00:00:00 2001 From: Chris Marusich Date: Sat, 13 Jun 2020 22:09:46 -0700 Subject: [PATCH] tests: lint: Add origin patch file name test cases. In particular, " patches: same file name -> no warnings" would have caught the issue which was fixed in commit 21887021b9acf60157b1b0a39c16f2ec6498021b. * tests/lint.scm (patches: file names): Rename this test case... ("file patches: different file name -> warning"): ... to this. ("file patches: same file name -> no warnings") (" patches: different file name -> warning") (" patches: same file name -> no warnings"): New test cases. --- tests/lint.scm | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/tests/lint.scm b/tests/lint.scm index 4ce45b4a70..53647373e4 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -310,7 +310,7 @@ `(("python-setuptools" ,python-setuptools)))))) (check-inputs-should-not-be-an-input-at-all pkg)))) -(test-equal "patches: file names" +(test-equal "file patches: different file name -> warning" "file names of patches should start with the package name" (single-lint-warning-message (let ((pkg (dummy-package "x" @@ -319,6 +319,37 @@ (patches (list "/path/to/y.patch"))))))) (check-patch-file-names pkg)))) +(test-equal "file patches: same file name -> no warnings" + '() + (let ((pkg (dummy-package "x" + (source + (dummy-origin + (patches (list "/path/to/x.patch"))))))) + (check-patch-file-names pkg))) + +(test-equal " patches: different file name -> warning" + "file names of patches should start with the package name" + (single-lint-warning-message + (let ((pkg (dummy-package "x" + (source + (dummy-origin + (patches + (list + (dummy-origin + (file-name "y.patch"))))))))) + (check-patch-file-names pkg)))) + +(test-equal " patches: same file name -> no warnings" + '() + (let ((pkg (dummy-package "x" + (source + (dummy-origin + (patches + (list + (dummy-origin + (file-name "x.patch"))))))))) + (check-patch-file-names pkg))) + (test-equal "patches: file name too long" (string-append "x-" (make-string 100 #\a) -- 2.26.2