From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uBnlEaflg2GbWgAAgWs5BA (envelope-from ) for ; Thu, 04 Nov 2021 14:52:39 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id KJWZDaflg2HKZAAAB5/wlQ (envelope-from ) for ; Thu, 04 Nov 2021 13:52:39 +0000 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 6A3B08224 for ; Thu, 4 Nov 2021 14:52:37 +0100 (CET) Received: from localhost ([::1]:47692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1midAS-0001H7-4V for larch@yhetil.org; Thu, 04 Nov 2021 09:52:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1midAA-0001GK-0q for help-guix@gnu.org; Thu, 04 Nov 2021 09:52:18 -0400 Received: from mail-io1-xd33.google.com ([2607:f8b0:4864:20::d33]:37735) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1midA7-0006NT-HY for help-guix@gnu.org; Thu, 04 Nov 2021 09:52:17 -0400 Received: by mail-io1-xd33.google.com with SMTP id y73so6961306iof.4 for ; Thu, 04 Nov 2021 06:52:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beadling-co-uk.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=epZKAz+GAo2E+mZWrnxI6Lr73mVjRqsFGdx8NjAiSp4=; b=4L39NxBb2luZxMZYiv8Xb2TfUFSEnuIKOgntFj4s070ubAP8QdWm+9Ijezvq8oyUC+ Vs614N5OF0X5fjyLWzoqBSATNaZnuiD7f7tbfpqewuogzsdQpFHlsMxJ0o5Zl2skbD7U SFPNfs/o5RKPBUvXnqAODSn4gxvuPRdMq85jtpEm5413s+NSr+2y35asATS1YjDdJD2j Qr/EeYLbCBIAEIBEAw2u4RgYvpYd4AQtcC6FMqQj3UlDIkAdSKMd46PI0Rp2/C+wNVTB pFOKdvJWEWdGvx8hi05n1hSQqaxq1uSLePerVVDHj5qkETXXus4SFXQyQKxvgEXyv1sK uytg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=epZKAz+GAo2E+mZWrnxI6Lr73mVjRqsFGdx8NjAiSp4=; b=z2xdfogqCb0G987agrHBNJ7+y1WzpMsxZ6jY74C823leSYSgfaG5dr5sDUmjki80vo zA4u/ZArw24IqPrSw5CZT4lbdxgyrahxpMSogJ9bvgVn09xQA0mDhZ/CCotbH7GX7/GO UUBSgLoEtzS2h9ArgT1dU5YJZhWnx9y01Th6zlvYpgbwZNa3VMpYAckwlQFSk/nNPaRm /b0G/PbdY6bI/1wfFI2rlZ0LRz7p0SYIG/Mj9VOJPSgPTzh3dgMEynWbnbx1x/Uh1GkI y8KOePV4mZTg4Y/z1gjtaGZuJrODk6lZ33jkIu7gZzPH2TD82l8MYlv9xnEhvt7zYjPs VH6Q== X-Gm-Message-State: AOAM533rhNKO+7CfITQPk22fyJ7HayA3D1fWMNIKZXfaFyr8rModkstX Bt4rhbojXbRJ8o2Wy8NvR2SnaWFXDVE0Yw1agHQXuw== X-Google-Smtp-Source: ABdhPJyMAGjSK5XvV6WQ2YrNf+MKbPHpCQTS95JA7/i0IRN3ne3c4m53/zZ6xx5CxmMywjJX5sgBDjnA4H0Jcurc84c= X-Received: by 2002:a05:6638:b83:: with SMTP id b3mr3944167jad.28.1636033933506; Thu, 04 Nov 2021 06:52:13 -0700 (PDT) MIME-Version: 1.0 References: <20211026062429.242a504a@riseup.net> <878ryffxj3.fsf@beadling.co.uk> In-Reply-To: <878ryffxj3.fsf@beadling.co.uk> From: Phil Beadling Date: Thu, 4 Nov 2021 13:52:02 +0000 Message-ID: Subject: Re: Getting Unit Test Results Out Of Guix Build To: raingloom Received-SPF: none client-ip=2607:f8b0:4864:20::d33; envelope-from=phil@beadling.co.uk; helo=mail-io1-xd33.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: help-guix Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1636033957; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=zq1xLumtM5kwJYNg2RHgtTNGIcvTA2ebMrh35h0DH9s=; b=JP/xKIOkak8lqKD4AdfVDYjpFrPvcGe4tceeCurUAx1CaETfdU2ORaBBj+R+uIkPZvapPk hVXpIaUt/M9/19LqiJbEaq3Uo6CLq4Hp3asXm+ha7D0eAsluhWvwPyLzdmq1z5fqLBSdb4 FgzDCUwP4m4KQ+iVBh1XbuL3zBqR1I9/7/5DvuCseuu+oiz8j+lx7hNyrfHyV9vs75VQ39 G3SRkYt0JhT4Jjime2s9WxTWYN3o9aIKMFYn+ldS0NqdeWYYPjEG+ofsigJBd1tHxkow0B byiXBZj3jift2hCaWOeEAxDhVHnj4DM0VX5NrRpl0CHNbA+GxTERJ2oqnfbRYw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636033957; a=rsa-sha256; cv=none; b=eWu80/RL0IP3kW8OvToZlC3n9qwBSKbpBZfI8+aUBib3bB24TGyQHHpRoSf1qDiUG/obkv tLmy2i0NrJsyr8B1oRY+zNWK1LZdbi/xxllYaFzKzZ9g8FeY82aKY6FM3+ylwKXvkKc3cb ey4hpW5uGPXO4H9XUyW+yfylynnPwmwmFYyjv5GR/Z88ohUj7WrzU9ixy/2iFgLuDRNIUH OehbVanwhkMNrAG8rdzn2inKFte3f3Gmu/JD8EF0Bn6FTu9/lSPCMQl2giNCtxTOQTBapn YHJz9lIjac4IYwW/txxffb1bA17PrBL6mlbSgpR5NxwZX+n1yWk50eHzpIiypg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=beadling-co-uk.20210112.gappssmtp.com header.s=20210112 header.b=4L39NxBb; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: 0.08 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=beadling-co-uk.20210112.gappssmtp.com header.s=20210112 header.b=4L39NxBb; dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 6A3B08224 X-Spam-Score: 0.08 X-Migadu-Scanner: scn0.migadu.com X-TUID: ncRpme6t9HwP Hi, On Tue, 26 Oct 2021 at 19:31, Phil wrote: > Hi, > > raingloom writes: > > > > Couldn't this just be another package output? Maybe not the most elegant > > solution, since those are not usually used this way, but it can sort of > > work. Just add a phase that copies the logs to the "tests" output if > > it exists. Kinda like how the "debug" is currently used. > > Yes this could work - so for my-package I could just define > my-package:tests which would add an extra test directory to the package > in the store which I would copy the test results into. > > I gave this a got it almost working with one significant snag I was hoping someone might be able to help with? Once the build is complete is possible to retrieve the location of the test files using a simple REPL script - In my example this is nested in Groovy script in my case which will interpolate the ${packageExpression} for me to give a proper Scheme expression (this isn't important just mentioning it so the script makes sense): *(use-modules (guix packages) (gnu packages) (guix store) (guix derivations))(define my-drv (with-store store (run-with-store store (package->derivation ${packageExpression}))))(format #t "~a~%" (assoc-ref (derivation->output-paths my-drv) "test"))* The below details are no overly important (IMHO), but script is fed into a Groovy variable called testLocationSCript, and called from shell script like so (localCannelSwitch is just a "-L /path/to/my/local/channel" variable): TESTDIR=`guix repl ${localChannelSwitch} -- <(cat <<< '${testLocationScript}')` This all works great *until* you actually have a unit test failure - then because that unit test failure will fail the "guix build", the "package->derivation" command seems to try to rebuild the package, which of course fails again for exactly the same reason.as the original failure and provides no location for derivation->output-paths. *So what I need is a way of asking what will the output path be, without actually building, or inspite of a build failure?* This must be techincally possible because mid-build the output paths are available - so they are known ahead of build completion. So, does anyone have a way of getting the output directories from Guix without first requiring a successful build? Thanks!