Bulk-Pull Migrators
mockarty-cli migrate <source> bulk-imports test cases from an
upstream TCM system into a Mockarty namespace. Idempotent — re-running
over the same upstream is safe (duplicate externalId counted as
Skipped).
Supported sources
| Source | Status | Auth flag style | Notes |
|---|---|---|---|
testit |
Live | --from-token <PrivateToken hex> |
Drives /api/v2/autoTests/search — autotests only. To move the manual catalogue (sections, work items, steps, attributes) use the TestIT live pull described in TestIT integration |
testrail |
Live | --from-token <email:apikey> |
Basic auth; v6 + v7 envelopes |
qase |
Live | --from-token <api-token> |
Token <hex> header |
zephyr |
Live | --from-token <JWT> |
Zephyr Scale cloud (Bearer) |
allure |
Stub | — | Use the reverse exporter (Mockarty TCM → Allure results) instead — pulling from an Allure server is not supported |
Shared flag surface
Every subcommand accepts the same arguments:
| Flag | Purpose |
|---|---|
--from-url |
Upstream API base URL |
--from-token |
Upstream auth token (see table above) |
--from-project |
Upstream project / workspace id |
--to-namespace |
Mockarty namespace (defaults to MOCKARTY_NAMESPACE) |
--dry-run |
Fetch only — no writes to Mockarty |
--concurrency |
Parallel uploads to Mockarty (1..32, default 4) |
--page-size |
Upstream pagination hint |
--insecure |
Skip TLS verification on upstream (NEVER prod) |
Mockarty connection settings come from the usual env vars / config
(MOCKARTY_SERVER / MOCKARTY_TOKEN).
Example: TestIT
mockarty-cli migrate testit \
--from-url https://testit.example.com \
--from-token "$TMS_PRIVATE_TOKEN" \
--from-project 0fff7e91-…-12d4 \
--to-namespace team-a \
--dry-run # remove for the actual write pass
Output:
[testit] 1 tit-1 Login flow
[testit] 2 tit-2 Checkout
...
--- migration report (testit) ---
duration: 1.234s
fetched: 357
imported: 357
skipped: 0
failed: 0
A second run reports skipped: 357 because every externalId already
exists in Mockarty. Re-running is the recommended way to recover from
a partial migration after a network blip.
Example: TestRail
TestRail uses HTTP Basic auth. Paste your raw email:apikey —
the CLI base64-encodes it.
mockarty-cli migrate testrail \
--from-url https://my.testrail.io \
--from-token "qa@example.com:ABCDEF…" \
--from-project 12 \
--to-namespace team-b
Canonical schema
Every source converges on the same Mockarty-side payload:
{
"externalId": "<source>-<id>",
"source": "testit|testrail|qase|zephyr|allure",
"title": "...",
"description": "...",
"preconditions": "...",
"postconditions": "...",
"priority": "low|medium|high",
"steps": [
{"action": "...", "expectedResult": "...", "orderIndex": 1}
],
"labels": {"<source>:<key>:<value>": "<value>"},
"metadata": {"<source>": {"…": "full upstream row"}}
}
The full upstream row is preserved in metadata.<source> so a future
delta-sync can read every source-specific knob.
Troubleshooting
401 on Ping. Verify token format. TestIT wants PrivateToken <hex>,
TestRail wants <email>:<apikey>, QASE wants the raw token, Zephyr
wants the JWT (with or without the Bearer prefix — the CLI handles
both).
mockarty POST: status 409. Translated to a Skipped row in the
report. Means the case was already imported (duplicate externalId).
Migration stalls mid-pull. Use --dry-run first to confirm
connectivity + count, then bump --concurrency (Mockarty’s server-side
batch ingest already cap-protects against runaway parallelism).