Make sure that runtime/benchmarks are dry-run in CI tests (#8330)

Ensure that `-Dbench.compileOnly` system property is correctly forwarded to the benchmarks' runner. So that in the CI Engine tests, benchmarks are *dry run*.

# Important Notes
- Fixes dry run benchmarks in Engine Test Action
- Fixes Engine Benchmark Action
This commit is contained in:
Pavel Marek 2023-11-20 13:35:43 +01:00 committed by GitHub
parent b224f95639
commit 1c936cc69f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 31 deletions

View File

@ -1394,12 +1394,6 @@ lazy val runtime = (project in file("engine/runtime"))
version := ensoVersion, version := ensoVersion,
commands += WithDebugCommand.withDebug, commands += WithDebugCommand.withDebug,
inConfig(Compile)(truffleRunOptionsSettings), inConfig(Compile)(truffleRunOptionsSettings),
inConfig(Benchmark)(Defaults.testSettings),
Benchmark / javacOptions --= Seq(
"-source",
frgaalSourceLevel,
"--enable-preview"
),
Test / parallelExecution := false, Test / parallelExecution := false,
Test / logBuffered := false, Test / logBuffered := false,
Test / testOptions += Tests.Argument( Test / testOptions += Tests.Argument(
@ -1470,7 +1464,15 @@ lazy val runtime = (project in file("engine/runtime"))
.value .value
) )
.settings( .settings(
bench := (Benchmark / test).tag(Exclusive).value, bench := (Benchmark / test)
.tag(Exclusive)
.dependsOn(
// runtime.jar fat jar needs to be assembled as it is used in the
// benchmarks. This dependency is here so that `runtime/bench` works
// after clean build.
LocalProject("runtime-with-instruments") / assembly
)
.value,
benchOnly := Def.inputTaskDyn { benchOnly := Def.inputTaskDyn {
import complete.Parsers.spaceDelimited import complete.Parsers.spaceDelimited
val name = spaceDelimited("<name>").parsed match { val name = spaceDelimited("<name>").parsed match {
@ -1480,12 +1482,21 @@ lazy val runtime = (project in file("engine/runtime"))
Def.task { Def.task {
(Benchmark / testOnly).toTask(" -- -z " + name).value (Benchmark / testOnly).toTask(" -- -z " + name).value
} }
}.evaluated, }.evaluated
Benchmark / parallelExecution := false
) )
/** Benchmark settings */
.settings( .settings(
inConfig(Benchmark)(Defaults.testSettings),
Benchmark / javacOptions --= Seq(
"-source",
frgaalSourceLevel,
"--enable-preview"
),
(Benchmark / javaOptions) := (Benchmark / javaOptions) :=
(LocalProject("std-benchmarks") / Benchmark / run / javaOptions).value (LocalProject("std-benchmarks") / Benchmark / run / javaOptions).value,
(Benchmark / javaOptions) ++= benchOnlyOptions,
Benchmark / fork := true,
Benchmark / parallelExecution := false
) )
.dependsOn(`common-polyglot-core-utils`) .dependsOn(`common-polyglot-core-utils`)
.dependsOn(`edition-updater`) .dependsOn(`edition-updater`)

View File

@ -165,9 +165,7 @@ In order to build and run Enso you will need the following tools:
[`project/build.properties`](../project/build.properties). [`project/build.properties`](../project/build.properties).
- [Maven](https://maven.apache.org/) with version at least 3.6.3. - [Maven](https://maven.apache.org/) with version at least 3.6.3.
- [GraalVM](https://www.graalvm.org/) with the same version as described in the - [GraalVM](https://www.graalvm.org/) with the same version as described in the
[`build.sbt`](../build.sbt) file, configured as your default JVM. GraalVM is [`build.sbt`](../build.sbt) file, configured as your default JVM.
distributed for different Java versions, so you need a GraalVM distribution
for the same Java version as specified in [`build.sbt`](../build.sbt).
- [Flatbuffers Compiler](https://google.github.io/flatbuffers) with version - [Flatbuffers Compiler](https://google.github.io/flatbuffers) with version
1.12.0. 1.12.0.
- [Rustup](https://rustup.rs), the rust toolchain management utility. - [Rustup](https://rustup.rs), the rust toolchain management utility.
@ -259,24 +257,6 @@ working on modern macOS properly. Thus, we've developed a replacement, the
simply export the `USE_CARGO_WATCH_PLUS=1` in your shell and the build system simply export the `USE_CARGO_WATCH_PLUS=1` in your shell and the build system
will pick it up instead of the `cargo-watch`. will pick it up instead of the `cargo-watch`.
### Getting Set Up (JVM)
In order to properly build the `runtime` component, the JVM running SBT needs to
have some dependency JARs available in its module path at startup. To ensure
they are available, before running any compilation or other tasks, these
dependencies should be prepared. To do so, run the following command in the
repository root directory:
```bash
sbt bootstrap
```
It is preferred to not run this command from the sbt shell, but in batch mode,
because SBT has to be launched again anyway to pick up these JARs at startup.
Bootstrap has to be run only when building the project for the first time
**and** after each change of Graal version.
### Getting Set Up (Documentation) ### Getting Set Up (Documentation)
We enforce automated formatting of all of our documentation and configuration We enforce automated formatting of all of our documentation and configuration