Skip to content

Configuration

Averrunci edited this page Mar 18, 2017 · 3 revisions

The configuration of the runner of Carna can be defined with json file (described below). The default json file name is "carna-runner-settings.json".

{
  "assemblies": [
    string
  ],
  "filter": {
    "pattern": string,
    "type": string,
    "options": object
  },
  "finder": {
    "type": string,
    "options": object
  },
  "builder": {
    "type": string,
    "options": object
  },
  "stepRunnerFactory": {
    "type": string,
    "options": object
  },
  "reporters": [
    {
      "reporter": {
        "type": string,
        "options": object
      },
      "formatter": {
        "type": string,
        "options": object
      }
    }
  ],
  "parallel": boolean
}

assemblies

Type: Array

Specifies assembly files to be run.

For example:

{
  "assemblies": [
    "Lib.Spec.dll"
  ]
}

filter

Type: Object

Specifies the filter to filter fixtures.

pattern

Type: String

Specifies the pattern to filter fixtures using the regular expression. This is enabled if the type property is not specified.

type

Type: String

Specifies the assembly-qualified name of the filter that implements IFixtureFilter interface.

options

Type: Object

Specifies options for the filter. The options property is applied if the filter class has a constructor that has a parameter of IDictionary<string, string>.

For example:

{
  "filter": {
    "pattern": "T.+Story"
  }
}
{
  "filter": {
    "type": "Carna.Runner.FixtureFilter",
    "options": {
      "pattern": "T.+Story"
    }
  }
}

finder

Type: Object

Specifies the finder to find fixtures.

type

Type: String

Specifies the assembly-qualified name of the finder that implements IFixtureTypeFinder interface.

options

Type: Object

Specifies options for the finder. The options property is applied if the finder class has a constructor that has a parameter of IDictionary<string, string>.

For example:

{
  "finder": {
    "type": "Carna.Runner.FixtureTypeFinder"
  }
}

builder

Type: Object

Specifies the builder to build fixtures.

type

Type: String

Specifies the assembly-qualified name of the builder that implements IFixtureBuilder interface.

options

Type: Object

Specifies options for the builder. The options property is applied if the builder class has a constructor that has a parameter of IDictionary<string, string>.

For example:

{
  "builder": {
    "type": "Carna.Runner.FixtureBuilder"
  }
}

stepRunnerFactory

Type: Object

Specifies the factory to create the runner of the fixture step.

type

Type: String

Specifies the assembly-qualified name of the factory that implements IFixtureStepRunnerFactory interface.

options

Type: Object

Specifies options for the factory. The options property is applied if the factory class has a constructor that has a parameter of IDictionary<string, string>.

For example:

{
  "stepRunnerFactory": {
    "type": "Carna.Runner.Step.FixtureStepRunnerFactory"
  }
}

reporters

Type: Array

Specifies reporters to report fixture running results.

reporter

Type: Object

Specifies the reporter to report fixture running results.

type

Type: String

Specifies the assembly-qualified name of the reporter that implements IFixtureReporter interface.

options

Type: Object

Specifies options for the reporter. The options property is applied if the reporter class has a constructor that has a parameter of IDictionary<string, string>.

formatter

Type: Object

Specifies the formatter to format a fixture running result.

type

Type: String

Specifies the assembly-qualified name of the formatter that implements IFixtureFormatter interface.

options

Type: Object

Specifies options for the formatter. The options property is applied if the formatter class has a constructor that has a parameter of IDictionary<string, string>.

For example:

{
  "reporters": [
    {
      "reporter": {
        "type": "Carna.Runner.Reporters.XmlFixtureReporter",
        "options": {
          "outputPath": "Results\\Results.xml"
        }
      },
      "formatter": {
        "type": "Carna.Runner.Formatters.FixtureFormatter"
      }
    }
  ]
}

parallel

Type: boolean

Specifies the value that indicates whether to be able to run in parallel child fixtures of the fixture that is specified that CanRunParallel is true. The default value is true.

For example:

{
  "parallel": false
}