[PATCH core-updates] gnu: java-ops4j-pax-tinybundles: Disable failing test.

  • Done
  • quality assurance status badge
Details
4 participants
  • Gábor Boskovits
  • Chris Marusich
  • Danny Milosavljevic
  • julien lepiller
Owner
unassigned
Submitted by
Gábor Boskovits
Severity
normal
G
G
Gábor Boskovits wrote on 10 Jan 2018 10:33
(address . guix-patches@gnu.org)(name . Gábor Boskovits)(address . boskovits@gmail.com)
20180110093308.5581-1-boskovits@gmail.com
* gnu/packages/java.scm (java-ops4j-pax-tinybundles)[arguments]: Modify #:test-exclude
to disable all bnd tests.

The bnd testsuite hardcodes the version of bnd, making it impossible to update bnd
independently. Disable it to avoid test failures on bnd updates.
---
gnu/packages/java.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (16 lines)
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index e1e9093df..3e32eb882 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -6054,7 +6054,8 @@ it manages project dependencies, gives diffs jars, and much more.")
#:source-dir "src/main/java"
#:test-exclude
;; Abstract base classes for other tests
- (list "**/BndTest.java" "**/CoreTest.java")
+ ;; Disable bnd tests, they hardcode the version of bnd.
+ (list "**/Bnd*Test.java" "**/CoreTest.java")
#:phases
(modify-phases %standard-phases
(add-before 'check 'fix-version
--
2.15.1
J
J
julien lepiller wrote on 10 Jan 2018 11:33
(address . guix-patches@gnu.org)
7645e6285dffa5c28d8e90b487ab336e@lepiller.eu
Le 2018-01-10 10:33, Gábor Boskovits a écrit :
Toggle quote (27 lines)
> * gnu/packages/java.scm (java-ops4j-pax-tinybundles)[arguments]:
> Modify #:test-exclude
> to disable all bnd tests.
>
> The bnd testsuite hardcodes the version of bnd, making it impossible
> to update bnd
> independently. Disable it to avoid test failures on bnd updates.
> ---
> gnu/packages/java.scm | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
> index e1e9093df..3e32eb882 100644
> --- a/gnu/packages/java.scm
> +++ b/gnu/packages/java.scm
> @@ -6054,7 +6054,8 @@ it manages project dependencies, gives diffs
> jars, and much more.")
> #:source-dir "src/main/java"
> #:test-exclude
> ;; Abstract base classes for other tests
> - (list "**/BndTest.java" "**/CoreTest.java")
> + ;; Disable bnd tests, they hardcode the version of bnd.
> + (list "**/Bnd*Test.java" "**/CoreTest.java")
> #:phases
> (modify-phases %standard-phases
> (add-before 'check 'fix-version

Couldn't we use substitute* to replace the hardcoded version with our
own version of bnd?
G
G
Gábor Boskovits wrote on 20 Jan 2018 23:10
Replace the version in the test
CAE4v=ph0H_OgzSFXBGSbB=RfRpvvWaCjhj4ODNstbM+LoEX2uQ@mail.gmail.com
Hello!

Unfortunately I did not get the previous message on this bug.
I will have a look into this if we can use substitute* to replace the
version.

I will send my findings and an update patch, if possible.
Attachment: file
G
G
Gábor Boskovits wrote on 29 Jan 2018 10:05
Help wanted
CAE4v=piz87_1+LD6zxkmP4O2o--bvaZSt1HzUyaVC3DGGyjtLg@mail.gmail.com
Hello Chris!

Could you help me out on this?

It seems that I should somehow extract the version string from the input to
use in substitute*, to fix the version string in tests. What would be the
proper way of doing this?
Attachment: file
C
C
Chris Marusich wrote on 29 Jan 2018 10:22
(name . Gábor Boskovits)(address . boskovits@gmail.com)(address . 30062@debbugs.gnu.org)
87607lnhom.fsf@gmail.com
Gábor Boskovits <boskovits@gmail.com> writes:

Toggle quote (8 lines)
> Hello Chris!
>
> Could you help me out on this?
>
> It seems that I should somehow extract the version string from the input to
> use in substitute*, to fix the version string in tests. What would be the
> proper way of doing this?

It looks like the existing code is already substituting the version
string (by hard-coding it):

Toggle snippet (17 lines)
(arguments
`(#:jar-name "java-ops4j-pax-tinybundles.jar"
#:source-dir "src/main/java"
#:test-exclude
;; Abstract base classes for other tests
(list "**/BndTest.java" "**/CoreTest.java")
#:phases
(modify-phases %standard-phases
(add-before 'check 'fix-version
(lambda _
;; This test has a reference to an old version of bndlib we are not
;; packaging. It uses the version referenced in pom.xml. We replace
;; it with our own version.
(substitute* "src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
(("2.4.0.201411031534") "3.4.0")))))))

I think we could probably just make a change like the following (I
haven't tested this, though):

Toggle snippet (5 lines)
(substitute* "src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
- (("2.4.0.201411031534") "3.4.0")))))))
+ (("2.4.0.201411031534") ,(package-version java-aqute-bndlib))))))))

The comma is 'unquote' (see: (guile) Expression Syntax), which should
insert the package version of java-aqute-bndlib into the quasi-quoted
list.

Does that help?

--
Chris
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAlpu57kACgkQ3UCaFdgi
Rp382xAAsaEpgZHIPLwspTyY3A4iEYoZWhM9wtzHswRQbQbEfLCktE7dFFkvRAhc
GNgAgWZ73Otac1WoH2tSv6RhmHN3xykgQ5492aPZ7+4piJfcLp071sXF46EKie+t
lEDJ+X4fdO9QiZAezdI4Aop3MUVaQHoJ6k3ZxA4eZ+dIeuCPGUltHaPuFMQZNBXJ
7mYqQoqEffXtK8pA+OVQ5d0/omWkA+mPmJTSvA1pcmqhbp6cFK51dtNfQg9azmfP
p4butguaA1KTU5bJJqPAhm103EaLrxkD5Zk3kZCg7LcIpZjQgGeSXkx1uw5JUNSR
A8ABHjNJ9TwiM/doMLtaaxQ2C3zojjIB/7iz8TVwzTmZMsOk5oWTenptD+nVCIzN
pdAGoTe6vJE1C8RZPGOQKSoZDNpiFc5Ak/1y9+OxBRmCYcH2mh2OC9ziPnm1vX3n
K7gyGAdoHZnJq0HnZfNeRFhlBxmuAvHYTwXnxSjrjbdx/c6eU5LWxHPAiILen5ju
KnWomnZxg/XuEGH+0iu/xTWAlDmNSZLWd9VEzgsIrUviFq+9/Ol4XVJZLFFn0j7u
4YmnxFpMNv09h6DWO77IThelcnmkFlCCL3+ETOc7LDE28dcil8eZYuS8sDH+rYUQ
AMWcm62hwFmAV71k6xCWq+V30skS9XJVPKMjJPXJLILiU9sUcHM=
=eV9N
-----END PGP SIGNATURE-----

G
G
Gábor Boskovits wrote on 29 Jan 2018 10:55
(name . Chris Marusich)(address . cmmarusich@gmail.com)(address . 30062@debbugs.gnu.org)
CAE4v=pg43qMg5qnCXf9eT+ymb+xEOVqOZNA=eOKWvR8uVQ5icQ@mail.gmail.com
2018-01-29 10:22 GMT+01:00 Chris Marusich <cmmarusich@gmail.com>:

Toggle quote (53 lines)
> Gábor Boskovits <boskovits@gmail.com> writes:
>
> > Hello Chris!
> >
> > Could you help me out on this?
> >
> > It seems that I should somehow extract the version string from the input
> to
> > use in substitute*, to fix the version string in tests. What would be the
> > proper way of doing this?
>
> It looks like the existing code is already substituting the version
> string (by hard-coding it):
>
> --8<---------------cut here---------------start------------->8---
> (arguments
> `(#:jar-name "java-ops4j-pax-tinybundles.jar"
> #:source-dir "src/main/java"
> #:test-exclude
> ;; Abstract base classes for other tests
> (list "**/BndTest.java" "**/CoreTest.java")
> #:phases
> (modify-phases %standard-phases
> (add-before 'check 'fix-version
> (lambda _
> ;; This test has a reference to an old version of bndlib we
> are not
> ;; packaging. It uses the version referenced in pom.xml. We
> replace
> ;; it with our own version.
> (substitute* "src/test/java/org/ops4j/pax/
> tinybundles/bnd/BndTest.java"
> (("2.4.0.201411031534") "3.4.0")))))))
> --8<---------------cut here---------------end--------------->8---
>
> I think we could probably just make a change like the following (I
> haven't tested this, though):
>
> --8<---------------cut here---------------start------------->8---
> (substitute* "src/test/java/org/ops4j/pax/
> tinybundles/bnd/BndTest.java"
> - (("2.4.0.201411031534") "3.4.0")))))))
> + (("2.4.0.201411031534") ,(package-version
> java-aqute-bndlib))))))))
> --8<---------------cut here---------------end--------------->8---
>
> The comma is 'unquote' (see: (guile) Expression Syntax), which should
> insert the package version of java-aqute-bndlib into the quasi-quoted
> list.
>
> Does that help?
>
> Yes, thanks. This has the piece of information I was missing.
I would also like to replace the matching expression to be something less
specific, because
it would be nice, if upon upgrade we could just flip the version and the
hash.
I will try to get this done by wednesday.


Toggle quote (3 lines)
> --
> Chris
>
Attachment: file
D
D
Danny Milosavljevic wrote on 29 Jan 2018 11:08
(name . Gábor Boskovits)(address . boskovits@gmail.com)
20180129110808.52694b33@scratchpost.org
Hi Gabor,

I've checked the source code of org.ops4j.pax.tinybundles-tinybundles-2.1.1

~/x/org.ops4j.pax.tinybundles-tinybundles-2.1.1$ grep -r 2.4.0.2014 .
./src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java: assertEquals( "Header Tool", "Bnd-2.4.0.201411031534", man.getMainAttributes().getValue( "Tool" ) );

So the substitution could also be

(substitute* "src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
(("2\\.4\\.0\\.[0-9][0-9]*")
,(package-version java-aqute-bndlib)))

Or maybe even

(substitute* "src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
(("[0-9][0-9]*\\.[0-9][0-9]*.[0-9][0-9]*\\.[0-9][0-9]*")
,(package-version java-aqute-bndlib)))
G
G
Gábor Boskovits wrote on 3 Mar 2018 22:59
[PATCH] gnu: java-ops4j-pax-tinybundles: Use distribution bndlib version.
(address . 30062@debbugs.gnu.org)(name . Gábor Boskovits)(address . boskovits@gmail.com)
20180303215905.12232-1-boskovits@gmail.com
* gnu/packages/java.scm (java-ops4j-pax-tinybundles)[arguments](#phases):
Modify fix-version to use the distibution version of java-aqute-bndlib.
---
gnu/packages/java.scm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (16 lines)
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 0f8c04e8b..cdf4cba82 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -6537,7 +6537,8 @@ it manages project dependencies, gives diffs jars, and much more.")
;; packaging. It uses the version referenced in pom.xml. We replace
;; it with our own version.
(substitute* "src/test/java/org/ops4j/pax/tinybundles/bnd/BndTest.java"
- (("2.4.0.201411031534") "3.4.0")))))))
+ (("[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*")
+ ,(package-version java-aqute-bndlib))))))))
(inputs
`(("lang" ,java-ops4j-base-lang)
("io" ,java-ops4j-base-io)
--
2.16.2
G
G
Gábor Boskovits wrote on 3 Mar 2018 23:13
Unblocks #29893
(address . 30062@debbugs.gnu.org)
CAE4v=pihCgPJQxNX-vnwXJbOnhVzQvWvABCq0aiiReViBgFz4w@mail.gmail.com
Once this is merged please also merge #29893.
Attachment: file
G
G
Gábor Boskovits wrote on 4 Mar 2018 10:02
Please push this to master
(address . 30062@debbugs.gnu.org)
CAE4v=phrexu5kGrTyL_EKCALD50wZgB7EUbaXX+RJey_h-7hkA@mail.gmail.com
The original tag says this is a core-updates patch, but since then
core-updates has been merged, so please push this to master.
Attachment: file
D
D
Danny Milosavljevic wrote on 5 Mar 2018 20:47
(no subject)
(address . control@debbugs.gnu.org)
20180305204708.6586a3dc@scratchpost.org
close 30062
?