From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id ULbPC/COwWK3BgAAbAwnHQ (envelope-from ) for ; Sun, 03 Jul 2022 14:43:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id oBrRCvCOwWLUPQAAG6o9tA (envelope-from ) for ; Sun, 03 Jul 2022 14:43:28 +0200 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 29CDD8D60 for ; Sun, 3 Jul 2022 14:43:26 +0200 (CEST) Received: from localhost ([::1]:35454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7ywf-0005MI-Ao for larch@yhetil.org; Sun, 03 Jul 2022 08:43:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39474) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7ywI-0005Ia-As for guix-patches@gnu.org; Sun, 03 Jul 2022 08:43:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49632) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7ywI-0000kM-26 for guix-patches@gnu.org; Sun, 03 Jul 2022 08:43:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o7ywI-0006NJ-0Q for guix-patches@gnu.org; Sun, 03 Jul 2022 08:43:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56112] [PATCH] gnu: Add java-lambdatest Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 03 Jul 2022 12:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56112 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "Artyom V. Poptsov" Cc: 56112@debbugs.gnu.org Received: via spool by 56112-submit@debbugs.gnu.org id=B56112.165685217424491 (code B ref 56112); Sun, 03 Jul 2022 12:43:01 +0000 Received: (at 56112) by debbugs.gnu.org; 3 Jul 2022 12:42:54 +0000 Received: from localhost ([127.0.0.1]:43529 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7yw9-0006Mw-HT for submit@debbugs.gnu.org; Sun, 03 Jul 2022 08:42:53 -0400 Received: from lepiller.eu ([89.234.186.109]:42728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7yw5-0006Mj-T6 for 56112@debbugs.gnu.org; Sun, 03 Jul 2022 08:42:52 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 5a26c6ac; Sun, 3 Jul 2022 12:42:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=8pN2tlWX6Pi6 cPJWAsYzKql26EIckzovBsHH4o0FSrE=; b=P+MHRAXTD8H+TAlPTlWd4I/kLM3a S5fq0LS+TxHbaAqtwUUW2RVuCLExC5yHT7m3sSp7KVQoPrdjVDByx8QaTt+4vqVc HW1PGKyt/3QXyDGWSEbBPao/M5OOJ99UvMm7u3BL30neCbfM4fbW4gUQcyfW0wY/ xfDtSXICdIam5SNBjPFwbrh8TAg7nAiMS3Gc6tAIlUKmRQ4Ma7RZX8zont5LsBk0 mzx6I0tgysL85APpYZb3jlRHIZvco1V6nlX5Q2PpL7QIOTzSHeKw8VqBaZNAzNYC /BNsikQsJwCGZv6/ejaF6XzO8bz6CBTuDn+/45GaQFt5I/120GpiCwIcSQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id a57459c8 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Sun, 3 Jul 2022 12:42:46 +0000 (UTC) Date: Sun, 3 Jul 2022 14:42:43 +0200 From: Julien Lepiller Message-ID: <20220703144237.211b3833@sybil.lepiller.eu> In-Reply-To: <87r13j3zn1.fsf@gmail.com> References: <87r13j3zn1.fsf@gmail.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1656852207; 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: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=kDs+DyNYR57ghsh2IGgMHiraMI2q1g0RAgsx25gc73k=; b=hv/ydQAuz5M+OznzbeTAu3r3KYJazHPAeKmJwasSo13LNCsZFZhyHXQbC+wIQ7gfD6+BCO QN/NMgBXinXUXLuuEnCCoyn/sQshUzGszlfPVlw6G/yGFHFJBXNogF4XsizKf42h9iXfJ6 Xr6MlmhetHpSOevMbr4Jlf12Z2/7s2BmX+jQl9U2DUDRgNsyHkgrcdurqxk+flwsLbTPLu yGiD/72aJofuPp4IkCxEVOyFiEgD302RmJIRZhg7k6x2Ep7BDRChEjCgr3DxqTXCWS9wnO HmJn2V27lSNjXRdfPuqks38jQNjURhrKOjeVW19HOn3Sbe9lH0J2rvEs8WGC4Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1656852207; a=rsa-sha256; cv=none; b=Nj3nqVhlyQXJ1N29G8MVjeZuSjVPYoCbEaGXL1raF/7Oty3u/78CVv5uR/tiWy0wT6iNkM 6pNeranRch8JQIRqSorB7OF9i7Qfrxu97ppaSEFujYg++DHmd3TKgYaXoSVM8bj6UYGjgG Qg9VL+D8qaDdW7I8ik5ko9XQWg54iQ/SGm0+0oUTZ6iFmgi0uPkHn5NmFR/tDOcHMAL2wX c0AlTyROebVJBFPVw/qVZovA31+/L4ZKtlGTXp5vx3iqai8GmTCaiM7Wj1sRFwXyQoUU9K s5Y282tFcYBbKKKa3akIRXXVC2MAgv2MS+vB4Jkgwrvg0nzyJKb6+T85wYo6LA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=P+MHRAXT; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 6.05 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=P+MHRAXT; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 29CDD8D60 X-Spam-Score: 6.05 X-Migadu-Scanner: scn1.migadu.com X-TUID: lYJx5S7YV1iD Thanks for the patch, and sorry for the late reply. Here are a few remarks: Le Mon, 20 Jun 2022 22:26:10 +0300, "Artyom V. Poptsov" a =C3=A9crit : > From 2eff8e7fc79336f6eb7795fd942daeb07da63f00 Mon Sep 17 00:00:00 2001 > From: "Artyom V. Poptsov" > Date: Mon, 20 Jun 2022 22:06:28 +0300 > Subject: [PATCH] gnu: Add java-lambdatest >=20 > * gnu/packages/java.scm (java-lambdatest): New variable. > * gnu/packages/patches/java-lambdatest-fix.patch: Add to the > repository. that should be "New file." > * gnu/local.mk (dist_patch_DATA): Add 'java-lambdatest-fix.patch'. and here: "Add it." > --- > gnu/local.mk | 1 + > gnu/packages/java.scm | 56 > +++++++++++++++++++ .../patches/java-lambdatest-fix.patch | > 29 ++++++++++ 3 files changed, 86 insertions(+) > create mode 100644 gnu/packages/patches/java-lambdatest-fix.patch >=20 > diff --git a/gnu/local.mk b/gnu/local.mk > index 197c8679eb..2f0a187125 100644 > --- a/gnu/local.mk > +++ b/gnu/local.mk > @@ -1321,6 +1321,7 @@ dist_patch_DATA =3D > \ > %D%/packages/patches/java-commons-collections-fix-java8.patch \ > %D%/packages/patches/java-commons-lang-fix-dependency.patch \ > %D%/packages/patches/java-jeromq-fix-tests.patch \ > + %D%/packages/patches/java-lambdatest-fix.patch \ > %D%/packages/patches/java-openjfx-build-jdk_version.patch \ > %D%/packages/patches/java-powermock-fix-java-files.patch > \ %D%/packages/patches/java-simple-xml-fix-tests.patch > \ diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm > index 7b0507d93c..794ccf22f7 100644 > --- a/gnu/packages/java.scm > +++ b/gnu/packages/java.scm > @@ -14282,3 +14282,59 @@ The following TLA+ tools are available in > this distribution: @item The PlusCal translator. > @end itemize") > (license license:expat)))) > + > +(define-public java-lambdatest > + (package > + (name "java-lambdatest") > + (version "0.7.1") > + (source (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/lefou/LambdaTest") > + (commit version))) When adding a git source, you need to add this from to the origin record: (file-name (git-file-name name version)) This ensures that the source name is correlated with the package. So when you change the version and forget to update the hash, it will fail instead of successfully using the old version's source. > + (patches > + (search-patches "java-lambdatest-fix.patch")) > + (sha256 > + (base32 > + > "172wz2cxrwganx0xwx395z627ph9b20hj8mw21fygq8hwcvmy94m")))) > + (build-system ant-build-system) > + (native-inputs (list openjdk11 java-logback-classic > java-logback-core)) You don't need openjdk11 here. It's already added implicitely by #:jdk below, and openjdk11 contains only the Java runtime, not the compiler. You'd need (list openjdk11 "jdk"). > + (inputs (list java-junit > + java-slf4j-api > + java-testng)) > + (arguments > + `(#:jar-name "lambdatest.jar" > + #:source-dir "src/main" > + #:test-dir "src/test" > + #:jdk ,openjdk11 Using openjdk11 here will create warnings in dependents I think. Are you sure we really need to use it? > + #:phases (modify-phases %standard-phases > + (replace 'check > + (lambda _ > + (invoke "ant" "compile-tests") > + (let ((tests (filter > + (lambda (file-name) > + ;; Remove non-working tests. > + (not (string-contains file-name > + > "RuntimeTest"))) > + (find-files "build" > ".*Test.class"))) This is not very encouraging. We're supposed to build the runtimes, yet we remove all runtime tests? Do you know what's happening and why they are failing? Did you still manage to run tests that use this package? > + (classpath (string-append > + (getenv "CLASSPATH") > + ":build/classes" > + ":build/test-classes"))) > + (catch #t > + (lambda _ > + (invoke "java" > + "-cp" classpath > + "org.testng.TestNG" "-testclass" > + (string-join tests ","))) I think TestNG will use an xml file if you provide it, though I don't see one in the repo. Do you know how upstream runs their tests? > + (lambda (exception c) > + ;; XXX: TestNG exits with exit code 2 > when some > + ;; tests are skipped. Just ignore this. > + (unless (=3D (invoke-error-exit-status c) > 2) > + (throw exception c)) > + #t)))))))) No need to end the phase in #t. > + (home-page "https://github.com/lefou/LambdaTest") > + (synopsis "Functional testing API on top of JUnit and TestNG") > + (description "Lambda-enabled functional testing on top of JUnit > and +TestNG.") Description should contain full sentences. > + (license license:asl2.0))) > diff --git a/gnu/packages/patches/java-lambdatest-fix.patch > b/gnu/packages/patches/java-lambdatest-fix.patch new file mode 100644 > index 0000000000..e04ff0471f > --- /dev/null > +++ b/gnu/packages/patches/java-lambdatest-fix.patch > @@ -0,0 +1,29 @@ > +From 49645c94fc8bdbea342d6f96d46e0405b81b874c Mon Sep 17 00:00:00 > 2001 +From: "Artyom V. Poptsov" > +Date: Sun, 19 Jun 2022 23:11:42 +0300 > +Subject: [PATCH] test: Fix tests > + > +* src/test/java/de/tobiasroeser/lambdatest/AssertTest.java > + (testAssertEqualsInteger): Fix a regex so it will match the actual > test > + output. > + > +--- > + src/test/java/de/tobiasroeser/lambdatest/AssertTest.java | 2 +- > + 1 file changed, 1 insertion(+), 1 deletion(-) > + > +diff --git > a/src/test/java/de/tobiasroeser/lambdatest/AssertTest.java > b/src/test/java/de/tobiasroeser/lambdatest/AssertTest.java +index > fe2db12..5ef5ab3 100644 +--- > a/src/test/java/de/tobiasroeser/lambdatest/AssertTest.java ++++ > b/src/test/java/de/tobiasroeser/lambdatest/AssertTest.java +@@ -51,7 > +51,7 @@ public class AssertTest { > + Assert.assertEquals(0, 0); > + Assert.assertEquals(Integer.valueOf(0), 0); > + Assert.assertEquals(0, Integer.valueOf(0)); > +- intercept(AssertionError.class, "\\QActual 0 is not > equal to 1.\\E", () -> { ++ > intercept(AssertionError.class, "\\QActual false is not equal to > true\\E", () -> { > + Assert.assertEquals(0, 1); > + }); > + intercept(AssertionError.class, "\\QActual 0 is not > equal to 1.\\E", () -> { +--=20 > +2.25.1 > +