From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id eOp1HcgIW2eDfgEAqHPOHw:P1 (envelope-from ) for ; Thu, 12 Dec 2024 16:01:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id eOp1HcgIW2eDfgEAqHPOHw (envelope-from ) for ; Thu, 12 Dec 2024 17:01:12 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=LjlvkK+y; dkim=fail ("headers rsa verify failed") header.d=inria.fr header.s=dc header.b=hVKnEOPg; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=inria.fr (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734019272; a=rsa-sha256; cv=none; b=LSrFi4wgDXx3KuHcAMVGIfG5JpkZF8SX/R0CFsExtGQzGyCVzcUDD2LZYxvIQmzGfiTcSt YJi3OIiMizB0w64GOL55zxVNrE/sWFdn0klxOSHs18HEZZ3ZLzhekN4kmj7X2pc+VZjiIm kGNDdrWZUya8pgRIsHCElIAB+op95Mxt+zPabJcunXVQ0CIhmSRl5xrJTT6q7qlDs6fd2p lSLnKzXbFfgdHj98uCQyOPBgrA1ZqKxTFjk7L+6lovA2XD/p51Yp1T15hEuzhy8Jg5k9+V D2NtMKinIslzYFGdES2orZHKbLDovfsLR8URLwfd1CdIRJFNK6UelE0qRxRwNg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=LjlvkK+y; dkim=fail ("headers rsa verify failed") header.d=inria.fr header.s=dc header.b=hVKnEOPg; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=inria.fr (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734019272; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=SNm9hoixEYB9xCpt/5m/VDAQ1eQMm21+KbvaCLYwlQc=; b=pkaRAvLKRJw45U6d2UOw8TXeYKv5Az75tZ9nahmlFqchmOzBKzpiDETEPpobvzb1FBeNaQ 0z7dpGTCZlkZK/urY7wI1uwKWUs3aV66UL2vd2aEhxPxhDIfsR4ugBRpZyeY3UCNjjBCEd puCTziGTkwooOgFoSO0sA3womoq1MRzCMz5BZdy0qd2cb873prQakM8Mo16UEze+8PPNau NIEZCU6jtLDy/roMe1qDKYho1v/K3wrkDoDMaPHahyf0PhOZwbuvrDcxNtBPdABPvJpDQg EZYdRn9gqor2Zq/nap8JIV3NkgbImZWZK2nKfn60dXQ3wgzpscIQfWXxh7B8SQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5087B5620F for ; Thu, 12 Dec 2024 17:01:12 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLlbt-00020V-VW; Thu, 12 Dec 2024 11:00:18 -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 1tLlbh-0001uq-EH for guix-patches@gnu.org; Thu, 12 Dec 2024 11:00:07 -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 1tLlbg-0000p8-MG for guix-patches@gnu.org; Thu, 12 Dec 2024 11:00:05 -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=LjlvkK+ypUh0/lwLh96KFaUJrZ/F5jke6EUHAVyQoZDhidyLzdC95TbF4v4SMukHqorQaiELUtheHmMoRTudKIF4UYv4R11ZY3aSWY1DFRgfQqMUtFozw02jkeb253EMkuAqi58oqQU4kz6tkucCKtKhMqRDOeHCshfqMp81wfAHxDTtTkEq7qn3gHRbq8EI5lKMQQJl2T1uzE+/PQI0YsWxVCG4Ud2yBe9vDtenbHjkeRa8hwZ5JsUUQhwukaA72SXzNGU5jKo+7tk/+4o0uZwwGWnbiAq93lGBbT1XNXhf6ZFaU+oOUAz+wncdVEGIjhAFu2GQX/G+0kbdix3aNw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLlbf-0000yL-Co for guix-patches@gnu.org; Thu, 12 Dec 2024 11:00:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74769] [PATCH Cuirass v2 1/7] 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: Thu, 12 Dec 2024 16:00: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.17340191553553 (code B ref 74769); Thu, 12 Dec 2024 16:00:03 +0000 Received: (at 74769) by debbugs.gnu.org; 12 Dec 2024 15:59:15 +0000 Received: from localhost ([127.0.0.1]:39975 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLlao-0000uq-2p for submit@debbugs.gnu.org; Thu, 12 Dec 2024 10:59:15 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:36970) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLlaj-0000u3-50 for 74769@debbugs.gnu.org; Thu, 12 Dec 2024 10:59:08 -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=hVKnEOPgKwOxqTWQLEPA0FGjCZn7Yttkbf2/ofqudxOsn2KZLVmdAycc KtXJ7PzkX+F8qUcnkvHMBX4PJNLOPXB/oxaCgfJDa9a4UrZR+J8Xbs+2x t4xoNyMAPCu6wq+RPMkNeA8te1Bf9p3+W9/wFlvhhwSo9Jnqpmt+zo6az o=; X-IronPort-AV: E=Sophos;i="6.12,229,1728943200"; d="scan'208";a="104178636" 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; 12 Dec 2024 16:58:58 +0100 From: Romain GARBAGE Date: Thu, 12 Dec 2024 16:57:49 +0100 Message-ID: <20241212155845.27344-1-romain.garbage@inria.fr> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 5087B5620F X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -4.90 X-Spam-Score: -4.90 X-TUID: V7r+PgOOvlEC * 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(-) 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))) base-commit: e96f0887923d4d1cd4e35073fcffdb978d7e1e10 -- 2.46.0