1. 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).
  2. 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()`
  3. 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)
  4. 01 May, 2020 1 commit
  5. 02 Apr, 2020 1 commit
  6. 01 Apr, 2020 2 commits
  7. 31 Mar, 2020 1 commit
  8. 29 Mar, 2020 1 commit
  9. 27 Mar, 2020 2 commits
  10. 20 Feb, 2020 1 commit
  11. 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.
  12. 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.
  13. 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`
  14. 15 Jan, 2020 1 commit
  15. 07 Jan, 2020 1 commit
  16. 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.
  17. 01 Jan, 2020 4 commits
  18. 14 Dec, 2019 2 commits
    • Georges Racinet's avatar
      ssh: key management for testing users · 199fdc12838a
      Georges Racinet authored
      We embed two freshly created SSH keys for these tests,
      and provide the necessary infrastructure to register them
      in Heptapod and retrieve them in the tests.
    • Georges Racinet's avatar
      ssh: defining host name and port for SSH testing · 558194059562
      Georges Racinet authored
      From now on, the forwarded ports of the Heptapod container
      will have to be on the `heptapod` host, as explained in
      The Heptapod object now has a `ssh_url` property that will
      serve as the base for performing hg commands over SSH.
  19. 17 Nov, 2019 1 commit
  20. 15 Nov, 2019 1 commit
    • Georges Racinet's avatar
      GitLab 10.3: don't make the default branch protected by default · 334fdada8eb9
      Georges Racinet authored
      It seems that the default branch becomes protected (FULL) by default in
      10.3, which makes all our tests performing actual Git force pushes (not
      based on -f but on the push really not being fast-forwardable) break.
      This is a quickfix, we should have tests for various scenarios on protected
      branches, and they should test user feedback as well (see heptadod#122)
  21. 17 Sep, 2019 1 commit
    • Georges Racinet's avatar
      Switched Heptapod tests to Python3 · a6796784bc7f
      Georges Racinet authored
      apart from the usual str/bytes dance in subprocesses and I/O,
      (we can assume that hg and docker exec outputs are essentially
      ASCII, can be handled by the default UTF-8 codec or that we'd
      write something dedicated otherwise),
      the notable thing is that we need inner fixture generator to
      become a context manager, because something in teardowns catches
      StopIteration too early and raises RuntimeError. This is cleaner