From 92975551d7ef45cbe8b930f5be415391ce343ef9 Mon Sep 17 00:00:00 2001 From: Brian Healey Date: Sun, 17 Nov 2019 21:34:40 -0500 Subject: [PATCH] individual scalatest in bazel md (#3494) * individual scalatest in bazel md Include instructions to run specific test in bazel * second test_arg needed * fix typo * rewording and formatting --- BAZEL.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/BAZEL.md b/BAZEL.md index 320135f5c5b8..23f6d2722b09 100644 --- a/BAZEL.md +++ b/BAZEL.md @@ -361,17 +361,25 @@ detailed information. bazel test //ledger-client/ods:tests --nocache_test_results ``` -- Execute an individual test case in a Scala test-suite +- Execute a specific Scala test-suite class ``` - bazel test //ledger-client/ods:tests_test_suite_src_test_scala_com_digitalasset_ods_slick_SqlUtilsTest.scala + bazel test //ledger/sandbox:sandbox-scala-tests_test_suite_src_test_suite_scala_com_digitalasset_platform_sandbox_stores_ledger_sql_JdbcLedgerDaoSpec.scala ``` + +- Execute a test with a specific name + + ``` + bazel test //ledger/sandbox:sandbox-scala-tests_test_suite_src_test_suite_scala_com_digitalasset_platform_sandbox_stores_ledger_sql_JdbcLedgerDaoSpec.scala --test_arg=-t --test_arg="JDBC Ledger DAO should be able to persist and load contracts without external offset" + ``` - Pass an argument to a test case in a Scala test-suite ``` bazel test //ledger-client/ods:tests_test_suite_src_test_scala_com_digitalasset_ods_slick_SqlUtilsTest.scala --test_arg=-z --test_arg="should return true" ``` + + More broadly, for Scala tests you can pass through any of the args outlined in http://www.scalatest.org/user_guide/using_the_runner, separating into two instances of the --test-arg parameter as shown in the two examples above. ### Running Executables