Skip to content

Sahagin configuration YAML

Nozomi Ito edited this page Jul 29, 2016 · 30 revisions

Sahagin's all configurations are centralized on YAML format configuration file called "sahagin.yml".

File location

By default, sahagin.yml is assumed to be located on the test execution current directory. In the case of Java or Groovy, this is project root directory.

If you want to change the directory path to sahagin.yml or file name itself, specify the path to Sahagin configuration file by sahagin.configPath system property as JVM argument.

If you use Maven, add maven-surefire-plugin argLine:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <configuration>
        <argLine>
          -Dsahagin.configPath={path to Sahagin configuration file}
        </argLine>
      </configuration>
    </plugin>
  </plugins>
</build>

If you use Gradle, add systemProperty value:

test {
  systemProperty 'sahagin.configPath', 'path to Sahagin configuration file'
}

If you use sahagin.jar file directly, add JVM argument:

-Dsahagin.configPath=<path to Sahagin configuration file>

In addition to the system property, if you use Jenkins Sahagin plug-in, you need to specify the path to Sahagin configuration file by Post-build Action Publish Sahagin HTML report configuration.

YAML structure

Configuration YAML structure is as below:

common:
  runOutputIntermediateDataDir: <intermediate data directory>
  reportInputIntermediateDataDirs:
    - <intermediate data directory>
    - <intermediate data directory>
    - ...
  reportOutputDir: <report directory>
  userLocale: <locale value>
  runTestOnly: <report generate flag>
java:
  testDir: <test code root directory>
  testFramework: <test framework name>
groovy:
  testDir: <test code root directory>
  testFramework: <test framework name>

Sahagin configuration file is intended to be used by all language [Sahagin runtime libraries](Basic architecture).

  • common key configurations are used for all languages.
  • java key configurations are only used for Sahagin-Java runtime library.
  • groovy key configurations are only used for Sahagin-Groovy runtime library.

common key entries

key detail
runOutputIntermediateDataDir Path to the root directory of [Sahagin intermediate data](Basic architecture) generated by test run. This path is absolute path or relative path from this YAML file.
  • type: string
  • required: No
  • default: "sahagin-intermediate-data"
reportInputIntermediateDataDirs Path to the root directories of [Sahagin intermediate data](Basic architecture) used to generate the HTML report. This path is absolute path or relative path from this YAML file.
  • type: string list
  • required: No
  • default: list with single element "sahagin-intermediate-data"
reportOutputDir Path to the HTML report output root directory. This path is absolute path or relative path from this YAML file.
  • type: string
  • required: No
  • default: "sahagin-report"
userLocale Locale used in the report.
"system"
Decide locale from the system locale.
"en-US"
Use en-US locale.
"ja-JP"
Use ja-JP locale.
  • type: string ("system" or "en-US" or "ja-JP")
  • required: No
  • default: "system"
runTestOnly Used only for sahagin.jar or sahagin-groovy.jar. If true, sahagin.jar (or sahagin-groovy.jar) does not generate HTML report, only generates intermediate data. See Basic architecture for detail.
  • type: boolean
  • required: No
  • default: false

java key entries

key detail
testDir Path to the root directory of test Java files.
All test methods and methods annotated by @TestDoc must be located under this directory.
This path is absolute path or relative path from this YAML file.
  • type: string
  • required: Yes for Sahagin-Java
testFramework Sahagin assumes tests are executed by this test framework. Be aware of the case difference of values.
"jUnit4"
Assume all tests are executed by JUnit4.
"jUnit3"
Assume all tests are executed by JUnit3.
"testNG"
Assume all tests are executed by TestNG.
  • type: string
  • required: No
  • default: "jUnit4"

groovy key entries

key detail
testDir Path to the root directory of test Groovy files.
All test methods and methods annotated by @TestDoc must be located under this directory.
This path is absolute path or relative path from this YAML file.
  • type: string
  • required: Yes for Sahagin-Groovy
testFramework Sahagin assumes tests are executed by this test framework. Be aware of the case difference of values.
"jUnit4"
Assume all tests are executed by JUnit4.
"spock"
Assume all tests are executed by Spock.
  • type: string
  • required: No
  • default: "spock"

Clone this wiki locally