From: Phil Beadling <phil@beadling.co.uk>
To: raingloom <raingloom@riseup.net>
Cc: help-guix <help-guix@gnu.org>
Subject: Re: Getting Unit Test Results Out Of Guix Build
Date: Thu, 4 Nov 2021 13:52:02 +0000 [thread overview]
Message-ID: <CAOvsyQvHJeSqUGavj1PfUPAGHOJG-mHxeGpFkF9e7WBrKfLU=Q@mail.gmail.com> (raw)
In-Reply-To: <878ryffxj3.fsf@beadling.co.uk>
Hi,
On Tue, 26 Oct 2021 at 19:31, Phil <phil@beadling.co.uk> 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!
next prev parent reply other threads:[~2021-11-04 13:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-25 12:30 Getting Unit Test Results Out Of Guix Build Phil Beadling
2021-10-26 4:24 ` raingloom
2021-10-26 18:31 ` Phil
2021-11-04 13:52 ` Phil Beadling [this message]
2021-11-05 1:15 ` raingloom
2021-11-05 1:53 ` Phil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAOvsyQvHJeSqUGavj1PfUPAGHOJG-mHxeGpFkF9e7WBrKfLU=Q@mail.gmail.com' \
--to=phil@beadling.co.uk \
--cc=help-guix@gnu.org \
--cc=raingloom@riseup.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).