1. 05 Oct, 2020 1 commit
  2. 08 Sep, 2020 1 commit
    • Georges Racinet's avatar
      services: GitLab Docker image now uses puma · ff3356bc42d2
      Georges Racinet authored
      This has been true at least since 13.1, meaning in particular
      that we didn't stop Rails properly in the backup tests, and
      that explains the high rate of data corruption I personally had
      with them.
      branch : stable
  3. 23 Jul, 2020 1 commit
    • Georges Racinet's avatar
      Heptapod: general helpers for API requests · 7ee09803b4ff
      Georges Racinet authored
      These allow notably to send the requests as a given `User`.
      Up to now, we had such methods only for projects, and more general
      requests were handcrafted and generally running as `root`.
      branch : heptapod-0-14
  4. 17 Jul, 2020 1 commit
  5. 21 Jun, 2020 2 commits
  6. 06 Jun, 2020 3 commits
    • Georges Racinet's avatar
      Heptapod: generic implementaion for apply_hashed_storage_setting · 326a7569275a
      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.
    • Georges Racinet's avatar
      Heptapod: reworked services management API · a88a65e5c368
      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.
    • Georges Racinet's avatar
      session: avoid a webdriver leak and removed duplication · 9aeb60aea2ea
      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.
  7. 05 Jun, 2020 8 commits
    • Georges Racinet's avatar
      Heptapod: preparing to store User instances · 31054df34fdf
      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.
    • Georges Racinet's avatar
      Preparations: simplified root user info and token setup · 0c7dfea61d61
      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.
    • Georges Racinet's avatar
      Preparations: made root webdriver lazy · 7db10f33198d
      Georges Racinet authored
      This is a bit different than for regular users, since
      we have potentially the root password first initialization
    • Georges Racinet's avatar
      Preparations: made webdriver for basic user lazy · f8b865f4cc43
      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
    • Georges Racinet's avatar
      Central method to get a user webdriver · 7fb8d5a12719
      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.
    • Georges Racinet's avatar
      Preparations: caching user access tokens · 5f5ce18ee546
      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.
    • Georges Racinet's avatar
      Session: moved user personal token generation to User class · b0029b6dec0c
      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
    • Georges Racinet's avatar
      Preparations: timed test users management · d0cc38e2434c
      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).
  8. 03 Jun, 2020 5 commits
    • Georges Racinet's avatar
      Heptapod: fixed `restart_rails()` · 1443aca07e8c
      Georges Racinet authored
      It is for now only used in Docker mode, that's why the obviously
      lack of command was there.
    • Georges Racinet's avatar
      DockerHeptapod: use backup methods from base class · c9100ec2a964
      Georges Racinet authored
      By implementing the new primitives, we can now leverage the base
      implementation of `backup_create()` and `backup_restore()` (which
      were largely derived from the first implementation in
      `DockerHeptapod` anyway)
    • Georges Racinet's avatar
      Heptapod: providing `restart_rails()` in the base class · daf358925926
      Georges Racinet authored
      The only caller at the time being is its sibling method
      `apply_hashed_storage_setting()`, that will hence become
      available for all concrete subclasses that implement
    • Georges Racinet's avatar
      New GdkHeptapod concrete class · c0a71291b3ac
      Georges Racinet authored
      It derives from SourceHeptapod, only adding service management
      and rake capabilities, hence being able to support backup tests
      and other tests that require service management.
    • Georges Racinet's avatar
      Heptapod: backup handling impl in the abstract base class · 4316399e1320
      Georges Racinet authored
      Instead of just declaring `backup_create()` and `backup_restore()`,
      we implement them generically, relying on a new set of primitives
      to be implemented in subclasses:
      - `ctl_services()`: service management
      - `RAILS_SERVICES`: class attribute listing the Rails app services
        (web and background). These will be different in the Docker and
        GDK cases.
      - `rake()`
      - `remove_all_backups()`
  9. 14 May, 2020 1 commit
    • Georges Racinet's avatar
      SourceHeptapod: make run_shell work · 757d36e282bc
      Georges Racinet authored
      Some callers want to pass a system user name, and we have to
      accept that for uniformity ('git' is been used as meaning
      "the default user", which is lame but that's another story)
  10. 01 May, 2020 1 commit
  11. 02 Apr, 2020 1 commit
  12. 01 Apr, 2020 2 commits
  13. 31 Mar, 2020 1 commit
  14. 29 Mar, 2020 1 commit
  15. 27 Mar, 2020 2 commits
  16. 20 Feb, 2020 1 commit
  17. 19 Feb, 2020 2 commits
    • Georges Racinet's avatar
      Bumping the initial timeout to 10mn · 82f67c127a58
      Georges Racinet authored
      One day it'll become configurable. In the meanwhile, 5 minutes can
      be too short if Heptapod is starting from scratch, i.e. has to run
      all the initial Chef configuration, database creation etc.
    • Georges Racinet's avatar
      Supporting running through a Selenium RemoteWebDriver · 90fc419eedf0
      Georges Racinet authored
      This is a preliminary for any CI attempt, since installing the webdriver
      inside a Docker container is a long and error prone process.
      This will allow to use a separate service image such as
      `selenium/standalone-chrome` and that may also turn to be a good option
      even outside Docker-based CI contexts.
      The new `Heptapod.new_webdriver()` method is now the unique one to be
      called to create new drivers, a preliminary to be able to run the
      tests with other drivers anyway. In particular, this should come handy
      if installing chromedriver is a problem.
  18. 15 Feb, 2020 1 commit
    • Georges Racinet's avatar
      Declarative system for network connections from Heptapod · b92b9db84c8b
      Georges Racinet authored
      We'll need to have Heptapod initiate connections to the
      system running the tests, in order to test outbound operations
      such as web hooks.
      We introduce a marker for tests that rely on this, so that they
      can be skipped, together with the new `--heptapod-reverse-call-host`
      option, for that to be possible, with reasonable defaults.
  19. 19 Jan, 2020 2 commits
    • Georges Racinet's avatar
      New `heptapod-ssh-user` option · 155961c2b15c
      Georges Racinet authored
      This will be useful for testing on remote servers, since we
      can't know it in advance.
      We could probably request the API for that
      but we aren't at this point (and it would slow the tests down a bit).
      The default value is 'git', though.
    • Georges Racinet's avatar
      Heptapod base class ready to support remote servers · 14de0027d5d1
      Georges Racinet authored
      In particular, capabilities such as `fs_access` are now
      expressed as class attributes that will be queried
      for conditional skipping or to disable some fixture extra
      behaviours, such as second cleanup passes and the like.
      Some methods are now implemented by the base class, if only
      to raise a catchable `NotImplementedError`
  20. 15 Jan, 2020 1 commit
  21. 07 Jan, 2020 1 commit
  22. 04 Jan, 2020 1 commit
    • Georges Racinet's avatar
      Supporting Heptapod source installs · 6b9f58423048
      Georges Racinet authored
      We have two new options:
      In source installs, as provided by the GitLab Development Kit
      (GDK), we obviously don't have docker commands, but we have
      direct access to processes and filesystem paths.
      To support that, we move the Heptapod class to its own
      module, and split it in a base class with two subclasses.
      We also introduce higher level file manipulation, using the
      tar file uploads as before in the Docker case, and direct
      file manipulation in the source case. We drop the artificial
      flexibility we had about uid/gid: they aren't usable in the
      source case, and they are fixed in the Docker case anyway.
      Also, the SSH url have to be different, because it's the current
      user in the source case.