From patchwork Tue Dec 10 16:09:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain GARBAGE X-Patchwork-Id: 34745 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 11FF827BBEA; Tue, 10 Dec 2024 16:10:14 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 828B327BBE2 for ; Tue, 10 Dec 2024 16:10:13 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tL2oH-0000vZ-Sa; Tue, 10 Dec 2024 11:10:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tL2oG-0000ta-4i for guix-patches@gnu.org; Tue, 10 Dec 2024 11:10:04 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL2oF-0005Su-Qv for guix-patches@gnu.org; Tue, 10 Dec 2024 11:10:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=SNm9hoixEYB9xCpt/5m/VDAQ1eQMm21+KbvaCLYwlQc=; b=vH6cWspfT9HcqIYUtWbB42rF5K29BKN3aZSDSQ7f5Ds13wiJTvetwFUKT2buwwSd/xEnpdLy221TOMtkHdz6f9YM2W8x0kzPtMqUTpQZ21mGdMSZQB/ccy+V8CIoIcvhqQdZxC2C8cS+JC5ZUoS+Zn+vxj70zwb03PWTfp/0KOq9wjKTv/1IAVJKf5nh0yD0unFGlQiCyBRVFdqfMxwhdcaUo+v2+gt+BDYjPxWnbYk9S6GP0h6IXn9CqC41QFIIPmy/DHMqNfWLWs4vAtg5AiC2RAZIrihXW9ph6J+aSp4d/u9EGpvNeSMNqZEiqNaYd2VWrrTq2nU3DQt/d9f3/g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tL2oF-0001Wl-KM for guix-patches@gnu.org; Tue, 10 Dec 2024 11:10:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74769] [PATCH Cuirass 1/4] tests: Move procedure definition. References: <20241210160824.31748-1-romain.garbage@inria.fr> In-Reply-To: <20241210160824.31748-1-romain.garbage@inria.fr> Resent-From: Romain GARBAGE Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 10 Dec 2024 16:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74769 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74769@debbugs.gnu.org Cc: ludovic.courtes@inria.fr, Romain GARBAGE Received: via spool by 74769-submit@debbugs.gnu.org id=B74769.17338469905727 (code B ref 74769); Tue, 10 Dec 2024 16:10:03 +0000 Received: (at 74769) by debbugs.gnu.org; 10 Dec 2024 16:09:50 +0000 Received: from localhost ([127.0.0.1]:59206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tL2o1-0001UE-Ct for submit@debbugs.gnu.org; Tue, 10 Dec 2024 11:09:50 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:32084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tL2ny-0001TJ-Id for 74769@debbugs.gnu.org; Tue, 10 Dec 2024 11:09:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=SNm9hoixEYB9xCpt/5m/VDAQ1eQMm21+KbvaCLYwlQc=; b=WmwuChJ7vj0+gRs3H6YTApn8n1qbC6/oiTll8RRb33FSJNib+i0p2eiH AJBe0YbSf+lyzypV0uahjJMwCUOcZx3x2o0QlOxHL43fAPBYEyMJECfXT QlpdLsHT+Uyv2wNb9si//Z6mS0ed3CYu6UZRRauNJ6yM9qGPk5v+Al1HX U=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=romain.garbage@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.12,222,1728943200"; d="scan'208";a="103964548" Received: from unknown (HELO guix-A102.bordeaux.inria.fr) ([193.50.110.191]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2024 17:09:40 +0100 From: Romain GARBAGE Date: Tue, 10 Dec 2024 17:09:25 +0100 Message-ID: <20241210160929.14180-1-romain.garbage@inria.fr> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * tests/common.scm (specifications-equal?): New variable. * tests/gitlab.scm (specifications-equal?): Remove variable. --- tests/common.scm | 30 +++++++++++++++++++++++++++++- tests/gitlab.scm | 24 ------------------------ 2 files changed, 29 insertions(+), 25 deletions(-) base-commit: e96f0887923d4d1cd4e35073fcffdb978d7e1e10 diff --git a/tests/common.scm b/tests/common.scm index a807498..5054ea0 100644 --- a/tests/common.scm +++ b/tests/common.scm @@ -20,7 +20,9 @@ #:use-module ((cuirass base) #:select (%bridge-socket-file-name)) #:use-module (cuirass database) #:use-module (cuirass parameters) + #:use-module (cuirass specification) #:use-module (cuirass utils) + #:use-module (guix channels) #:use-module ((fibers scheduler) #:select (current-scheduler)) #:use-module (ice-9 popen) #:use-module (ice-9 rdelim) @@ -28,7 +30,8 @@ retry test-init-db! with-guix-daemon - wait-for-bridge)) + wait-for-bridge + specifications-equal?)) (define %db (make-parameter #f)) @@ -121,3 +124,28 @@ Return the socket on success and #f on failure." (sockaddr:path address) (strerror (system-error-errno args))) #f))))))) + +(define (specifications-equal? spec1 spec2) + "Return true if SPEC2 and SPEC2 are equivalent, false otherwise." + (and (eq? (specification-name spec1) + (specification-name spec2)) + (equal? (specification-build spec1) + (specification-build spec2)) + (= (specification-priority spec1) + (specification-priority spec2)) + (= (specification-period spec1) + (specification-period spec2)) + (equal? (specification-systems spec1) + (specification-systems spec2)) + (equal? (map channel-name + (specification-channels spec1)) + (map channel-name + (specification-channels spec2))) + (equal? (map channel-url + (specification-channels spec1)) + (map channel-url + (specification-channels spec2))) + (equal? (map channel-branch + (specification-channels spec1)) + (map channel-branch + (specification-channels spec2))))) diff --git a/tests/gitlab.scm b/tests/gitlab.scm index ca6cad5..adf94cc 100644 --- a/tests/gitlab.scm +++ b/tests/gitlab.scm @@ -157,30 +157,6 @@ } }") -(define (specifications-equal? spec1 spec2) - (and (eq? (specification-name spec1) - (specification-name spec2)) - (equal? (specification-build spec1) - (specification-build spec2)) - (= (specification-priority spec1) - (specification-priority spec2)) - (= (specification-period spec1) - (specification-period spec2)) - (equal? (specification-systems spec1) - (specification-systems spec2)) - (equal? (map channel-name - (specification-channels spec1)) - (map channel-name - (specification-channels spec2))) - (equal? (map channel-url - (specification-channels spec1)) - (map channel-url - (specification-channels spec2))) - (equal? (map channel-branch - (specification-channels spec1)) - (map channel-branch - (specification-channels spec2))))) - (test-assert "default-json" (specifications-equal? (let ((event (json->gitlab-event default-mr-json)))