---
title: Codeception configuration
description: Configuration for Allure Codeception | Change allure-results directory | Configure link templates | Set up hooks
---

# Allure Codeception configuration

The behavior of [Allure Codeception](/docs/codeception/) can be controlled by some configuration options in your `codeception.yml` file. For example:

```yaml
namespace: Tests
support_namespace: Support
paths:
  tests: tests
  output: tests/_output
  data: tests/Support/Data
  support: tests/Support
  envs: tests/_envs
extensions:
  enabled:
    - Qameta\Allure\Codeception\AllureCodeception
  config:
    Qameta\Allure\Codeception\AllureCodeception:
      outputDirectory: allure-results
      setupHook: Hooks\SetupHook
      linkTemplates:
        issue: https://issues.example.org/%s
        tms: https://tms.example.org/%s
        jira: https://jira.example.org/browse/%s
```

## outputDirectory

Path to the directory where Allure Codeception will save the test results, see [How it works](/docs/how-it-works/). If the directory does not exist, it will be created. Defaults to `allure-results`.

The path is relative to the directory specified in `paths.output`, e.g. the directory will be created at `tests/_output/allure-results` in the example above.

## setupHook

If provided, Allure Codeception will call the `__invoke()` method of the given class before running any tests. This can be used, for example, to copy your previous report's [history files](/docs/how-it-works-history-files/), to generate an [environment file](/docs/how-it-works-environment-file/), etc.

Make sure the setup hook class can be loaded by PHP. If you use Composer's autoloading mechanism, see the [Composer documentation](https://getcomposer.org/doc/01-basic-usage.md#autoloading).

## linkTemplates

A mapping of templates that can be used to construct full URLs from short identifiers, see the [reference](/docs/codeception-reference/#link).

Each key must be a link type identifier, and each pattern must contain `%s` at the position where the identifier should be placed.
