From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:48405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT64d-0006DE-QB for guix-patches@gnu.org; Tue, 21 May 2019 10:49:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hT64c-00053R-Lv for guix-patches@gnu.org; Tue, 21 May 2019 10:49:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55229) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hT64c-00053C-IS for guix-patches@gnu.org; Tue, 21 May 2019 10:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hT64c-0005u1-Fn for guix-patches@gnu.org; Tue, 21 May 2019 10:49:02 -0400 Subject: [bug#35812] [PATCH] fix hackage cabal tests Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: Date: Tue, 21 May 2019 16:48:34 +0200 In-Reply-To: (Robert Vollmert's message of "Mon, 20 May 2019 21:06:59 +0200") Message-ID: <874l5n2799.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Robert Vollmert Cc: 35812@debbugs.gnu.org Hello Robert, Robert Vollmert skribis: > Hackage cabal tests didn=E2=80=99t run independently due to memoization, > and test-cabal-6 was failing. I don=E2=80=99t think memoization can get in the way here: the argument lis= t is used as a key in the memoization hash table. Thus, if you pass different arguments, you get a cache miss and call the underlying procedure. Or am I missing something? > From 8b6dac85a9f6c4e851c1a75a4958dff7915fb2f1 Mon Sep 17 00:00:00 2001 > From: Robert Vollmert > Date: Fri, 17 May 2019 10:48:42 +0200 > Subject: [PATCH] tests: fix cabal tests to test and pass > > * guix/import/hackage.scm: export unmemoized import function > * tests/hackage.scm: use unmemoized import function to make tests indepen= dent > * tests/hackage.scm: fix failing test-cabal-6 by providing expected output [...] > (test-assert "hackage->guix-package test 6" > - (eval-test-with-cabal test-cabal-6 > - #:cabal-environment '(("impl" . "ghc-7.8")))) > + (mock > + ((guix import hackage) hackage-fetch > + (lambda (name-version) > + (call-with-input-string test-cabal-6 > + read-cabal))) > + (match (hackage->guix-package-impl "foo") > + (('package > + ('name "ghc-foo") > + ('version "1.0.0") > + ('source > + ('origin > + ('method 'url-fetch) > + ('uri ('string-append > + "https://hackage.haskell.org/package/foo/foo-" > + 'version > + ".tar.gz")) > + ('sha256 > + ('base32 > + (? string? hash))))) > + ('build-system 'haskell-build-system) > + ('inputs > + ('quasiquote > + (("ghc-b" ('unquote 'ghc-b)) > + ("ghc-http" ('unquote 'ghc-http)) > + ("ghc-mtl" ('unquote 'ghc-mtl))))) > + ('native-inputs > + ('quasiquote > + (("ghc-haskell-gi" ('unquote 'ghc-haskell-gi))))) > + ('home-page "http://test.org") > + ('synopsis (? string?)) > + ('description (? string?)) > + ('license 'bsd-3)) > + #t) > + (x > + (pk 'fail x #f))))) So this test needed to be changed as a result of turning off memoization? Thanks, Ludo=E2=80=99.