Skip to content

Commit

Permalink
live-tests: delete the debug command (#44854)
Browse files Browse the repository at this point in the history
Co-authored-by: Natik Gadzhi <natik@respawn.io>
  • Loading branch information
alafanechere and natikgadzhi committed Sep 24, 2024
1 parent 7d70f10 commit 35b05da
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 273 deletions.
1 change: 0 additions & 1 deletion airbyte-ci/connectors/live-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
regression_tests_artifacts
live_tests_debug_reports
104 changes: 4 additions & 100 deletions airbyte-ci/connectors/live-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,106 +16,6 @@ This project contains utilities for running connector tests against live data.
poetry install
```

## Commands

### `debug`

```
Usage: poetry run live-tests debug [OPTIONS] {check|discover|read|read-with-state|spec}
Run a specific command on one or multiple connectors and persists the
outputs to local storage.
Options:
--connection-id TEXT
--config-path FILE
--catalog-path FILE
--state-path FILE
-c, --connector-image TEXT Docker image name of the connector to debug
(e.g. `airbyte/source-faker:latest`,
`airbyte/source-faker:dev`) [required]
-hc, --http-cache Use the HTTP cache for the connector.
--help Show this message and exit.
```

This command is made to run any of the following connector commands against one or multiple connector images.

**Available connector commands:**

- `spec`
- `check`
- `discover`
- `read` or `read_with_state` (requires a `--state-path` to be passed)

It will write artifacts to an output directory:

- `stdout.log`: The collected standard output following the command execution
- `stderr.log`: The collected standard error following the c
- `http_dump.txt`: An `mitmproxy` http stream log. Can be consumed with `mitmweb` (version `9.0.1`) for debugging.
- `airbyte_messages.db`: A DuckDB database containing the messages produced by the connector.
- `airbyte_messages`: A directory containing `.jsonl` files for each message type (logs, records, traces, controls, states etc.) produced by the connector.

#### Example

Let's run `debug` to check the output of `read` on two different versions of the same connector:

```bash
poetry run live-tests debug read \
--connection-id=d3bd39cd-6fec-4691-a661-d52c466d8554
--connector-image=airbyte/source-pokeapi:dev \
--connector-image=airbyte/source-pokeapi:latest \
--config-path=poke_config.json \
--catalog-path=configured_catalog.json
```

It will store the results in a `live_test_debug_reports` directory under the current working directory:

```
live_tests_debug_reports
└── 1709547771
└── source-pokeapi
└── read
├── dev
│   ├── airbyte_messages
| │ ├── duck.db # DuckDB database
│   │   ├── logs.jsonl
│   │   ├── records.jsonl
│   │   └── traces.jsonl
│   ├── stderr.log
│   └── stdout.log
└── latest
├── airbyte_messages
│ ├── duck.db # DuckDB database
│   ├── logs.jsonl
│   ├── records.jsonl
│   └── traces.jsonl
├── stderr.log
└── stdout.log
```

You can also run the `debug` command on a live connection by passing the `--connection-id` option:

```bash
poetry run live-tests debug read \
--connector-image=airbyte/source-pokeapi:dev \
--connector-image=airbyte/source-pokeapi:latest \
--connection-id=<CONNECTION-ID>
```

##### Consuming `http_dump.mitm`

You can install [`mitmproxy`](https://mitmproxy.org/):

```bash
pipx install mitmproxy
```

And run:

```bash
mitmweb --rfile=http_dump.mitm
```

## Regression tests

Expand Down Expand Up @@ -279,6 +179,10 @@ The traffic recorded on the control connector is passed to the target connector

## Changelog

### 0.19.0

Delete the `debug`command.

### 0.18.8

Improve error message when failing to retrieve connection.
Expand Down
4 changes: 1 addition & 3 deletions airbyte-ci/connectors/live-tests/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "live-tests"
version = "0.18.8"
version = "0.19.0"
description = "Contains utilities for testing connectors against live data."
authors = ["Airbyte <contact@airbyte.io>"]
license = "MIT"
Expand Down Expand Up @@ -44,8 +44,6 @@ genson = "^1.2.2"
segment-analytics-python = "^2.3.2"
python-slugify = ">=8.0.4"

[tool.poetry.scripts]
live-tests = "live_tests.cli:live_tests"

[tool.poetry.group.dev.dependencies]
ruff = "^0.3.0"
Expand Down
14 changes: 0 additions & 14 deletions airbyte-ci/connectors/live-tests/src/live_tests/cli.py

This file was deleted.

12 changes: 0 additions & 12 deletions airbyte-ci/connectors/live-tests/src/live_tests/debug/__init__.py

This file was deleted.

137 changes: 0 additions & 137 deletions airbyte-ci/connectors/live-tests/src/live_tests/debug/cli.py

This file was deleted.

This file was deleted.

0 comments on commit 35b05da

Please sign in to comment.