From eb1a52ad99cac877116ae7f8970d000c4a79e0ff Mon Sep 17 00:00:00 2001 From: Loic Ottet Date: Mon, 30 Sep 2024 14:23:15 +0200 Subject: [PATCH] Test --- .github/workflows/reachability-metadata.yml | 12 +++++++++++- .../src/com/oracle/svm/hosted/ProgressReporter.java | 4 ++-- .../com/oracle/svm/util/ImageBuildStatistics.java | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reachability-metadata.yml b/.github/workflows/reachability-metadata.yml index b19d621f51035..2ad919a2af7c0 100644 --- a/.github/workflows/reachability-metadata.yml +++ b/.github/workflows/reachability-metadata.yml @@ -96,6 +96,8 @@ jobs: test-all-metadata: name: ${{ matrix.coordinates }} runs-on: ubuntu-latest + outputs: + build_stats: ${{ steps.run.outputs.build_stats }} env: GRAALVM_HOME: ${{ github.workspace }}/graalvm # identical to the one in ./.github/actions/build-graalvm timeout-minutes: 20 @@ -134,6 +136,14 @@ jobs: sudo systemctl daemon-reload sudo systemctl restart docker - name: "Run '${{ matrix.coordinates }}' tests" + id: run run: | ./gradlew test -Pcoordinates=${{ matrix.coordinates }} - \ No newline at end of file + echo "build_stats=$PWD/reports/image_build_statistics.json" >> "$GITHUB_OUTPUT" + + gather-stats: + name: "Gather stats files" + runs-on: ubuntu/latest + needs: [test-all-metadata] + steps: + - run: echo ${{ needs.test-all-metadata.outputs }} diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java index 96a6e449d3dff..55eae3942dcc7 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/ProgressReporter.java @@ -103,7 +103,7 @@ import jdk.graal.compiler.options.OptionKey; import jdk.graal.compiler.options.OptionStability; import jdk.graal.compiler.options.OptionValues; -import jdk.graal.compiler.util.json.JsonWriter; +import jdk.graal.compiler.util.json.JsonPrettyWriter; public class ProgressReporter implements FeatureSingleton, UnsavedSingleton { private static final boolean IS_CI = SubstrateUtil.isRunningInCI(); @@ -811,7 +811,7 @@ private Path reportBuildOutput(Path jsonOutputFile) { String description = "image statistics in json"; return ReportUtils.report(description, jsonOutputFile.toAbsolutePath(), out -> { try { - jsonHelper.print(new JsonWriter(out)); + jsonHelper.print(new JsonPrettyWriter(out)); } catch (IOException e) { throw VMError.shouldNotReachHere("Failed to create " + jsonOutputFile, e); } diff --git a/substratevm/src/com.oracle.svm.util/src/com/oracle/svm/util/ImageBuildStatistics.java b/substratevm/src/com.oracle.svm.util/src/com/oracle/svm/util/ImageBuildStatistics.java index 88e3f9b359808..c8104066576a0 100644 --- a/substratevm/src/com.oracle.svm.util/src/com/oracle/svm/util/ImageBuildStatistics.java +++ b/substratevm/src/com.oracle.svm.util/src/com/oracle/svm/util/ImageBuildStatistics.java @@ -41,7 +41,7 @@ public class ImageBuildStatistics { public static class Options { @Option(help = "Collect information during image build about devirtualized invokes and bytecode exceptions.")// - public static final OptionKey CollectImageBuildStatistics = new OptionKey<>(false); + public static final OptionKey CollectImageBuildStatistics = new OptionKey<>(true); } public enum CheckCountLocation {