| 1 | # Integration tests |
| 2 | |
| 3 | End-to-end tests that run against a **live Colab backend** (unlike the mocked unit tests under `tests/`). |
| 4 | |
| 5 | ## Prerequisites |
| 6 | - Google account with Colab access. |
| 7 | - `uv` installed. |
| 8 | - Working auth — verify with `colab sessions`. |
| 9 | |
| 10 | ## Scenarios |
| 11 | |
| 12 | | Directory | What it covers | |
| 13 | | --- | --- | |
| 14 | | `repro_plot_redirection/` | `colab exec` of a matplotlib script with `--output-image` redirection. | |
| 15 | | `repro_keep_alive/` | Fast smoke test (~10s): keep-alive daemon spawns, persists its PID, no errors during the pre-flight ping, `colab stop` reaps it. | |
| 16 | | `repro_keep_alive_scope/` | Slow soak test (~95s): runs the daemon long enough for one ping past the pre-flight, asserts no `keep_alive_error` events. | |
| 17 | | `repro_variable_persistence/` | Variables persist across `colab exec` calls in the same session. | |
| 18 | | `repro_piped_console/` | Fast smoke test (~5s including session creation): `echo cmd \| colab console -s s` runs the command and exits within 30s. Regression test for the 2026-05-07 EOF-handler fix. | |
| 19 | | `repro_bundled_oauth/` | Fast smoke test (~5s): verifies that the fallback OAuth configuration is loaded and starts the OAuth flow with the default client ID when local config is missing. | |
| 20 | | `repro_ssh/` | Fast smoke test (~5s): `--help` advertises the flags and an unknown session exits. Slow soak test (~95s): Live e2e allocates a CPU VM, runs a real remote command over `colab ssh --proxy-mode` | |
| 21 | |
| 22 | |
| 23 | ## Running |
| 24 | ```bash |
| 25 | uv run bash integration/repro_keep_alive/test.sh |
| 26 | ``` |
| 27 | `uv run` ensures the local `colab` entry point is on `PATH`. |
| 28 | |
| 29 | ## Adding a scenario |
| 30 | 1. Create `repro_<short_description>/`. |
| 31 | 2. Add a script (`.sh` or `.py`) that demonstrates or verifies the issue. |
| 32 | 3. Add a row to the table above noting whether it's fast (smoke) or slow (soak). |