← Back to team overview

openjdk team mailing list archive

[Merge] ~tdaitx/ubuntu/+source/openjdk:openjdk-11-minimum-jtreg-version into ~openjdk/ubuntu/+source/openjdk/+git/openjdk:openjdk-11

 

Tiago Stürmer Daitx has proposed merging ~tdaitx/ubuntu/+source/openjdk:openjdk-11-minimum-jtreg-version into ~openjdk/ubuntu/+source/openjdk/+git/openjdk:openjdk-11.

Commit message:
Set and verify that minimum jtreg versions is being used
    
Set minimum dependency on jtreg based on testsuite requirements and fail
during pre-build if installed jtreg version is lower then that.

Requested reviews:
  Matthias Klose (doko)

For more details, see:
https://code.launchpad.net/~tdaitx/ubuntu/+source/openjdk/+git/openjdk/+merge/371609

Instead of hardcoding the minimum jtreg version in debian/rules, this change look at the required jtreg version inside TEST.ROOT files, picks the newest one (testsuites might require different minimum versions) and uses that for generating the debian/control file.

It also adds a check in pre-build so that the build will fail when the installed jtreg cannot satisfy the minimum required version - this covers the corner case where the user tries to build without regenerating a control file when a TEST.ROOT file has been updated to require a newer jtreg version.

This changes reduces the amount of manual maintenance and checks required by the maintainer and prevents builds from continuing when upstream updates its jtreg version requirements and the installed one is too old.
-- 
Your team OpenJDK is subscribed to branch ~openjdk/ubuntu/+source/openjdk/+git/openjdk:openjdk-11.
diff --git a/debian/changelog b/debian/changelog
index 61e525c..bbd41c7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,9 @@ openjdk-11 (11.0.4+11-2) UNRELEASED; urgency=medium
 
   [ Tiago Stürmer Daitx ]
   * Properly generate Breaks: rules for bionic (fix typo).
+  * Set minimum dependency on jtreg based on testsuite requirements.
+  * Fail during pre-build if installed jtreg version is lower then
+    the minimum required version.
 
  -- Matthias Klose <doko@xxxxxxxxxx>  Wed, 17 Jul 2019 14:49:36 +0200
 
diff --git a/debian/control b/debian/control
index 302cb36..32e46e8 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Uploaders: Matthias Klose <doko@xxxxxxxxxx>
 Build-Depends: debhelper (>= 11),
   m4, lsb-release, zip, unzip,
   sharutils, gawk, cpio, pkg-config, procps, wdiff, time, fastjar (>= 2:0.96-0ubuntu2),
-  jtreg (>= 4.2-b12-1~) <!nocheck>, testng <!nocheck>, xvfb <!nocheck>, xauth <!nocheck>, xfonts-base <!nocheck>, libgl1-mesa-dri [!x32] <!nocheck>, xfwm4 <!nocheck>, x11-xkb-utils <!nocheck>, dbus-x11 <!nocheck>,
+  jtreg (>= 4.2-b12-0~) <!nocheck>, testng <!nocheck>, xvfb <!nocheck>, xauth <!nocheck>, xfonts-base <!nocheck>, libgl1-mesa-dri [!x32] <!nocheck>, xfwm4 <!nocheck>, x11-xkb-utils <!nocheck>, dbus-x11 <!nocheck>,
   autoconf, automake, autotools-dev, ant, ant-optional,
   g++-8 <!cross>,
   openjdk-11-jdk-headless:native | openjdk-10-jdk-headless:native,
diff --git a/debian/rules b/debian/rules
index 0966d64..c7b3c39 100755
--- a/debian/rules
+++ b/debian/rules
@@ -612,8 +612,11 @@ ifeq (,$(filter $(distrel),precise))
   nocheck_profile = $(EMPTY) <!nocheck>
 endif
 
+# look at all TEST.ROOT for the required jtreg version, sorted by newest
+min_jtreg_version := $(shell find test/ -name TEST.ROOT -exec grep -hr "^requiredVersion=" {} \; | sed -e 's:^requiredVersion=::' -e 's:$$:-0~:' | sort -uVr | head -n1 | tr ' ' '-')
+
 bd_check = \
-  jtreg (>= 4.2-b12-1~)$(nocheck_profile), testng$(nocheck_profile), \
+  jtreg (>= $(min_jtreg_version))$(nocheck_profile), testng$(nocheck_profile), \
   xvfb$(nocheck_profile), xauth$(nocheck_profile), \
   xfonts-base$(nocheck_profile), libgl1-mesa-dri [!x32]$(nocheck_profile), \
   xfwm4$(nocheck_profile), x11-xkb-utils$(nocheck_profile), \
@@ -772,7 +775,7 @@ control_vars += '-Vjcommon:Depends=$(pkg_jcommon)'
 
 control_vars += '-Vjrehl:Breaks=$(jrehl_breaks)'
 
-debian/control: debian/control.in debian/rules
+debian/control: debian/control.in debian/tests/control debian/rules
 	@cp -p debian/control debian/control.old
 	sed \
 	      -e 's/@basename@/$(basename)/g' \
@@ -807,6 +810,11 @@ debian/control: debian/control.in debian/rules
 	  exit 1; \
 	fi
 
+debian/tests/control: debian/tests/control.in debian/rules
+	sed \
+		-e 's/@min_jtreg_version@/$(min_jtreg_version)/g' \
+		$< > $@;
+
 debian/tests/%.sh: debian/tests/%.in debian/rules
 	sed \
 		-e 's,@JDK_TO_TEST@,/$(basedir),g' \
@@ -947,6 +955,12 @@ build_stamps = \
 build_stamps +=  stamps/jtreg-check-default
 
 pre-build:
+	jtreg_version="$$(dpkg-query -f '$${Version}\n' -W jtreg)"; \
+	if ! dpkg --compare-versions $(min_jtreg_version) le $$jtreg_version; then \
+	  echo "Error: testsuite requires jtreg $(min_jtreg_version) but $$jtreg_version is installed"; \
+	  echo "Please update the jtreg dependency and regenerate debian/control"; \
+	  false; \
+	fi
 ifneq (,$(filter $(DEB_HOST_ARCH),s390))
 	@echo explicitely fail the build for $(DEB_HOST_ARCH), patches not updated
 #else ifneq (,$(filter $(DEB_HOST_ARCH),armel))
diff --git a/debian/tests/control b/debian/tests/control
index b6bd332..879d6e5 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -3,5 +3,5 @@ Depends: @, jtreg, testng, gcc
 Restrictions: allow-stderr, skippable
 
 Tests: jdk
-Depends: @, jtreg (>= 4.2-b12-1~), testng, gcc, xfwm4, xvfb, dbus-x11
+Depends: @, jtreg (>= 4.2-b12-0~), testng, gcc, xfwm4, xvfb, dbus-x11
 Restrictions: allow-stderr, skippable
diff --git a/debian/tests/control.in b/debian/tests/control.in
new file mode 100644
index 0000000..ee7c9ed
--- /dev/null
+++ b/debian/tests/control.in
@@ -0,0 +1,7 @@
+Tests: hotspot, jaxp, langtools
+Depends: @, jtreg, testng, gcc
+Restrictions: allow-stderr, skippable
+
+Tests: jdk
+Depends: @, jtreg (>= @min_jtreg_version@), testng, gcc, xfwm4, xvfb, dbus-x11
+Restrictions: allow-stderr, skippable

Follow ups