diff --git a/experimental/behave/README.md b/experimental/behave/README.md index 0e10434285..b3b37ca2e9 100644 --- a/experimental/behave/README.md +++ b/experimental/behave/README.md @@ -45,3 +45,14 @@ To get started, please follow the instructions below: This script will download necessary database drivers and set up the dependencies directory with copies of the Corda fat-JAR and the network bootstrapping tool. + +# Selective Runs + +If you only want to run tests of a specific tag, you can append +the following parameter to the Gradle command: + +```bash +$ ../../gradlew scenario -Ptags="@cash" +# or +$ ../../gradlew scenario -Ptags="@cash,@logging" +``` \ No newline at end of file diff --git a/experimental/behave/build.gradle b/experimental/behave/build.gradle index 569a5deb57..4148d9d462 100644 --- a/experimental/behave/build.gradle +++ b/experimental/behave/build.gradle @@ -108,6 +108,11 @@ task scenarios(type: Test) { setTestClassesDirs sourceSets.scenario.output.getClassesDirs() classpath = sourceSets.scenario.runtimeClasspath outputs.upToDateWhen { false } + + if (project.hasProperty("tags")) { + systemProperty "cucumber.options", "--tags $tags" + logger.warn("Only running tests tagged with: $tags ...") + } } //scenarios.mustRunAfter test diff --git a/experimental/behave/src/scenario/kotlin/Scenarios.kt b/experimental/behave/src/scenario/kotlin/Scenarios.kt index b0c96a98ee..ac65923a00 100644 --- a/experimental/behave/src/scenario/kotlin/Scenarios.kt +++ b/experimental/behave/src/scenario/kotlin/Scenarios.kt @@ -4,7 +4,6 @@ import org.junit.runner.RunWith @RunWith(Cucumber::class) @CucumberOptions( - features = arrayOf("src/scenario/resources/features"), glue = arrayOf("net.corda.behave.scenarios"), plugin = arrayOf("pretty") ) diff --git a/experimental/behave/src/scenario/resources/features/cash/currencies.feature b/experimental/behave/src/scenario/resources/features/cash/currencies.feature index b90e7fa8a1..3085ced84e 100644 --- a/experimental/behave/src/scenario/resources/features/cash/currencies.feature +++ b/experimental/behave/src/scenario/resources/features/cash/currencies.feature @@ -1,3 +1,4 @@ +@cash @issuance Feature: Cash - Issuable Currencies To have cash on ledger, certain nodes must have the ability to issue cash of various currencies. diff --git a/experimental/behave/src/scenario/resources/features/database/connection.feature b/experimental/behave/src/scenario/resources/features/database/connection.feature index 47137b8aea..9be4fc7d2d 100644 --- a/experimental/behave/src/scenario/resources/features/database/connection.feature +++ b/experimental/behave/src/scenario/resources/features/database/connection.feature @@ -1,3 +1,4 @@ +@database @connectivity Feature: Database - Connection For Corda to work, a database must be running and appropriately configured. diff --git a/experimental/behave/src/scenario/resources/features/startup/logging.feature b/experimental/behave/src/scenario/resources/features/startup/logging.feature index 8cbf35eda1..20531237c6 100644 --- a/experimental/behave/src/scenario/resources/features/startup/logging.feature +++ b/experimental/behave/src/scenario/resources/features/startup/logging.feature @@ -1,3 +1,4 @@ +@logging @startup Feature: Startup Information - Logging A Corda node should inform the user of important parameters during startup so that he/she can confirm the setup and configure / connect relevant software to said node. @@ -7,7 +8,14 @@ Feature: Startup Information - Logging And node A uses database of type H2 And node A is located in London, GB When the network is ready + Then user can retrieve logging information for node A + + Scenario: Node shows database details on startup + Given a node A of version MASTER + When the network is ready + Then user can retrieve database details for node A + + Scenario: Node shows version information on startup + Given a node A of version MASTER Then node A is on platform version 2 And node A is on version 3.0-SNAPSHOT - And user can retrieve logging information for node A - And user can retrieve database details for node A diff --git a/experimental/behave/src/test/kotlin/net/corda/behave/process/CommandTests.kt b/experimental/behave/src/test/kotlin/net/corda/behave/process/CommandTests.kt index a6a6b121a7..4395ddb83a 100644 --- a/experimental/behave/src/test/kotlin/net/corda/behave/process/CommandTests.kt +++ b/experimental/behave/src/test/kotlin/net/corda/behave/process/CommandTests.kt @@ -14,7 +14,7 @@ class CommandTests { @Test fun `failed command returns non-zero`() { - val exitCode = Command(listOf("some-random-command-that-does-not-exist")).run() + val exitCode = Command(listOf("ls", "some-weird-path-that-does-not-exist")).run() assertThat(exitCode).isNotEqualTo(0) }