8231972: Build a stable list of jpackager tests for SQE
Submitted-by: asemenyuk
Reviewed-by: aherrick, almatvee
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/tools/jpackage/TEST.properties Wed Oct 23 10:10:34 2019 -0400
@@ -0,0 +1,2 @@
+keys=jpackagePlatformPackage
+requires.properties=jpackage.test.SQETest
Binary file test/jdk/tools/jpackage/helpers/jdk/jpackage/test/.Executor.java.swp has changed
--- a/test/jdk/tools/jpackage/linux/AppCategoryTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/linux/AppCategoryTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -44,6 +44,7 @@
* @test
* @summary jpackage with --linux-app-category
* @library ../helpers
+ * @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @requires (os.family == "linux")
* @modules jdk.jpackage/jdk.jpackage.internal
--- a/test/jdk/tools/jpackage/linux/LicenseTypeTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/linux/LicenseTypeTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -39,6 +39,7 @@
* @test
* @summary jpackage with --linux-rpm-license-type
* @library ../helpers
+ * @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @requires (os.family == "linux")
* @modules jdk.jpackage/jdk.jpackage.internal
--- a/test/jdk/tools/jpackage/linux/LinuxBundleNameTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/linux/LinuxBundleNameTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -44,6 +44,7 @@
* @test
* @summary jpackage with --linux-package-name
* @library ../helpers
+ * @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @requires (os.family == "linux")
* @modules jdk.jpackage/jdk.jpackage.internal
--- a/test/jdk/tools/jpackage/linux/MaintainerTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/linux/MaintainerTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -40,6 +40,7 @@
* @test
* @summary jpackage with --linux-deb-maintainer
* @library ../helpers
+ * @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @requires (os.family == "linux")
* @modules jdk.jpackage/jdk.jpackage.internal
--- a/test/jdk/tools/jpackage/linux/PackageDepsTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/linux/PackageDepsTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -46,6 +46,7 @@
* @test
* @summary jpackage with --linux-package-deps
* @library ../helpers
+ * @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @requires (os.family == "linux")
* @modules jdk.jpackage/jdk.jpackage.internal
--- a/test/jdk/tools/jpackage/linux/ReleaseTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/linux/ReleaseTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -43,6 +43,7 @@
* @test
* @summary jpackage with --linux-app-release
* @library ../helpers
+ * @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @requires (os.family == "linux")
* @modules jdk.jpackage/jdk.jpackage.internal
--- a/test/jdk/tools/jpackage/linux/ShortcutHintTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/linux/ShortcutHintTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -49,6 +49,8 @@
* @test
* @summary jpackage with --linux-shortcut
* @library ../helpers
+ * @key jpackagePlatformPackage
+ * @requires jpackage.test.SQETest == null
* @build jdk.jpackage.test.*
* @requires (os.family == "linux")
* @modules jdk.jpackage/jdk.jpackage.internal
@@ -56,6 +58,21 @@
* @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main
* --jpt-run=ShortcutHintTest
*/
+
+/*
+ * @test
+ * @summary jpackage with --linux-shortcut
+ * @library ../helpers
+ * @key jpackagePlatformPackage
+ * @build jdk.jpackage.test.*
+ * @requires (os.family == "linux")
+ * @requires jpackage.test.SQETest != null
+ * @modules jdk.jpackage/jdk.jpackage.internal
+ * @compile ShortcutHintTest.java
+ * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main
+ * --jpt-run=ShortcutHintTest.testBasic
+ */
+
public class ShortcutHintTest {
@Test
--- a/test/jdk/tools/jpackage/macosx/SigningPackageTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/macosx/SigningPackageTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -39,6 +39,7 @@
* @library ../helpers
* @library /test/lib
* @library base
+ * @key jpackagePlatformPackage
* @build SigningBase
* @build SigningCheck
* @build jtreg.SkippedException
--- a/test/jdk/tools/jpackage/run_tests.sh Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/run_tests.sh Wed Oct 23 10:10:34 2019 -0400
@@ -13,33 +13,31 @@
jtreg_bundle=https://ci.adoptopenjdk.net/view/Dependencies/job/jtreg/lastSuccessfulBuild/artifact/jtreg-4.2.0-tip.tar.gz
workdir=/tmp/jpackage_jtreg_testing
jtreg_jar=$workdir/jtreg/lib/jtreg.jar
+jpackage_test_selector=test/jdk/tools/jpackage
-# Names of shared packaging tests to run
-share_package_test_names="
- FileAssociationsTest
- InstallDirTest
- LicenseTest
- SimplePackageTest
- RuntimePackageTest
- AdditionalLaunchersTest
- AppImagePackageTest
-"
-mapfile -t packaging_tests_share < <(for t in $share_package_test_names; do echo test/jdk/tools/jpackage/share/$t.java; done)
-packaging_tests_windows=test/jdk/tools/jpackage/windows
-packaging_tests_linux=test/jdk/tools/jpackage/linux
-packaging_tests_mac=test/jdk/tools/jpackage/macosx
+
+find_packaging_tests ()
+{
+ (cd "$open_jdk_with_jpackage_jtreg_tests" && \
+ find "$jpackage_test_selector/$1" -type f -name '*.java' \
+ | xargs grep -E -l '@key[[:space:]]+jpackagePlatformPackage')
+}
+
-case "$(uname -s)" in
- Darwin)
- tests=( "$packaging_tests_mac" );;
- Linux)
- tests=( "$packaging_tests_linux" );;
- CYGWIN*|MINGW32*|MSYS*)
- tests=( "$packaging_tests_windows" );;
- *)
- fatal Failed to detect OS type;;
-esac
-tests+=(${packaging_tests_share[@]})
+find_all_packaging_tests ()
+{
+ find_packaging_tests share
+ case "$(uname -s)" in
+ Darwin)
+ find_packaging_tests macosx;;
+ Linux)
+ find_packaging_tests linux;;
+ CYGWIN*|MINGW32*|MSYS*)
+ find_packaging_tests windows;;
+ *)
+ fatal Failed to detect OS type;;
+ esac
+}
help_usage ()
@@ -49,6 +47,7 @@
echo " -h - print this message"
echo " -v - verbose output"
echo " -c - keep jtreg cache"
+ echo " -a - run all, not only SQE tests"
echo " -d - dry run. Print jtreg command line, but don't execute it"
echo " -t <jdk> - path to JDK to be tested [ mandatory ]"
echo " -j <openjdk> - path to local copy of openjdk repo with jpackage jtreg tests"
@@ -71,7 +70,7 @@
echo ' - `verify-uninstall`'
echo ' Verify packages created with the previous run of the script were uninstalled cleanly.'
echo ' - `print-default-tests`'
- echo ' Print default tests list and exit.'
+ echo ' Print default list of packaging tests and exit.'
}
error ()
@@ -113,17 +112,6 @@
fi
}
-expand_test_selector ()
-{
- if [ -d "$open_jdk_with_jpackage_jtreg_tests/$1" ]; then
- for java in $(find "$open_jdk_with_jpackage_jtreg_tests/$1" -maxdepth 1 -name '*.java'); do
- ! grep -q '@test' "$java" || echo "$1/$(basename "$java")"
- done
- else
- echo "$1"
- fi
-}
-
# Path to JDK to be tested.
test_jdk=
@@ -145,12 +133,18 @@
# Mode in which to run jtreg tests
mode=update
-# JVM extra arguments
-declare -a vm_args
+# jtreg extra arguments
+declare -a jtreg_args
-while getopts "vhdct:j:o:r:m:l:" argname; do
+# Run all tests
+run_all_tests=
+
+mapfile -t tests < <(find_all_packaging_tests)
+
+while getopts "vahdct:j:o:r:m:l:" argname; do
case "$argname" in
v) verbose=yes;;
+ a) run_all_tests=yes;;
d) dry_run=yes;;
c) keep_jtreg_cache=yes;;
t) test_jdk="$OPTARG";;
@@ -172,7 +166,7 @@
fi
if [ "$mode" = "print-default-tests" ]; then
- exec_command for t in ${tests[@]}";" do expand_test_selector '$t;' done
+ exec_command for t in ${tests[@]}";" do echo '$t;' done
exit
fi
@@ -192,7 +186,7 @@
if [ ! -d "$runtime_dir" ]; then
fatal 'Value of `-r` option is set to non-existing directory'.
fi
- vm_args+=("-Djpackage.test.runtime-image=$(to_native_path "$(cd "$runtime_dir" && pwd)")")
+ jtreg_args+=("-Djpackage.test.runtime-image=$(to_native_path "$(cd "$runtime_dir" && pwd)")")
fi
if [ -n "$logfile" ]; then
@@ -200,7 +194,7 @@
fatal 'Value of `-l` option specified a file in non-existing directory'.
fi
logfile="$(cd "$(dirname "$logfile")" && pwd)/$(basename "$logfile")"
- vm_args+=("-Djpackage.test.logfile=$(to_native_path "$logfile")")
+ jtreg_args+=("-Djpackage.test.logfile=$(to_native_path "$logfile")")
fi
if [ "$mode" = create ]; then
@@ -208,13 +202,16 @@
elif [ "$mode" = update ]; then
true
elif [ "$mode" = verify-install ]; then
- vm_args+=("-Djpackage.test.action=$mode")
+ jtreg_args+=("-Djpackage.test.action=$mode")
elif [ "$mode" = verify-uninstall ]; then
- vm_args+=("-Djpackage.test.action=$mode")
+ jtreg_args+=("-Djpackage.test.action=$mode")
else
fatal_with_help_usage 'Invalid value of -m option:' [$mode]
fi
+if [ -z "$run_all_tests" ]; then
+ jtreg_args+=(-Djpackage.test.SQETest=yes)
+fi
# All remaining command line arguments are tests to run that should override the defaults
[ $# -eq 0 ] || tests=($@)
@@ -252,7 +249,7 @@
local jtreg_cmdline=(\
$JAVA_HOME/bin/java -jar $(to_native_path "$jtreg_jar") \
"-Djpackage.test.output=$(to_native_path "$output_dir")" \
- "${vm_args[@]}" \
+ "${jtreg_args[@]}" \
-nr \
"$jtreg_verbose" \
-retain:all \
--- a/test/jdk/tools/jpackage/share/AdditionalLaunchersTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/share/AdditionalLaunchersTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -45,6 +45,7 @@
/*
* @test
* @summary jpackage with --add-launcher
+ * @key jpackagePlatformPackage
* @library ../helpers
* @build jdk.jpackage.test.*
* @modules jdk.jpackage/jdk.jpackage.internal
--- a/test/jdk/tools/jpackage/share/AppImagePackageTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/share/AppImagePackageTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -36,7 +36,9 @@
/*
* @test
* @summary jpackage with --app-image
+ * @key jpackagePlatformPackage
* @library ../helpers
+ * @requires (jpackage.test.SQETest == null)
* @build jdk.jpackage.test.*
* @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm/timeout=540 -Xmx512m AppImagePackageTest
--- a/test/jdk/tools/jpackage/share/FileAssociationsTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/share/FileAssociationsTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -54,6 +54,7 @@
* @test
* @summary jpackage with --file-associations
* @library ../helpers
+ * @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @modules jdk.jpackage/jdk.jpackage.internal
* @compile FileAssociationsTest.java
--- a/test/jdk/tools/jpackage/share/InstallDirTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/share/InstallDirTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -57,6 +57,7 @@
* @test
* @summary jpackage with --install-dir
* @library ../helpers
+ * @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @compile InstallDirTest.java
* @modules jdk.jpackage/jdk.jpackage.internal
@@ -68,10 +69,12 @@
* @test
* @summary jpackage with --install-dir
* @library ../helpers
+ * @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @compile InstallDirTest.java
* @modules jdk.jpackage/jdk.jpackage.internal
* @requires (os.family == "linux")
+ * @requires (jpackage.test.SQETest == null)
* @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main
* --jpt-run=InstallDirTest.testLinuxInvalid,testLinuxUnsupported
*/
--- a/test/jdk/tools/jpackage/share/LicenseTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/share/LicenseTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -65,6 +65,7 @@
* @test
* @summary jpackage with --license-file
* @library ../helpers
+ * @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @compile LicenseTest.java
* @modules jdk.jpackage/jdk.jpackage.internal
@@ -76,9 +77,11 @@
* @test
* @summary jpackage with --license-file
* @library ../helpers
- * @modules jdk.jpackage/jdk.jpackage.internal
+ * @key jpackagePlatformPackage
* @compile LicenseTest.java
* @requires (os.family == "linux")
+ * @requires (jpackage.test.SQETest == null)
+ * @modules jdk.jpackage/jdk.jpackage.internal
* @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main
* --jpt-run=LicenseTest.testCustomDebianCopyright
* --jpt-run=LicenseTest.testCustomDebianCopyrightSubst
--- a/test/jdk/tools/jpackage/share/RuntimePackageTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/share/RuntimePackageTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -44,6 +44,7 @@
* @test
* @summary jpackage with --runtime-image
* @library ../helpers
+ * @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @comment Temporary disable for Linux and OSX until functionality implemented
* @requires (os.family != "mac")
--- a/test/jdk/tools/jpackage/share/SimplePackageTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/share/SimplePackageTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -42,6 +42,7 @@
* @test
* @summary Simple jpackage command run
* @library ../helpers
+ * @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @modules jdk.jpackage/jdk.jpackage.internal
* @compile SimplePackageTest.java
--- a/test/jdk/tools/jpackage/windows/WinDirChooserTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/windows/WinDirChooserTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -37,6 +37,7 @@
* @test
* @summary jpackage with --win-dir-chooser
* @library ../helpers
+ * @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @requires (os.family == "windows")
* @modules jdk.jpackage/jdk.jpackage.internal
--- a/test/jdk/tools/jpackage/windows/WinMenuGroupTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/windows/WinMenuGroupTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -40,6 +40,7 @@
* @test
* @summary jpackage with --win-menu and --win-menu-group
* @library ../helpers
+ * @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @requires (os.family == "windows")
* @modules jdk.jpackage/jdk.jpackage.internal
--- a/test/jdk/tools/jpackage/windows/WinMenuTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/windows/WinMenuTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -37,6 +37,7 @@
* @test
* @summary jpackage with --win-menu
* @library ../helpers
+ * @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @requires (os.family == "windows")
* @modules jdk.jpackage/jdk.jpackage.internal
--- a/test/jdk/tools/jpackage/windows/WinPerUserInstallTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/windows/WinPerUserInstallTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -39,6 +39,7 @@
* @test
* @summary jpackage with --win-per-user-install, --win-menu, --win-menu-group
* @library ../helpers
+ * @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @requires (os.family == "windows")
* @modules jdk.jpackage/jdk.jpackage.internal
--- a/test/jdk/tools/jpackage/windows/WinShortcutTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/windows/WinShortcutTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -38,6 +38,7 @@
* @test
* @summary jpackage with --win-shortcut
* @library ../helpers
+ * @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @requires (os.family == "windows")
* @modules jdk.jpackage/jdk.jpackage.internal
--- a/test/jdk/tools/jpackage/windows/WinUpgradeUUIDTest.java Fri Oct 18 14:14:37 2019 -0400
+++ b/test/jdk/tools/jpackage/windows/WinUpgradeUUIDTest.java Wed Oct 23 10:10:34 2019 -0400
@@ -40,6 +40,7 @@
* @test
* @summary jpackage with --win-upgrade-uuid and --app-version
* @library ../helpers
+ * @key jpackagePlatformPackage
* @build jdk.jpackage.test.*
* @requires (os.family == "windows")
* @modules jdk.jpackage/jdk.jpackage.internal