Commit 2cc92c3
committed
feat: add doccano-django sample (keploy postgres-v3 simple-Query bind regression)
Minimum reproducer for the polymorphic-resourcetype failure that
motivated keploy/integrations#177. Wraps doccano v1.8.5 +
django-rest-polymorphic + postgres 13.3-alpine — the same shape
the bug originally surfaced on (keploy/enterprise PRs #1889 / #1964,
pipelines 3556 / 3572).
Per the keploy-ci-debug skill, the sample owns ALL orchestration
the lane scripts in keploy/integrations and keploy/enterprise need:
the docker-compose, the admin-bootstrap flow, the API traffic loop,
the noise filter (via keploy.yml.template), and a coverage-report
helper. Future lanes that exercise the same backend re-use this
directory; they don't redefine compose / bootstrap / traffic in
their own scripts. The intent is to migrate
enterprise/.ci/scripts/doccano-linux.sh from its current ~400-line
inlined-everything shape down to a thin "clone sample → wrap in
keploy → assert" wrapper in a follow-up PR.
Layout:
* `Dockerfile` — `FROM doccano/doccano:backend`. Wrapper exists
so a future doccano patch (or a backport of an upstream fix that
changes the bug-triggering shape) is a one-line edit here, not
scattered across lane scripts.
* `docker-compose.yml` — postgres + doccano backend on a fixed
subnet, every name fully env-driven (DOCCANO_BACKEND_CONTAINER /
DOCCANO_DB_CONTAINER / DOCCANO_APP_PORT / DOCCANO_DB_IP /
DOCCANO_NETWORK_SUBNET). Lane scripts running multiple matrix
cells in parallel pass per-cell values so the cells don't
collide on container names. Two-phase boot
(DOCCANO_SKIP_BOOTSTRAP=0 → migrations + admin; named volume
retained; DOCCANO_SKIP_BOOTSTRAP=1 → gunicorn-only against the
populated volume) so record/replay see a deterministic state.
* `flow.sh` — four subcommands:
bootstrap — log in as admin, install the deterministic
authtoken_token row so record-time and
replay-time Authorization headers match.
record-traffic — drive the API: 16-call /v1/me warmup hammer
(gunicorn worker contenttypes-cache warmup,
necessary for the SIGINT-driven shutdown
pattern lanes use), POST a polymorphic
TextClassificationProject, GET / PATCH it,
plus dependent category-types / examples /
categories / metrics reads that exercise the
multi-bind django_content_type lookups the
fix targets. Fire-and-forget; keploy is the
assertion layer at replay.
coverage — walk the running backend's URL resolver
(introspecting actual served methods, not
Django's permissive http_method_names default)
and the just-recorded keploy/test-set-*
tests; emit a (method, path) coverage
percentage for the v1/projects + accessory
surface.
list-routes — print the route table the coverage report
uses as its denominator (diagnostic).
* `keploy.yml.template` — globalNoise filter for the inherently
non-deterministic fields (Date/Expires headers, created_at/
updated_at body fields). Centralised here so a future doccano
version that adds another auto-timestamp field is one edit
rather than a fan-out across lane scripts. Lane scripts
envsubst this template into the per-cell run dir.
* `README.md` — bug shape, local-run instructions, lane pointers.
Sample is keploy-independent: `docker compose up && bash flow.sh
bootstrap && bash flow.sh record-traffic` works against bare
doccano. Verified locally: 25/25 calls return expected status,
polymorphic resourcetype is `TextClassificationProject` end-to-end.
The route walker emits 144 (method, path) pairs for the v1/projects
+ /v1/me + /v1/users + /v1/health + /v1/auth surface; coverage
matching against synthetic recorded tests rounds correctly.
Lanes that pin to this sample (pinned to the
feat/doccano-django-sample branch via --branch until this PR
merges):
* keploy/integrations `.woodpecker/doccano-postgres.yml` —
three-way matrix (record-build × replay-build, record-latest ×
replay-build, record-build × replay-latest); depends_on
prepare-and-run.
* keploy/enterprise `.woodpecker/doccano-linux.yml` — being
migrated to consume this sample in a follow-up PR; today still
uses inline compose generation.
Signed-off-by: Akash Kumar <meakash7902@gmail.com>1 parent 57856de commit 2cc92c3
5 files changed
Lines changed: 641 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
0 commit comments