Skip to content
Snippets Groups Projects
  1. Oct 24, 2021
  2. Oct 21, 2021
    • Georges Racinet's avatar
      Gitaly Comparison test_compare_find_local_branches(): rewrote with RpcHelper · 9daed7d5
      Georges Racinet authored
      The upcoming conflict didn't happen, but that is probably because we
      forgot to add new comparison tests with pagination and sort.
      
      It will be probably easier with those new helpers
      9daed7d5
    • Georges Racinet's avatar
      Gitaly Comparison tests: new helper function to normalize gRPC commits · 60a339b3
      Georges Racinet authored
      It is rather clear that these normalizations will be systematically
      needed.
      
      We could have introduced something similar to the `response_sha_attrs`
      argument of `RpcHelper()`, but it would have been a bit complicated
      to implement right now, as it would have to share some of the
      iteration logic with `message_to_git()`. Could be a subject for
      a subsequent refactoring, if we don't decide to tackle the differences
      before (but that requires HGitaly1 to be a thing of the past).
      60a339b3
    • Georges Racinet's avatar
    • Georges Racinet's avatar
      Gitaly Comparison test_delete_refs: using `RepoWrapper.reload()` · 9cee95b5
      Georges Racinet authored
      This is a just-released feature of mercurial-testhelpers.
      
      With the inner functions enclosing the `hg_repo` local variable
      we had to systematically redefine `hg_repo` upon each reload() or
      stop using that abbreviation. We chose the latter.
      9cee95b5
    • Georges Racinet's avatar
    • Georges Racinet's avatar
      Gitaly Comparison tests: generic comparison methods · d2a9a756
      Georges Racinet authored
      This follows the development patterns we've been using lately:
      a single bunch of request attributes is given to, e.g, the
      `assert_compare` method, which translates it to Git for Gitaly.
      Request translation is fairly simple, taking care of direct
      attributes that are declared to be commit SHAs.
      
      Before comparison, the Mercurial response is also translated to
      Git. This is done with a list of attribute dotted paths, with
      the special convention that a name ending in `[]` represents a
      list-like value on which iteration must happen (see example
      in `tests_with_gitaly/test_commit.py`).
      
      For cases where attributes are not comparable, or more generally
      acknowledged to differ, the `normalizer` callable can be used.
      
      It's not clear this makes tests easier to write, but it probably
      makes them easier to read.
      
      For the conversion of Mercurial SHAs to Git SHAs, we're
      accessing the hg-git class, which is a bit heavy-handed but gives
      us more chances to understand future incompatibility, as the
      on-disk format storage of the mapping is due to change in hg-git.
      d2a9a756
    • Georges Racinet's avatar
      Gitaly Comparison Tests: normalizing ui.username · e47f9676
      Georges Racinet authored
      In case `ui.username` takes the default form (such as `user@localhost`),
      HGitaly presents it as `name=user` (and the obvious) `email=user@localhost`
      whereas hg-git sets the same value in `name` and `email`.
      
      We set an explicit default user with both name and email, instead of
      changing the logic in main code because:
      
      - this is not a real discrepancy between HGitaly and Gitaly (after all,
      it depends on hg-git, which is purely testing apparatus in this context).
      - it is implemented using the generic internal `hg_stringutil` helper
      - I believe it to be actually better than using an email address for
        name.
      e47f9676
  3. Jul 20, 2021
    • Georges Racinet's avatar
      CommitAuthor message: taking time zones into account · e9713fe6
      Georges Racinet authored
      Up to now, we've been simply been ignoring the offset provided
      by Mercurial and were not displaying any timezone on the resulting
      `Author` message.
      
      Gitaly comparison tests will be provided by work currently in
      progress to make comparison more systematic.
      e9713fe6
    • Georges Racinet's avatar
      Gitaly Comparison tests: RpcHelper class for do_rpc pattern · 02c16a74
      Georges Racinet authored
      This should help reducing the boilerplate in comparison tests,
      while also making clear that the focus of them is the comparison,
      not the actual responses. For instance, we should not need to
      update expected values in the tests if Gitaly fixes a bug and we
      follow suit.
      
      We're using `test_find_ref_name()` to demonstrate.
      
      A possible next step would be to include commit id conversions
      in the `RpcHelper` class, or rather the fixture.
      
      Closes #56
      02c16a74
  4. Sep 06, 2021
    • Georges Racinet's avatar
      RefService.FindLocalBranches: fixing discrepancies with Gitaly · ee43254c
      Georges Racinet authored
      The expected response was actually in full ref form (as `refs/heads`).
      It is probable that the Rails app is resilient with respect to that.
      
      Gitaly response is sorted (bad for perf, but nothing obvious we can
      do, GitLab 14.2 will even introduce different sorting criteria).
      
      This RPC method was implemented before we had Gitaly Comparison tests,
      this underlines once more how crucial they are.
      ee43254c
  5. Aug 24, 2021
  6. Aug 23, 2021
  7. Aug 04, 2021
  8. Aug 03, 2021
  9. Jul 19, 2021
  10. May 28, 2021
  11. May 31, 2021
  12. May 15, 2021
Loading