<commit_before># Running integration tests

## Kubernetes

Kubernetes tests run against a Kubernetes API server, and are enabled by the `DEX_KUBECONFIG` environment variable:

```
$ export DEX_KUBECONFIG=~/.kube/config
$ go test -v -i ./storage/kubernetes
$ go test -v ./storage/kubernetes
```

These tests can be executed locally using docker by running the following script:

```
$ ./scripts/test-k8s.sh
```

## Postgres

Running database tests locally requires:

* Docker

To run the database integration tests:

- start a postgres container:

  `docker run --name dex-postgres -e POSTGRES_USER=postgres -e POSTGRES_DB=dex -p 5432:5432 -d postgres:11`
- export the required environment variables:

  `export DEX_POSTGRES_DATABASE=dex DEX_POSTGRES_USER=postgres DEX_POSTGRES_PASSWORD=postgres DEX_POSTGRES_HOST=127.0.0.1:5432`

- run the storage/sql tests:

  ```
  $ # sqlite3 takes forever to compile, be sure to install test dependencies
  $ go test -v -i ./storage/sql
  $ go test -v ./storage/sql
  ```

- clean up the postgres container: `docker rm -f dex-postgres`

## Etcd<commit_msg>Remove instructions for kubernetes tests from docs<commit_after># Running integration tests

## Postgres

Running database tests locally requires:

* Docker

To run the database integration tests:

- start a postgres container:

  `docker run --name dex-postgres -e POSTGRES_USER=postgres -e POSTGRES_DB=dex -p 5432:5432 -d postgres:11`
- export the required environment variables:

  `export DEX_POSTGRES_DATABASE=dex DEX_POSTGRES_USER=postgres DEX_POSTGRES_PASSWORD=postgres DEX_POSTGRES_HOST=127.0.0.1:5432`

- run the storage/sql tests:

  ```
  $ # sqlite3 takes forever to compile, be sure to install test dependencies
  $ go test -v -i ./storage/sql
  $ go test -v ./storage/sql
  ```

- clean up the postgres container: `docker rm -f dex-postgres`

## Etcd
{'fraction_non_alphanumeric': 0.09472551130247578, 'fraction_numerical': 0.023143164693218515, 'mean_word_length': 4.163888888888889, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6799843', 'n_tokens_mistral': 649, 'n_tokens_neox': 598, 'n_words': 201}