Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for integration tests #662

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 72 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,83 @@ Lint the source code:
yarn test:lint
```

Build
Build:

```shell
yarn build
```

A successful build run does not produce any message on the terminal.

## Integration test

Integration tests run against a Trino server running on your workstation.

Requirements:

* [kind](https://kind.sigs.k8s.io/ )
* [kubectl](https://kubernetes.io/docs/reference/kubectl/)

Create a cluster:

```shell
kind create cluster
```

Deploy Trino:

```shell
kubectl apply -f tests/it/trino.yml
mosabua marked this conversation as resolved.
Show resolved Hide resolved
```

Wait for pods to be ready:

```shell
kubectl wait --for=condition=ready pods -n trino-system --all --timeout=120s
```

Ensure Trino is running and available on port `8080`. Run the following
command in a separate terminal:

```shell
kubectl -n trino-system port-forward svc/trino 8080:8080
```

Run tests:

```shell
yarn test:it --testTimeout=60000
```

Output should look similar to the following:

```text
PASS tests/it/client.spec.ts
trino
✓ exhaust query results (1567 ms)
✓ close running query (200 ms)
✓ cancel running query (17 ms)
✓ get query info (1 ms)
✓ client extra header propagation
✓ query request header propagation (88 ms)
✓ QueryResult has error info
✓ QueryInfo has failure info (1 ms)
✓ prepare statement (98 ms)
✓ multiple prepare statement (432 ms)

Test Suites: 1 passed, 1 total
Tests: 10 passed, 10 total
Snapshots: 0 total
Time: 3.457 s
Ran all test suites matching /tests\/it/i.
```

Remove the cluster:

```shell
kind delete cluster
```

## Contributing

Follow the [Trino contribution guidelines](https://trino.io/development/process)
Expand Down