# ...
x-speakeasy-test-server:
  baseUrl: "https://api.example.com" # If specified at the top level of the Arazzo file, all workflows will be configured to run against the specified server URL
workflows:
  - workflowId: some-test
    x-speakeasy-test-server:
      baseUrl: "x-env: CUSTOM_API_URL" # If specified within a workflow, only that workflow will be configured to run against the specified server URL. This will override any top-level configuration.
    # ...
```

You may provide a default value in the `x-env` directive if the environment variable is not set. This can be useful for local development or non-production environments.

```yaml
x-speakeasy-test-server:
  baseUrl: "x-env: CUSTOM_API_URL; http://localhost:18080" # Run against the local mock server if the environment variable is not set
```

<Callout title="Reserved Environment Variable" type="warning">

The `TEST_SERVER_URL` environment variable is reserved for use by Speakeasy's mock server. When running tests via `speakeasy test`, if the mock server is generated and enabled, `TEST_SERVER_URL` is automatically set to the URL of the running mock server and overwrites any existing value for that environment variable while running.

If you want to use a custom test server instead of the mock server, you can:

- Use the `--disable-mockserver` flag when running `speakeasy test` to prevent the automatic setting of `TEST_SERVER_URL`
- Use a different environment variable name (like `CUSTOM_API_URL` in the examples above) for your custom server configuration

</Callout>

If all tests are configured to run against other server URLs, you can disable mock server generation in the `.speakeasy/gen.yaml` file:

```yaml