Skip to content

Commit

Permalink
Merge pull request #149 from kolmar/feature/parallel-flag-for-modelcheck
Browse files Browse the repository at this point in the history
1.20.0: Add --parallel flag to model check tasks
  • Loading branch information
sergej-koscejev authored Nov 6, 2023
2 parents ed225b9 + 776e5a0 commit 90f255b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 1.20.0

### Added

- `modelcheck` and `MpsCheck` now support `parallel` flag to launch model checker in parallel mode.

## 1.19.3

### Fixed
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ Parameters:
the testcase will fail and the message of the model checking error will be reported.
* `message` - generates one testcase for each model check error. For uniqueness reasons, the name of the testcase will reflect the specific
model check error and the name of the testclass will be constructed from the checked node ID and its containing root node.
Full error message and the node URL will be reported in the testcase failure. Checked models will be mapped to testsuites with this option.
Full error message and the node URL will be reported in the testcase failure. Checked models will be mapped to testsuites with this option.
* `parallel` (since 1.20) - runs model checker in parallel mode. Supported in MPS 2021.3.4. Default is `false`.
* `maxHeap` - maximum heap size setting for the JVM that executes the modelchecker. This is useful to limit the heap usage
in scenarios like containerized build agents where the OS reported memory limit is not the maximum
to be consumed by the container. The value is a string understood by the JVM command line argument `-Xmx` e.g. `3G` or `512M`.
Expand Down Expand Up @@ -454,6 +455,7 @@ Parameters:
of Gradle build cache key.
* `junitFile` - the JUnit XML file to produce. Defaults to `$buildDir/TEST-${task.name}.xml`
* `junitFormat` - the format of the JUnit XML file. Defaults to `module-and-model`.
* `parallel` (since 1.20) - runs model checker in parallel mode. Supported in MPS 2021.3.4. Default is `false`.
* `mpsHome` - the home directory of the MPS distribution (or RCP) to use for testing.
* `mpsVersion` - the MPS version, such as "2021.3". Autodetected by reading `$mpsHome/build.properties` by default.
* `pluginRoots` - directories containing additional plugins to load
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ plugins {
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.13.2"
}

val baseVersion = "1.19.3"
val baseVersion = "1.20.0"

group = "de.itemis.mps"

Expand Down
5 changes: 5 additions & 0 deletions src/main/kotlin/de/itemis/mps/gradle/modelcheck/Plugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ open class ModelCheckPluginExtensions(objectFactory: ObjectFactory) : BasePlugin
var errorNoFail = false
var junitFile: File? = null
var junitFormat: String? = null
var parallel: Boolean = false
}

open class ModelcheckMpsProjectPlugin : Plugin<Project> {
Expand Down Expand Up @@ -81,6 +82,10 @@ open class ModelcheckMpsProjectPlugin : Plugin<Project> {
if (extension.junitFormat != null) {
args.add("--result-format=${extension.junitFormat}")
}

if (extension.parallel) {
args.add("--parallel")
}
args
})

Expand Down
7 changes: 7 additions & 0 deletions src/main/kotlin/de/itemis/mps/gradle/tasks/MpsCheck.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ abstract class MpsCheck : JavaExec(), VerificationTask {
@get:Input
val junitFormat: Property<String> = objectFactory.property<String>().convention("module-and-model")

@get:Input
val parallel: Property<Boolean> = objectFactory.property<Boolean>().convention(false)

@get:Internal("covered by classpath")
val additionalModelcheckBackendClasspath: ConfigurableFileCollection =
objectFactory.fileCollection().from(initialModelcheckBackendClasspath())
Expand Down Expand Up @@ -124,6 +127,10 @@ abstract class MpsCheck : JavaExec(), VerificationTask {
result.add("--result-format=${junitFormat.get()}")
}

if (parallel.get()) {
result.add("--parallel")
}

val effectiveLogLevel = logging.level ?: project.logging.level ?: project.gradle.startParameter.logLevel
if (effectiveLogLevel <= LogLevel.INFO) {
result.add("--log-level=info")
Expand Down

0 comments on commit 90f255b

Please sign in to comment.