Skip to content
Snippets Groups Projects
  1. Jun 09, 2020
  2. Jun 08, 2020
  3. Jun 06, 2020
    • Georges Racinet's avatar
      test_hashed_storage_migration: more focused. · 6aab593d
      Georges Racinet authored
      Development instances tend to have lots of corrupted repos lying
      around, which
      
      - could make the process rightfully fail
      - could eat more time than our timeout will permit
      6aab593d
    • Georges Racinet's avatar
      Heptapod: generic implementaion for apply_hashed_storage_setting · 326a7569
      Georges Racinet authored
      It will work for any subclass that implements `gitlab_ctl` and
      `rake` (currently corresponding to the `@needs.services` generator),
      hence for `GdkHeptapod` as well as `DockerHeptapod`.
      
      This implementation is tighter in that we make sure that Redis,
      where the annoying cache should reside, is stopped before
      restarting everything. The restart of Rails dominates execution
      time anyway.
      
      Of course, at some point we could find a gentler way to force
      the previous setting out of the caches, but at least we can now
      run hashed storage related tests in GDK context.
      
      We don't need `restart_rails()` anymore, a more controlled style
      is wishable anyway.
      326a7569
    • Georges Racinet's avatar
      Heptapod: reworked services management API · a88a65e5
      Georges Racinet authored
      Finally settled to `gitlab_ctl()` to express both
      management of all services and of a sublist of services.
      
      The naming and behaviour is more intuitive than the `ctl_services`,
      and it matches the Omnibus (hence Docker) CLI.
      a88a65e5
    • Georges Racinet's avatar
      Giving some time to test_hashed_storage_migration · ed3d9dfe
      Georges Racinet authored
      All the rake task does is to "enqueue" the migration task, which
      itself will spawn even more workers.
      
      Therefore, it's necessary to `wait_assert()`. This explains why
      this test has been regularly failing except on empty instances.
      
      The asynchronicity seems to be even stronger on GitLab 12.10.
      ed3d9dfe
    • Georges Racinet's avatar
      session: avoid a webdriver leak and removed duplication · 9aeb60ae
      Georges Racinet authored
      `login_as_user()` would not store the webdriver anywhere, hence
      it wouldn't be properly closed.
      It is currently used in `test_external_user_can_create_project()`
      
      With this change, it relies on the centralized mechanism currently
      provided by the `Heptapod` object, with the result that the
      webdriver is also stored there and gets automatically cleaned up
      at the end of the session.
      9aeb60ae
    • Georges Racinet's avatar
      Better detection and cleanup in creation test by external user · 0ab9dbd3
      Georges Racinet authored
      To recall, in this test, the user has no quota to create personal
      projects, but can still create a project in a group.
      
      In some cases (and especially on the future GitLab 12.10), the
      removal of the group wouldn't remove the just created project, or
      at least not right away, making subsequent runs fail because there's
      already a project with that name. We could have made the project
      name unique, but it's better to leak less and to tighten the detection.
      0ab9dbd3
  4. Jun 05, 2020
    • Georges Racinet's avatar
      Project: converted access to Heptapod users to the new style · 9faf3a96
      Georges Racinet authored
      This is a step towards having only User instances on the Heptapod
      object.
      9faf3a96
    • Georges Racinet's avatar
      Heptapod: preparing to store User instances · 31054df3
      Georges Racinet authored
      Having real `User` instances on the `Heptapod` object has been
      on the radar since the `User` class was created.
      
      Many places in the test utils and at most a few in the tests
      themselves access the `Heptapod.users` dictionary.
      
      It's therefore a bit too much for now to convert all these to
      fetch a User instance directly, but the new `Heptapod.get_user()`
      method will help us transitioning progressively.
      31054df3
    • Georges Racinet's avatar
      User.token_headers() · 6cffadeb
      Georges Racinet authored
      This is obviously the right place to mutualize the API token logic.
      Forfunately, token headers creation is not spread all over the
      tests, just in a few helper classes
      6cffadeb
    • Georges Racinet's avatar
      Preparations: simplified root user info and token setup · 0c7dfea6
      Georges Racinet authored
      It makes more sense to set the root user once (and in the uniform
      way provided by the User class), to ensure its token immediately
      and to just assume that in the subsequent setups.
      
      Notably `session.login_as_root()` might simply not be called at all
      in the current test run.
      0c7dfea6
    • Georges Racinet's avatar
      Preparations: made root webdriver lazy · 7db10f33
      Georges Racinet authored
      This is a bit different than for regular users, since
      we have potentially the root password first initialization
      sequence.
      7db10f33
    • Georges Racinet's avatar
      Preparations: made webdriver for basic user lazy · f8b865f4
      Georges Racinet authored
      This already saves us 5s at each startup.
      
      - `session.ensure_user()` doesn't initialize a webdriver any more.
      - `Heptapod.get_user_webdriver()` creates the driver if needed
        and stores it
      - `User.ensure_private_token()` now uses `Heptapod.get_user_webdriver()`
        instead of taking a webdriver argument
      f8b865f4
    • Georges Racinet's avatar
      Central method to get a user webdriver · 7fb8d5a1
      Georges Racinet authored
      After this change, no test gets a webdriver directly
      from the dict on Heptapod object, opening the road to
      make webdriver initialization lazy.
      7fb8d5a1
    • Georges Racinet's avatar
      Preparations: caching user access tokens · 5f5ce18e
      Georges Racinet authored
      These can't be read with a webdriver, as it is a security feature
      of GitLab not to display them, that's why we where creating new
      ones for each session.
      
      Storing them in a cache file will help making the session startup
      time shorter. This is especially useful if launching a few tests
      repeatedly or with the tests that have to redo the preparations after
      an instance restart.
      5f5ce18e
    • Georges Racinet's avatar
      User: new api_get method · 952e922d
      Georges Racinet authored
      Can be used to obtain more information about the user, and also
      to test that an existing access token is working.
      952e922d
    • Georges Racinet's avatar
      Session: moved user personal token generation to User class · b0029b6d
      Georges Racinet authored
      A prelude to forthcoming changes to cache it.
      
      the `create()` class method will automatically store the user
      information in the Heptapod instance, but `search()` won't,
      because it doesn't have the password information (but its caller
      might)
      b0029b6d
    • Georges Racinet's avatar
      Session: fixed long false docstring · c3c23d13
      Georges Racinet authored
      c3c23d13
    • Georges Racinet's avatar
      User: separate class method to make the root User instance · 2c804ca5
      Georges Racinet authored
      Having name and id harcoded, it's better to have a single method
      in case we'd want to hardcode less or change things.
      2c804ca5
    • Georges Racinet's avatar
      User: nicer repr() · 68c3ffaf
      Georges Racinet authored
      We don't need to repeat the Heptapod instance in all log messages,
      nor the password
      68c3ffaf
    • Georges Racinet's avatar
      Preparations: timed test users management · d0cc38e2
      Georges Racinet authored
      These preparations (signed-in webdriver, personal access token)
      are only done once per session, but if the session is comprised of
      only a few tests, they can represent a good chunk of the run time.
      
      For example, launching the only current test in test_wikis.py,
      they represent 45% of the total time (on a warmed up GDK Heptapod
      based on GitLab 12.10).
      d0cc38e2
  5. Jun 03, 2020
  6. Jun 02, 2020
  7. May 29, 2020
  8. May 27, 2020
  9. May 09, 2020
Loading