TestIT Integration Guide
This guide covers two separate paths: pulling a Test IT case catalogue into
Mockarty, and sending JUnit XML results through mockarty-cli. A converted
JSON input is also available. Existing Test IT adapters send HTTP
requests directly to Test IT, so changing three environment variables alone
does not redirect them to Mockarty.
Mockarty does not serve the TestIT
/api/v2/*wire protocol.
The translation happens insidemockarty-cli, which parses a JUnit XML file
or an explicitly converted JSON bundle locally and posts the normalised payload
to the canonical/tcm/external-runsendpoint Mockarty already
exposes for Allure + Ginkgo + pytest.
1. CLI connection settings
Replace the three TestIT-side env vars in your CI config:
| TestIT env | Mockarty env | Purpose |
|---|---|---|
TMS_URL |
MOCKARTY_SERVER |
API base URL |
TMS_PRIVATE_TOKEN |
MOCKARTY_TOKEN |
API token (Bearer-style) |
TMS_PROJECT_ID |
MOCKARTY_NAMESPACE |
Tenant / workspace |
mockarty-cli accepts both the TMS_* and MOCKARTY_* flavours.
If the MOCKARTY_* form is empty, the TMS_* form is picked up
automatically by Mockarty’s CLI commands. Set the URL to your Mockarty
admin and use a Mockarty API token and namespace; a Test IT token and numeric
project ID are not interchangeable with these values.
# Settings for mockarty-cli testit commands.
export TMS_URL=https://mockarty.example.com
export TMS_PRIVATE_TOKEN=<your Mockarty API token>
export TMS_PROJECT_ID=team-a
Token format
If you copy the raw Authorization header (PrivateToken hexhex…)
into TMS_PRIVATE_TOKEN, mockarty-cli strips the PrivateToken
prefix automatically. The same applies to a Bearer hexhex… prefix.
You don’t need to clean the value by hand.
2. CI results from JUnit XML
If your test runner produces JUnit XML, point --results/-r at a file or a
directory of XML files. mockarty-cli accepts the corresponding Test IT
testit-cli results upload option names, including --configuration-id/-ci,
--testrun-id/-ti, --separator/-s, --namespace/-ns (JUnit identity),
--classname/-cn, and --ignore-flaky-failure/-iff. The target Mockarty
namespace comes from TMS_PROJECT_ID or MOCKARTY_NAMESPACE.
# 1. Create a test run for this CI execution.
export TMS_TEST_RUN_NAME="CI #${CI_PIPELINE_IID}"
mockarty-cli testit testrun create --output ./testrun.id
RUN_ID=$(cat ./testrun.id)
# 2. Run tests; configure your runner to write JUnit XML to ./junit-reports.
# 3. Upload all JUnit XML files. The run ID is read from ./testrun.id here.
mockarty-cli testit results upload --results ./junit-reports --testrun-id "$RUN_ID"
# 4. Close the run.
mockarty-cli testit testrun complete "$RUN_ID"
An empty directory, malformed XML, or a file with no test cases fails the
command before any results are sent. A failed or cancelled run makes
testrun complete exit nonzero.
JUnit XML carries the test name, classname, duration, and pass/fail/error/skip
markers. It does not carry Test IT framework steps, inline images,
attachments, parameters, or arbitrary metadata. To move those, use a richer
adapter or a converted JSON bundle with the referenced attachment files.
Official Test IT framework adapters submit HTTP requests directly to Test IT;
replacing this CLI binary does not redirect their traffic.
Converted JSON bundle
If your own converter produces a JSON array of
AutoTestResultsForTestRunModel objects, keep using --file:
mockarty-cli testit results upload --file ./converted-results.json
For example, converted-results.json can contain:
[{"autoTestExternalId":"suite.test_login","outcome":"Passed","duration":250}]
What the upload does
results upload parses every JUnit case or converted JSON element and POSTs each
one (in parallel batches with retry/backoff) to:
POST /api/v1/namespaces/<ns>/tcm/external-runs
Converted JSON can carry per-result files when --attachments-dir contains
the referenced files named by attachment ID (or ID plus extension). Nested
step files are stored on the result with their original step path in metadata.
The command fails before uploading results if a referenced file is absent,
empty, or over the inline limit of 256 KiB per file (1 MiB per result, up to
32 files). Larger source files need the full migration workflow; this CLI
upload cannot preserve them yet. Result configuration ID, work item IDs,
links, properties and nested steps are kept with the case run.
3. Configuration UUIDs
TestIT uses configurationId as a UUID handle for “the environment
my tests ran under” (Chrome vs Safari, prod vs staging, …).
Mockarty stores configurations as a first-class entity:
# Mint a fresh UUID for CI.
export TMS_CONFIGURATION_ID="$(mockarty-cli testit configuration generate)"
# List existing configurations for this namespace.
mockarty-cli testit configuration list
# Create a configuration with a human-readable name.
mockarty-cli testit configuration create \
--id "$TMS_CONFIGURATION_ID" \
--name "Chrome / prod"
Once TMS_CONFIGURATION_ID is set, every result the CLI uploads
during this CI run is tagged with that UUID. The Mockarty reports
panel renders a by configuration breakdown so you can compare
runs across different environments in one launch.
4. Workflow states
The standard Mockarty test-case workflow has five states: Draft, In Review,
Changes Requested, Active, and Archived. Your namespace can use a different
workflow.
TestIT’s own work-item states are a shorter set (NeedsWork,
NotReady, Ready, plus any states your project defined). The importer
carries each case’s state over: the TestIT value is matched against the
namespace’s workflow states by code first, then by label, ignoring case
and surrounding spaces. The Test IT API’s default NotReady state maps to
Mockarty’s draft when that state exists. An exact namespace match takes
precedence; other source states, including Ready, need a matching code or
label in your chosen workflow. Re-importing updates the case’s mapped state
when it changes in Test IT.
A new case whose state has no equivalent keeps the namespace default;
an existing case keeps its current state. The import summary’s warnings
array names the case and source state so you can add a matching state
(or rename an existing one) and re-import.
States are user-editable (rename / recolor / add new ones). The
POST /tcm/workflow-states API and the Admin UI both surface CRUD.
List the workflow states (and their UUIDs) via the API:
curl -H "X-API-Key: mk_..." \
http://localhost:5770/api/v1/namespaces/<ns>/tcm/workflow-states
5. Binary alias for supported commands
You can symlink the binary for the supported testit subcommands:
ln -s /usr/local/bin/mockarty-cli /usr/local/bin/testit-cli
The CLI routes that binary name to its testit subcommands. This alias does
not make Mockarty implement the Test IT HTTP API or accept every upstream
testit-cli flag.
For CI, you can instead change the command to mockarty-cli testit (or name
the same binary mcrtyctl and run mcrtyctl testit). Point its server and
token settings at Mockarty. The replacement uploads to Mockarty, not to your
Test IT tenant; an old Test IT PAT cannot authenticate to Mockarty.
testrun create --testruntags smoke,nightly saves run tags. results upload
and results import merge --testruntags into an existing run after checking
the input. --autotest-layer API (or TMS_AUTOTEST_LAYER) is retained in
result metadata. Typed --testrunlinks is rejected before upload because a
Mockarty run cannot yet store typed links; remove that flag only if your CI
does not need those links. The retained layer is not yet a filterable native
autotest layer.
6. Feature coverage today
| TestIT feature | Mockarty support |
|---|---|
testrun create / complete |
Mockarty run lifecycle; create --output/-o writes the run ID; not all upstream flags are supported yet |
results upload --results/-r (JUnit XML) |
Supported for basic test results; JUnit has no rich steps/media |
results upload --file (converted JSON arrays) |
Supported for the documented JSON format; official adapters need conversion |
auth login (verify Mockarty token) |
Supported |
configuration (list / create / get / delete) |
Supported for Mockarty configurations |
results upload --configuration-id |
Persisted on each case run; ad-hoc testrun create --configuration-id currently fails because the plan run API cannot store it |
--testruntags on create/upload/import |
Saves or merges tags on the Mockarty run; an existing run ID is required for upload/import |
--autotest-layer on upload/import |
Preserved in result metadata; not yet a native, filterable layer |
Typed --testrunlinks |
Rejected before writes until Mockarty has typed run links |
| Workflow states (per-NS, custom) | CRUD + transitions |
Defects via Links |
Preserved in metadata.testit.links; they are not turned into Mockarty defects |
Per-result parameters |
Typed param:<name> custom fields on the case and metadata.parameters |
Per-result properties |
Preserved in metadata.properties |
WorkItemIDs |
Labels (workItem:<id>) |
Python pytest tests
For tests using testit-adapter-pytest, install mockarty[test] in its place
and change import testit to import mockarty.testit as testit. Set
MOCKARTY_BASE_URL, MOCKARTY_API_KEY and MOCKARTY_NAMESPACE, then keep
pytest --testit -q. Remove the old adapter dependency: both plugins register
--testit. This wrapper sends results only to Mockarty; Test IT project,
configuration and run IDs do not become Mockarty IDs.
The wrapper supports externalId, displayName, a step(...) context and
addAttachments(...) with text or file content. File bytes are preserved,
subject to the inline limits of 256 KiB per file, 1 MiB and 32 files per
result. Attachments added in a step currently belong to the overall result;
nested and fixture steps, workflow status and TMS_TEST_RUN_ID matching are
not yet preserved by this wrapper. An upload error fails the pytest result.
7. Bulk import a TestIT export
The sections above keep CI flowing into Mockarty result-by-result. To move
your existing TestIT catalogue — sections, cases, steps metadata — over in one
shot, use the live pull described in the next section. It connects to your
TestIT server and reads the catalogue through the TestIT API, and it is the
recommended path.
TestIT’s own UI exports work items as .xlsx, not JSON. If you have such a
file, import it through the spreadsheet endpoint
(POST /api/v1/namespaces/{namespace}/tcm/import/xlsx) instead.
There is also a JSON bulk-import endpoint:
POST /api/v1/namespaces/{namespace}/tcm/import/testit
It takes Mockarty’s own intermediate export shape ({project, sections, workItems, attributes, configurations}) — the structure the live pull builds
internally — not a file TestIT produces. Use it when you have generated that
structure yourself, e.g. from your own TestIT API script. The body is JSON (not
multipart) and is bounded to 64 MiB; larger payloads are rejected with a
validation error.
The CLI reads such a file and posts it for you:
mockarty-cli testit import --file ./testit-export.json
This JSON endpoint has no Test IT connection from which to download referenced
files. A case containing source attachment references fails with an item-level
error instead of silently losing its media. Use the live pull below for those
cases.
No export file? Pull straight from the TestIT server
If you can reach your TestIT server from Mockarty, skip the export file
entirely — Mockarty pulls the project over the TestIT REST API and imports it
through the same pipeline:
POST /api/v1/namespaces/{namespace}/tcm/import/testit/pull
For repeated imports, create a Test IT connection in Settings → Integrations.
Enter the server origin (without a path), project UUID and the ID of a secret
entry containing the PrivateToken. Enable the connection and test project access.
In Test Cases → Import → From Test IT server, select the saved connection:
the token stays on the server and does not need to be entered again.
The import dialog links to saved connection settings and selects the connection
automatically when exactly one enabled Test IT connection is available. Choose
the history depth and start the import once. Progress and errors remain in the
dialog; source settings cannot change while the request is running. Closing the
window stops the client request, but already accepted changes may remain. After
an interrupted connection or an unreadable summary, review the imported cases
before trying again. Migration warnings stay visible until you close them.
Live-pull request bodies are limited to 16 KiB and must contain one UTF-8 JSON object with the exact documented field names. Repeated or unknown fields, trailing JSON values and null field values return HTTP 400. A missing or closed target namespace returns 404; a namespace replaced during the request returns 503. Recheck the target namespace before retrying. File imports also reject a target namespace that is closed or replaced while the upload is being read.
Use a saved connection through the API with:
{"integrationId":"11111111-2222-3333-4444-555555555555","createPlan":false,"historyLimit":30}
This mode requires test_case:write and integrations:read in the current
namespace. The connection must be enabled and use the Test IT adapter.
Do not supply baseUrl, token or projectId together with integrationId:
the server uses the saved destination and project. Imports run on demand;
creating this connection does not enable background synchronization.
Historical launches to import defaults to 30 in the import dialog.
The API accepts optional historyLimit: 0 skips execution history; 1–1000
selects the newest runs. All attempts within selected runs are read without a
separate result-count cutoff. Manual run history is checked independently of the
project run index. Older imported runs are retained when the count is reduced.
The response includes history.limit and history.selectedRuns; selected source
runs may still have migration warnings requiring review before cutover.
During a pull, transient source responses (429, 502, 503, 504) and
connection failures on read requests are retried at most twice. Mockarty
respects Retry-After; if the source asks for a wait over 30 seconds, the
pull reports the error so you can retry later without exceeding that limit.
Cancelling the import stops the retry wait.
For a one-shot connection, supply the coordinates directly:
curl -X POST http://127.0.0.1:5770/api/v1/namespaces/default/tcm/import/testit/pull \
-H "Authorization: Bearer $MOCKARTY_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"baseUrl": "https://testit.example.com",
"token": "<TestIT PrivateToken>",
"projectId": "0fff1111-2222-3333-4444-555566667777"
}'
In the UI: Test Cases → Import → From Test IT server — enter the server
URL, a PrivateToken and the project ID, and the pull runs with a live summary
toast when it finishes.
The live pull also fetches attachment bytes referenced by cases and steps,
including referenced shared steps and inline images. Mockarty verifies their
source size and checksum, applies the destination’s file size, quota, MIME and
scanner rules, and keeps the original bytes. Imported files belong to the
target case; source paths and file identities are retained with the case. A
failed file transfer fails that case in the summary. Repeat pulls reuse the
same imported file revision; a source rename is retained as another revision.
A repeat pull also checks that the stored file is readable and matches the
source checksum. If its bytes are missing, the same source revision is
downloaded and checked again without creating a duplicate or charging storage
quota twice. Storage outages, changed files and failed file checks are reported
as errors; they do not count as a successful transfer.
HTML step actions keep their source content; the step title becomes readable
text, and inline images open through the imported case’s protected file URL.
After a pull, an open case refreshes automatically if it has no unsaved edits.
Review files that exceed your destination limits before retrying. A live pull
creates reusable shared steps with their available numbered versions and keeps
case references linked to those steps. Files referenced by a shared step are
attached to the imported reusable step.
Before importing cases, every referenced shared step must have a successfully
imported current numbered definition. If a required snapshot is unavailable,
shared references form a cycle, or an existing definition conflicts, the pull
stops before importing cases. Resolve the reported source or destination
conflict and retry the pull.
What it fetches: the section tree, every work item (test cases, checklists,
shared steps — with steps, shared-step references, tags, links, linked tracker
issues, iteration parameters), the project’s custom-attribute definitions (GUID keys resolved to
names and option labels) and the run configurations. The response shape is the
same summary as the file import, plus a warnings array for non-fatal issues
(e.g. an older server without the attributes endpoint).
The result panel keeps the complete warning and error list visible for review.
When additional source data still needs migration, the response includes
warningCode: "source_reconciliation_pending" and unmappedCounts; the panel
shows a translated review message. A case-only pull without outstanding data
does not show that message.
Notes:
- A one-shot token is used only for this pull — it is never stored, logged or
echoed back. - Optional body fields:
"createPlan": trueassembles a test plan over the
imported cases,"planName"names it. - Large projects are paged automatically; a pull is bounded to 50 000 work
items per request. If the project exceeds that limit, an indexed work item
cannot be read, or the source’s pagination count changes during the pull,
the pull fails before importing cases. Resolve the source error and retry;
an incomplete catalogue is never reported as a successful pull. - Repeat imports match automated cases by the first external ID and manual
cases by project and work-item ID. Renames preserve the existing target;
different source cases with the same title remain separate. Legacy input
without a work-item ID still matches by name.
Or call the endpoint directly:
curl -X POST http://127.0.0.1:5770/api/v1/namespaces/default/tcm/import/testit \
-H "Authorization: Bearer $MOCKARTY_API_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @testit-export.json
Response:
{
"created": 124,
"updated": 6,
"placed": 118,
"configsCreated": 3,
"failed": 2,
"errors": [
"work item 91f3…: empty name"
]
}
| Field | Meaning |
|---|---|
created |
New test cases created. |
updated |
Cases that already existed and were matched (see dedup below) — not duplicated. |
placed |
Cases moved into a folder reconstructed from the TestIT section tree. |
configsCreated |
TestIT configurations newly imported into this namespace. |
failed |
Work items that could not be imported (e.g. an empty name). |
errors |
Per-item mapping or storage messages after a complete source read. A case can fail while the rest are imported; review every error before cutover. Source read failures abort the pull before this stage. |
Authentication & permissions. Send your Mockarty API token as
Authorization: Bearer <token>. The endpoint requires the test_case:write
permission and the TCM feature. The import only ever touches the namespace
in the URL path.
What gets imported
- Sections → folders. TestIT’s section tree is reconstructed (orphaned and
cyclic sections are handled defensively, never dropped) and cases are placed
into the matching folder. A missing section just lands the case at the root. - Work items → cases. Test cases and checklists become cases. Shared steps
are skipped (they embed into the cases that reference them). - Priority is mapped onto Mockarty’s four levels: Lowest/Low → low,
Medium → medium, High → high, Highest → critical (unknown values default to
medium). - Tags and description are carried over. External issues (Jira/etc.)
and work-item links from the source detail become external references on the
case. The source issue ID and metadata are retained separately for later
reconciliation. A project with linked issues should still be checked after import. - Attributes → custom fields, resolved losslessly: attribute keys (TestIT
stores them as GUIDs) become their human names, and option-typed values
(stored as option GUIDs) become their labels. The attribute type is
preserved. Structured values remain available for later remapping; the case
sidebar shows readable values and separates source information from your
custom fields. See TCM Custom Fields. - Case titles and steps: rich text in a Test IT title becomes a readable
case name. Step content remains rich text while its short heading is plain
text, so markup does not appear in the case tree or step list. - Parameters → custom fields. A parameterized work item’s iteration
parameters become typedparam:<name>custom fields, so the binding is
preserved on the case. - Configurations. Test IT configurations (browser/OS/env matrix) become
Mockarty configurations. Historical results and laterresults upload
submissions use the matching configuration in the destination namespace.
Historical results with an unresolved configuration remain pending for
reconciliation. A repeat import can add a missing configuration link to an
unchanged historical result; it preserves the result’s identity and files.
Existing configuration parameters and your default choice are preserved. - Automated identity. Live import retains a positive work-item
globalId
as the reporter’s case ID and the first nonempty auto-testexternalIdas its
automation name for selecting tests in saved CI jobs. Repeat imports keep the
corresponding Mockarty case. You still need to configure and bind the CI jobs
that will run these tests.
A re-import merges custom fields — values you added by hand in the UI are
preserved; only the keys the import carries are overwritten.
The live pull now reads source plans, suites, test points, runs, detailed
results, available case versions, change history and discussion comments
before it imports cases. If one of these reads fails, no cases are imported;
retry after resolving the source error. Some Test IT servers return 404 for
the versions list even when change history exists. In that case the pull
retains the history and available version snapshots, and records the remaining
gap for reconciliation.
Current authored imports preserve previously accepted Mockarty versions and their
files. Results linked to an ordinary case use the exact captured source version:
the pull verifies its owner, version identity and step content before attaching
the result to an immutable execution snapshot. Shared steps require the exact
version supplied by the captured snapshot or result; missing or conflicting
version information remains pending instead of following the latest shared step.
The full metadata of independently captured Test IT case versions remains
available for reconciliation. Snapshot-only files are not copied: execution
instructions keep their text and display a readable placeholder for an omitted
image or other embedded file. Files referenced by the result itself use the
historical result import described below. A matching version number, step text
or existing target ID alone never authorizes attaching a result to the current
case. Standalone automated executions and previously accepted current-case
versions use independent import paths.
For supported historical executions, the pull creates a native run on an exact
immutable execution snapshot.
It uses only step outcomes actually present in Test IT: a step comment by
itself does not become a passed step. If Test IT omits a start time, the run
records which available source time was used. A repeated pull reuses the same
run, and source corrections are retained as revisions without replacing local
edits.
Corrections also update imported step outcomes when the run and all its steps
still match the previous import. A local note, changed step or other local
result edit stops the update with a conflict so that your work is preserved.
A historical result and its referenced files are published together. If a file
check or storage operation fails, the previous accepted result stays available;
retry the pull after resolving the error. Source file corrections retain their
original bytes as separate revisions. The run’s current file list shows the
latest accepted source files together with local attachments; previously saved
file links remain valid. Repeating a successful pull verifies the files and
does not add duplicate files or charge storage twice.
An automated result without a test point can occur in an ad-hoc Test IT run.
When the result includes a valid captured autotest identity and project, the
pull creates a historical execution with its original name, outcome, comment
and files. Its report stays available without adding an editable case to the
active catalogue or creating a missing test point. The original absent case
version stays absent. Repeating the pull reuses the execution; source corrections
retain the earlier captured snapshot. These historical records cannot be
restored from the recycle bin as ordinary cases.
Outcomes inside a referenced shared step are saved under their captured parent
in the execution report. Each member keeps its source outcome and order. If Test IT
does not supply the member text, the report shows a localized position such as
“Shared step 1”; it does not substitute the current shared-block content. Missing
shared-block versions and member timestamps remain absent. Repeating the pull
reuses the same member results; source corrections follow the same local-edit
protection as other imported steps.
These additional source records are available for migration reconciliation.
When every point in a source plan resolves to an imported case or checklist,
the pull creates a runnable Mockarty plan with stable case membership. The
plan’s original status, dates, attributes, suite hierarchy, point status and
configuration still require review; the source plan remains pending in the
migration report. Empty plans or plans with unresolved points stay pending
without a misleading subset. Supported historical results and their files are
linked to native case runs after checksum verification; source step comments
remain in the result metadata.
A run needs its actual execution start time (startedOn) for a native report.
If it is missing, the run remains pending; its creation date does not substitute
for execution time. Previously accepted executions remain available.
A completed Test IT run with supported results receives a native report,
including an ad-hoc run without a source test plan. Its report contains the
actual selected executions, outcomes, dates and run-owned files. Repeating the
pull reuses the same report and executions. A source correction updates the
report after its affected executions have been saved; an interrupted pull leaves
the report awaiting those results. Files belonging to an individual execution
remain with that execution. The report file list shows its current imported
files; earlier run-level file links are unavailable after a correction.
Additional source run settings, unsupported nested step outcomes and standalone
discussion comments still need migration review. Supported report content remains
available while the migration report identifies these gaps. The complete autotest
catalogue also remains to be migrated.
Review the reconciliation counts before switching your team to Mockarty.
Deduplication
For a connected pull, each case belongs to its Test IT server, project and
work-item ID. Repeating the pull updates that same source-bound case; a matching
name or autotest label alone does not authorize replacing an existing case.
Distinct source cases with identical names remain separate. If a name is occupied,
the imported case receives a readable [Test IT #…] suffix; the original name and
source IDs remain in its mockarty:testit:* custom fields.
The case’s text, steps, supplied custom fields, mapped folder and supported
workflow state are accepted together with its verified files. A failed file check
or conflicting local edit stops that update. Resolve the reported conflict before
retrying. Files owned by a referenced shared block remain with that block instead
of being copied into every referencing case.
For an offline JSON import, automated work items match by the autotest’s external
full name; manual items with a source ID match by project and work-item ID.
Input without a work-item ID uses exact names. An existing same-name case without
the expected source binding is not automatically adopted.
Source attributes must not use the reserved
mockarty:testit: field prefix. The optional generated plan includes the exact
cases imported in this request, even when their original names match.
Supplied steps are reconciled on repeat import. Identical steps do not create
another version; an explicit empty step list clears them, while an absent list
leaves existing steps unchanged. A missing shared-step reference fails that case
instead of silently removing its content. If a step save fails after the case
was created, repeat the import: its source identity is retained for the retry.
8. Troubleshooting
401 on every call. Verify the token by running
mockarty-cli testit auth login — it lists the Mockarty namespaces the
Mockarty token can access. If the value starts with PrivateToken or
Bearer , the CLI strips that text; this does not convert a Test IT token
into a Mockarty token.
configuration_id must be a UUID. TestIT clients sometimes emit
brace-wrapped UUIDs ({abc-...}); the CLI accepts both forms but
you must mint a valid UUID first via testit configuration generate.
Cross-tenant results. Mockarty namespaces map 1:1 to TestIT
projects. A token bound to team-a cannot upload into team-b —
the call returns 403.
9. See also
- CLI Command Reference
- Allure Annotations Guide — sister
adapter; same/tcm/external-runsendpoint underneath - Test Discovery Sync — register your whole inventory from CI
- TCM Custom Fields
- Postman / Newman Migration