Project Import/Export Testing: create a full cycle integrity test

We may want to have a functional, black-box test for verifying the integrity of the whole Import/Export process.

It is suggested to:

  • Import complex JSON
  • Export the resulting project
  • Compare the original JSON and the exported one, they should be equal (or structurally equal, if there will be some difference with timestamps/order which needs to be checked)

We should probably take spec/fixtures/lib/gitlab/import_export/complex/project.json (currently, it has most of the relations) or prepare a similar one (maybe stripping down the number of sub-relations to 1-2).

It doesn't require #39536 (closed) and #39540 (closed) being completed, but the quality of this test will depend on how "complete" JSON we will use.

Some things to keep in mind:

  • some relations only appear in ee
  • the best fixture we have is complex/project.json, it may be a good start
  • I suggest starting with the small JSON and get to "full cycle", then expanding it, so it is important to see if could verify I/E that way (we discussed JSON_1 -> Import it -> Export -> (JSON_2), compare them)

Open questions:

  • Will this just be an RSpec test? What kind (feature spec?)
  • Should this run with every pipeline build? Is it fast enough for that? Maybe it should be a separate QA stage as described here? https://docs.gitlab.com/ee/development/testing_guide/end_to_end/
  • How can we arrive at a representative project JSON that covers all necessary cases?
  • Do we need to test Group and Project import/exports separately?
  • What should be covered by the test? The entire import/export cycle, which includes importing the git repository? Or just the metadata import/export?
Edited by Matthias Käppler