# Godog

## Using the Go Agent with Godog

The Go Agent provides special support for the Ginkgo BDD test framework. When enabled, the agent automatically integrates with Ginkgo's test lifecycle to track test execution.

### Configuration

To use the Go Agent with Ginkgo tests, simply add the `--enable-godog` parameter when following the [Steps for Instrumenting a Test Runner with SeaLights Go Agent (Default Usage - Go Test)](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/go-agent/go-agent-v2/go-agent-how-to-use/test-runner-mode-test-framework/..#step-1-configuration)

**Example Configuration**

Like most other parameters, you can add the Godog parameter in three different ways: [CLI flags, environment variables, or configuration file](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/go-agent/agent-configuration-parameters#ways-to-configure-agent-parameters). The examples below demonstrate each approach, using the minimum recommended parameters for a Ginkgo Test Runner. For additional configuration options, see the [Go Agent Parameter Reference Table](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/go-agent/go-agent-v2/agent-configuration-parameters/go-agent-parameter-reference-table).

{% tabs %}
{% tab title="CLI flags" %}
**Example 1: All parameters as CLI flags**

```bash
./slgoagent config \
  --token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  --testRunner \
  --testStage="component" \
  --enable-godog \
  --labId="shoppingcart.dev.qa-blue"
```

{% endtab %}

{% tab title="Environment variables" %}
**Example 2: Using environment variables**

```bash
export SEALIGHTS_TOKEN="./sltoken.txt"
export SEALIGHTS_TESTS_RUNNER="true"
export SEALIGHTS_TEST_STAGE="component"
export SEALIGHTS_ENABLE_GODOG=true
export SEALIGHTS_LAB_ID="shoppingcart.dev.qa-blue"

./slgoagent config
```

**Example 2b: Using environment variables with CLI flags**

{% code overflow="wrap" %}

```bash
export SEALIGHTS_ENABLE_GODOG=true

./slgoagent config \
--token="your-token" \
--testRunner \
--testStage="component" \
--labId="your-lab-id"
```

{% endcode %}
{% endtab %}

{% tab title="Configuration file" %}
**Example 3: Using configuration file**

Create `.slconfig.yaml` in your project root:

```yaml
testRunner: true
enableGodog: true
testStage: "component"
labId: "shoppingcart.dev.qa-blue"
```

Then run:

```bash
./slgoagent config --token="./sltoken.txt"
```

{% endtab %}
{% endtabs %}
