Skip to content

Commit

Permalink
8303959: tools/jpackage/share/RuntimePackageTest.java fails with java…
Browse files Browse the repository at this point in the history
….lang.AssertionError missing files

Reviewed-by: almatvee
  • Loading branch information
Alexey Semenyuk committed Sep 29, 2023
1 parent 014c95a commit 5a6aa56
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions test/jdk/tools/jpackage/share/RuntimePackageTest.java
Expand Up @@ -25,7 +25,6 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors;
Expand All @@ -34,6 +33,8 @@
import jdk.jpackage.test.JPackageCommand;
import jdk.jpackage.test.TKit;
import jdk.jpackage.test.Annotations.Test;
import jdk.jpackage.test.Executor;
import jdk.jpackage.test.JavaTool;
import jdk.jpackage.test.LinuxHelper;
import static jdk.jpackage.test.TKit.assertTrue;
import static jdk.jpackage.test.TKit.assertFalse;
Expand Down Expand Up @@ -101,9 +102,25 @@ private static PackageTest init(Set<PackageType> types) {
return new PackageTest()
.forTypes(types)
.addInitializer(cmd -> {
cmd.addArguments("--runtime-image", Optional.ofNullable(
JPackageCommand.DEFAULT_RUNTIME_IMAGE).orElse(Path.of(
System.getProperty("java.home"))));
final Path runtimeImageDir;
if (JPackageCommand.DEFAULT_RUNTIME_IMAGE != null) {
runtimeImageDir = JPackageCommand.DEFAULT_RUNTIME_IMAGE;
} else {
runtimeImageDir = TKit.createTempDirectory("runtime").resolve("data");

new Executor()
.setToolProvider(JavaTool.JLINK)
.dumpOutput()
.addArguments(
"--output", runtimeImageDir.toString(),
"--compress=0",
"--add-modules", "ALL-MODULE-PATH",
"--strip-debug",
"--no-header-files",
"--no-man-pages")
.execute();
}
cmd.addArguments("--runtime-image", runtimeImageDir);
// Remove --input parameter from jpackage command line as we don't
// create input directory in the test and jpackage fails
// if --input references non existant directory.
Expand Down

3 comments on commit 5a6aa56

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on 5a6aa56 Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk21u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 5a6aa56 Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch backport-GoeLin-5a6aa569 in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 5a6aa569 from the openjdk/jdk repository.

The commit being backported was authored by Alexey Semenyuk on 29 Sep 2023 and was reviewed by Alexander Matveev.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u-dev:

$ git fetch https://github.com/openjdk-bots/jdk21u-dev.git backport-GoeLin-5a6aa569:backport-GoeLin-5a6aa569
$ git checkout backport-GoeLin-5a6aa569
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u-dev.git backport-GoeLin-5a6aa569

Please sign in to comment.