From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 0OnMMh8ydmVKxwAA9RJhRA:P1 (envelope-from ) for ; Sun, 10 Dec 2023 22:48:15 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 0OnMMh8ydmVKxwAA9RJhRA (envelope-from ) for ; Sun, 10 Dec 2023 22:48:15 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=DQqvcava; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1702244895; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: 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=/MwSfBM5VhpwskLIbe90gupBswZCeAAwnP1ZrxvBnro=; b=fQmCjzX/JmcHZyfqGQZouonUxhL7WF8lfr1vJ9dNq9/PHcGSEBUmXfe/Ftpdd3FUOfCJ9j ojhsdusYz6JtuFVFC02nUwkjkDBrUjoXFwR8S7QD2wrQGewCAYn1gYYVrPZLTlbzDcD4IQ 58r642WupYDNMoNTPWnuvRo1oWPhumTDeBqOOHuygvbsSnGDGXQxyjqovil4l+HPcKXj/D BxJFDbRe1w3krc9FXNrsuCKWBZUIsq4MoUXfOoWsf9zvK7CgWFkB0Qze9YB2TFNnkPTW7T 3z5O2BIkEqOhafP5IbcyDKzY8qXwqAg9hPiUdRYUuKNNmjTm4PYmOCdV5nDnwQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1702244895; a=rsa-sha256; cv=none; b=Vkn8auB/kJoMbVJN8W9mm+OlLal9hrKF7UZkfCDJoHUNAMXWQXX3Touipy3E2bgTz3jowZ cxgNN8UBnNgZ/eMeJdJ+T/QKNuimslnLolWQbhqIm/ojjGWJI9M8gY4TRDBIbnakM/ZgQd 12f2wmfZhCB1mPp0rDjfvCu5YqZIr6OL3O0/hCxEKeeLcK/z9vBQ3+3fpi3ajbnQ1BlYQi QYZmUrKc0udocb53uWtmUGDnBRTba2/bEgCW22RzFwkKiGwFyy2bVH7OYZ4MCv/JwGQ2eH C5RvsI1AAoxR7Y3NdA1gx43U1IJh9UHYiW7IvzKHrUsc+2w3YkBMmPkF0+LOyQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=DQqvcava; 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"; dmarc=pass (policy=none) header.from=gnu.org 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 8C7113A035 for ; Sun, 10 Dec 2023 22:48:15 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rCReQ-00027N-4D; Sun, 10 Dec 2023 16:47:50 -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 1rCReO-000277-QC for guix-patches@gnu.org; Sun, 10 Dec 2023 16:47:49 -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 1rCReO-0007uc-AJ for guix-patches@gnu.org; Sun, 10 Dec 2023 16:47:48 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rCRec-0006L1-La for guix-patches@gnu.org; Sun, 10 Dec 2023 16:48:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67613] Introduce unit tests for oci-container-service-type. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 10 Dec 2023 21:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67613 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Giacomo Leidi Cc: 67613@debbugs.gnu.org Received: via spool by 67613-submit@debbugs.gnu.org id=B67613.170224485124270 (code B ref 67613); Sun, 10 Dec 2023 21:48:02 +0000 Received: (at 67613) by debbugs.gnu.org; 10 Dec 2023 21:47:31 +0000 Received: from localhost ([127.0.0.1]:51879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCRe6-0006JO-Nr for submit@debbugs.gnu.org; Sun, 10 Dec 2023 16:47:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCRe3-0006JA-Oz for 67613@debbugs.gnu.org; Sun, 10 Dec 2023 16:47:29 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rCRdh-0007M6-NK; Sun, 10 Dec 2023 16:47:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=/MwSfBM5VhpwskLIbe90gupBswZCeAAwnP1ZrxvBnro=; b=DQqvcavaLihGv6Ej4bFR MSfCnT+syKjAWBrLgE56MOo7+tIa8KpO/eGLmUK9sR/pyZMcte6IO3OoJA6iwa+82FlYasrHFGwoA RWF53wJHN1cz/iHPn9nv7/EOcVuoQbTQF5PHb6IJm8eOgU3jytN/R6vcjTDFy0KroNrlJgJ5v7eR3 4S6xLPnoklqW/inShp5xo87V1gOHSKrq7MjJYg8PSMa1U67ReTseNMnFXEXqO82fyRJSkkMwfR32h Xdh9Xyhi61VYciBo/1wyPfFAMJK3Zxb+Gfzd1LlSGeaztChJcguCUFefTyKab3WP0S/NX2CE9duCP IWXe3eEi98kasQ==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <20231203215630.28144-1-goodoldpaul@autistici.org> (Giacomo Leidi's message of "Sun, 3 Dec 2023 22:56:28 +0100") References: <10a8cae4-a5a2-a2e0-fa64-95650ae2e703@autistici.org> <20231203215630.28144-1-goodoldpaul@autistici.org> Date: Sun, 10 Dec 2023 22:47:01 +0100 Message-ID: <87lea13f3e.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-Spam-Score: -2.11 X-Spam-Score: -2.11 X-Migadu-Queue-Id: 8C7113A035 X-Migadu-Scanner: mx11.migadu.com X-TUID: TtxpXknOv++e Hello, Giacomo Leidi skribis: > This patch is a followup to issue #66160 and issue #67574. It introduces > unit tests for the oci-container-service-type. 8 out 11 tests depend on > issue #67574 being merged since issue #66160 was merged with a blocking > bug from the beginning. > > * gnu/services/docker.scm: Export > oci-container-configuration-container-user and > oci-container-configuration-workdir. > * tests/services/docker.scm: New file. > * Makefile.am (SCM_TESTS): Register it. > > Change-Id: I47ed0fe36060ba84dd50b548a66f36e3df8a3710 Thanks for working on this! To me, what=E2=80=99s really helpful is a system test: a test that spins up= a VM running an OCI service and makes sure said service is functional. Apologies if I wasn=E2=80=99t clear! Unit tests can be interesting too, but only if their =E2=80=9Cbug-finding performance=E2=80=9D is good. The tests below, for instance, are likely to= be mirroring the implementation too closely to be really able to find bugs: > + (test-equal "environment" > + (list "--env" '(string-append "key" "=3D" "value") > + "--env" '(string-append "environment" "=3D" "variable")) > + (oci-container-configuration->options > + (oci-container-configuration > + (inherit config) > + (environment > + '(("key" . "value") > + ("environment" . "variable")))))) > + > + (test-equal "network" > + (list "--network" "host") > + (oci-container-configuration->options > + (oci-container-configuration > + (inherit config) > + (network "host")))) > + > + (test-equal "container-user" > + (list "--user" "service-account") > + (oci-container-configuration->options > + (oci-container-configuration > + (inherit config) > + (container-user "service-account")))) Thus my suggestion would be to instead focus on a system test, like those in (gnu tests docker). Does that make sense? WDYT? Ludo=E2=80=99.