guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Caching test results separately?


From: Simon Tournier
Subject: Re: Caching test results separately?
Date: Tue, 14 Mar 2023 12:03:56 +0100

Hi,

On Mon, 13 Mar 2023 at 23:21, Josselin Poiret <dev@jpoiret.xyz> wrote:

>> (⇒ keep the test result (boolean) longer than the build result)

[...]

> As it stands it's really not possible, as
>
> 1) testing is part of the build process itself and
> 2) we can't look-up any stateful info like this from the building
> process (of course!)

Indeed, the builder derivation is not the same and so the item is not
the same.

--8<---------------cut here---------------start------------->8---
$ guix build hello --no-grafts
/gnu/store/s5pd3rnzymliafb4la5sca63j86xs0y0-hello-2.12.1

$ guix build hello --no-grafts --without-tests=hello
/gnu/store/0h3d2z53xx2idy6pnqa8k781hlf40zmx-hello-2.12.1
--8<---------------cut here---------------end--------------->8---

Compare,
    /gnu/store/s5y2w04jiydki5wb0zb9189x88v5288s-hello-2.12.1-builder
    /gnu/store/d5asvb7mla28mf93hjrk6fffnx14n8b1-hello-2.12.1-builder
    
               (quote
                ())
               #:out-of-source? #f #:tests? #t 

               (quote
                ())
               #:out-of-source? #f #:tests? #f 



Last, note the self reference,

--8<---------------cut here---------------start------------->8---
$ diff -r --no-dereference             \
      $(guix build hello --no-grafts)  \
      $(guix build hello --no-grafts --without-tests=hello)
Binary files
/gnu/store/s5pd3rnzymliafb4la5sca63j86xs0y0-hello-2.12.1/bin/hello and
/gnu/store/0h3d2z53xx2idy6pnqa8k781hlf40zmx-hello-2.12.1/bin/hello
differ

$ grep s5pd3rnzymliafb4la5sca63j86xs0y0 $(guix build hello 
--no-grafts)/bin/hello
grep: /gnu/store/s5pd3rnzymliafb4la5sca63j86xs0y0-hello-2.12.1/bin/hello: 
binary file matches

$ grep 0h3d2z53xx2idy6pnqa8k781hlf40zmx $(guix build hello --no-grafts 
--without-tests=hello)/bin/hello
grep: /gnu/store/0h3d2z53xx2idy6pnqa8k781hlf40zmx-hello-2.12.1/bin/hello: 
binary file matches
--8<---------------cut here---------------end--------------->8---


> But I would really like for tests to move out of build phases, the
> advantages would be twofold: less build time for a lot of packages, and
> better environment management for tests (we could rely on better
> interaction with other packages, more complicated mocking, use linux
> namespaces to their fullest extent, etc.).  That would require a huge
> change to Guix though, so it's more of a dream than anything concrete.

I agree:

 + it would simplify many things if we were able to run or re-run
   specific phases – Nix does that I guess.
 + it would be huge complex change. :-)

Well, similarly of the ’without-tests’ transformation, maybe we could
imagine another transformation for just run the test suite.  I mean, it
would not solve Arne’s issue but the converse: sometimes a package
requiring many compilation is failing because of one test and debugging
that is for some cases painful.


Cheers,
simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]