Git sync


Git sync imports the suites, scenarios and pages versioned in a repository, next to your module, into a PrestaFlow project. You keep your tests under version control, and the app picks them up.

The import goes in one direction only: from the repository to the app. The app never writes to your repository.

On the Projects page, click Git on a project. The "Git binding" screen walks you through four steps: Provider, Sign in, Repository, Folder.

#GitHub

  1. Click Sign in with GitHub. Your browser opens on the GitHub page.
  2. If the browser did not open, use the link under "1. Open in your browser".
  3. On the GitHub page, enter the code shown in the app under "2. Enter this code". A button copies it for you.
  4. Wait for "Waiting for you to authorize on GitHub…" to finish.
  5. Pick the repository in the list. Use the "Filter…" field to find it.

#GitLab

Fill in these fields:

  • "GitLab host": leave it empty to use gitlab.com.
  • "GitLab access token": a token with the api scope. The app stores it encrypted.
  • "Owner / namespace".
  • "Repository name".

#Root path

In Root path in repo, enter the folder that holds your tests, for example /tests. If the repository is dedicated to your tests, enter /.

#What gets imported

The app reads every .php file under the root path, on the default branch of the repository. It classifies each file as a suite, a page or a scenario, then creates or updates it in the project.

  • Other files are skipped.
  • Nothing is deleted locally when a file disappears from the repository.
  • A suite class belongs to one project only.

#Resync and read the report

The import runs when you link the repository. To import again, click Resync suites.

The app confirms with a message:

  • "Sync complete — X suite(s), Y page(s), Z scenario(s)…" when it worked.
  • "Sync failed: …" followed by the reason when it did not.

#The Last sync report

The "Last sync" report shows what happened during the latest import:

  • the trigger (manual, or when the repository was linked),
  • how many files were scanned, created, updated and skipped,
  • the errors, if any.

A file can be skipped because of a class conflict, for example "class already used by project …". It means the suite class is already imported in another project. A suite class belongs to one project only.

When files are skipped or the sync fails, the app also notifies you ("Git sync: files skipped", "Git sync: failed").

Once the repository is linked, the screen shows "Linked to" and "Default branch".

Click Unlink to remove the link. The app asks "Unlink this repository from the project?".

If the app shows "Reconnect the link", it can no longer read the stored credentials (the application key changed). Sign in to the provider again from that section.