From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Rottmann Subject: Re: (not) testing Rust packages?! Date: Wed, 29 Jan 2020 20:01:27 +0100 Message-ID: <87eevixf20.fsf@londo.h.r0tty.org> References: <6e429473-5e4e-503e-fdb8-6e2b65a819f9@riseup.net> <87tv4jxhzn.fsf@londo.h.r0tty.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:37687) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwsam-0003kJ-DS for guix-devel@gnu.org; Wed, 29 Jan 2020 14:01:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iwsal-0001T9-Cc for guix-devel@gnu.org; Wed, 29 Jan 2020 14:01:36 -0500 Received: from ciao.gmane.io ([159.69.161.202]:33772) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iwsal-0001NB-6W for guix-devel@gnu.org; Wed, 29 Jan 2020 14:01:35 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1iwsaj-0000sN-5e for guix-devel@gnu.org; Wed, 29 Jan 2020 20:01:33 +0100 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane-mx.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org John Soo writes: > Hey Andreas, > >> `cargo test` will always build the crate a second time, even if `cargo >> build` already ran. This is due to the config attribute `test` being set >> (similar a to C preprocessor #define), and thus the actual code being >> compiled may be different. > > Just to make sure, does that mean we can safely run tests without > having unwanted store outputs? > I'm a new to Guix, and am not sure what you mean by "safely" and "unwanted store outputs". Running `cargo test` takes the crate source, and the closure of any `dependencies` and `dev-dependencies`, and produces no real artifacts that make sense to put in the store, as far as I can see. The only noteworthy artifact is the stdout/stderr ouput produced, as well as the exit status, but I guess that's not relevant to the store. > I can see that maybe the test compile step might not catch everything > or compile the whole package, but wouldn't you say that some testing > is better than none at all? > Having tests run would be great: it's a service to the Rust ecosystem, and can also help catch issues in packaging, as was already pointed out. How likely catching issues is depends on the testsuite quality of the crate in question, but that's not at all an argument against running tests, of course! >> In addition, `cargo test` will bring in the >> `dev-dependencies`, which can indeed be _much_ more massive than the >> regular `dependencies`. > > Can you provide an example? [...] > This may have come across wrong: I just wanted to point out that it may mean more packaging effort, but it seems Guix is in a good position here already.