Skip to content

Rewrite relative paths in tests

Sami Hiltunen requested to merge smh-rewrite-relative-paths-in-tests into master

Some tests peek into the filesystem after running some RPCs. Such tests will break when Praefect begins rewriting relative paths as their repositories are no longer at the paths the tests expect. This MR updates such tests to resolve the relative path to the actual path by asking Praefect for the replica path if Praefect is running in front of the Gitaly.

Tests that attempt to create existing state and try renaming or creating a repository at the same path will also break when ran with Praefect as Praefect no longer stores the repositories in the path sent by the client. These tests are updated to generate the path in the same manner as Praefect will. This ensures the conflicting state ends up conflicting with the operation when ran Praefect or just plain Gitaly.

To facilitate these test changes, this adds the DeriveReplicaPath function that Praefect will later use to derive unique replica paths for repositories. It's not hooked up anywhere yet so there are no behavior changes in this MR expect in the tests.

This MR amends the tests already to split the review work and reduce the need to resolve conflicts. The changed tests when Praefect begins generating relative paths, for example with !4101 (2cd17e90) in place.

Related to #3485 (closed)

Edited by Sami Hiltunen

Merge request reports