Skip to content

test: comprehensive E2E test suite#158

Merged
padak merged 4 commits into
release/0.18.7from
feat/e2e-tests
Apr 14, 2026
Merged

test: comprehensive E2E test suite#158
padak merged 4 commits into
release/0.18.7from
feat/e2e-tests

Conversation

@padak
Copy link
Copy Markdown
Member

@padak padak commented Apr 13, 2026

Summary

  • Add tests/test_e2e.py — 9 tests covering 23 progressive steps against a real Keboola project
  • Tests cover: project CRUD, storage CRUD (bucket/table/file), config operations, component discovery, encrypt, branch lifecycle, sharing/lineage, error handling, JSON consistency
  • Verbose output shows exact CLI commands and abbreviated JSON responses
  • Guaranteed cleanup on failure via yield fixtures with e2e-{timestamp} naming
  • Add make test-e2e target, register @pytest.mark.e2e, exclude from default make test

Test plan

  • make test-e2e passes (9/9, ~90s)
  • make test still works (excludes e2e)
  • make check passes (lint + format + existing tests)
  • Pre-commit hook passes

padak added 4 commits April 13, 2026 21:59
Add tests/test_e2e.py with 9 tests covering 23 progressive steps:
- Project CRUD (add/list/status/edit/remove)
- Storage CRUD (bucket/table create, upload CSV, download round-trip, unload, delete)
- Config operations (list/detail/search/update --set/--dry-run/--configuration/delete)
- Component discovery (list with --type filter, detail via AI Service)
- File lifecycle (upload/list/detail/download/tag/delete with dry-run)
- Encrypt values (KBC::ProjectSecure verification)
- Branch lifecycle (list/create/use/reset/delete)
- Sharing list + lineage show (read-only)
- Error handling (invalid token, nonexistent resources, correct exit codes)
- JSON consistency (all read commands return valid JSON, token never leaked)

Verbose output shows exact CLI commands and abbreviated JSON responses.
Resources use e2e-{timestamp} prefix with guaranteed cleanup on failure.

Also: add make test-e2e target, register @pytest.mark.e2e, fix help regex
to support digits in target names, exclude e2e from default make test.
Expand TestFullE2E from 23 to 36 progressive steps:
- Add init command test (create .kbagent/ in sub-directory)
- Add storage upload-table --incremental (verify 8 rows after appending 3)
- Add storage load-file (upload CSV as file, load into table)
- Add config update --merge (deep-merge partial JSON, verify preservation)
- Add config new scaffold generation (keboola.ex-http)
- Add full workspace lifecycle (create/list/detail/password/load/query/delete)
- Add branch merge command (verify URL response, then delete)
- Add permissions list/show/check commands
- Add job list --component-id filter and job detail

Add TestE2ESyncWorkflow: sync init/pull/status/diff/push --dry-run in temp git repo
Add TestE2EToolCommands: tool list + tool call get_buckets (skip if no MCP)

Update CLAUDE.md: add convention #16 requiring E2E tests for new commands,
add test_e2e.py to project structure.

Total: 12 tests, ~2.5 min runtime against real API.
Documents all 12 E2E tests (36 main steps) with exact commands,
assertions, and coverage. Includes table of commands NOT covered
with reasons (manage token, interactive prompts, side effects).
Full transformation lifecycle:
- Create output bucket + Snowflake SQL transformation config via API
- SQL: SELECT id, name, CAST(value AS INT), CAST(value AS INT)*2 AS doubled_value
- Run transformation with job run --wait --timeout 300
- Verify job detail: status=success, isFinished=true
- Download output table, verify doubled_value == value * 2 for all rows
- Clean up transformation config and output bucket via CLI

Brings main E2E flow from 36 to 41 steps. All 12 tests pass (~3.5 min).
@padak padak merged commit 9d56fb3 into release/0.18.7 Apr 14, 2026
@padak padak deleted the feat/e2e-tests branch April 14, 2026 08:54
@padak padak mentioned this pull request Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant