1. 05 Jun, 2020 11 commits
    • 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.
      0c7dfea61d61
    • 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
      sequence.
      7db10f33198d
    • 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
      f8b865f4cc43
    • 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.
      7fb8d5a12719
    • 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.
      5f5ce18ee546
    • Georges Racinet's avatar
      User: new api_get method · 952e922d9db5
      Georges Racinet authored
      Can be used to obtain more information about the user, and also
      to test that an existing access token is working.
      952e922d9db5
    • 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
      might)
      b0029b6dec0c
    • Georges Racinet's avatar
      Session: fixed long false docstring · c3c23d133a8b
      Georges Racinet authored
      c3c23d133a8b
    • Georges Racinet's avatar
      User: separate class method to make the root User instance · 2c804ca57156
      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.
      2c804ca57156
    • Georges Racinet's avatar
      User: nicer repr() · 68c3ffafbb62
      Georges Racinet authored
      We don't need to repeat the Heptapod instance in all log messages,
      nor the password
      68c3ffafbb62
    • 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).
      d0cc38e2434c
  2. 03 Jun, 2020 12 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.
      1443aca07e8c
    • Georges Racinet's avatar
      Project: new `api_retrieve()` classmethod · f9fe6fbf54b7
      Georges Racinet authored
      This is more direct than `webdriver_retrieve()`, with the usual
      benefits of API methods: performance and stability
      
      In this particular case, we were relying on the full session cookie
      to be accepted in the API, which is not guaranteed to be acceptable
      in the long run.
      
      At this point `webdriver_retrieve()` is not called any more, but
      we're not removing it right away.
      f9fe6fbf54b7
    • Georges Racinet's avatar
      Project: split and transformed `retrieve` into a classmethod · 78434c68466d
      Georges Racinet authored
      The `wait_availability` kwarg is replaced by the separate
      `wait_hg_availability()` method, so that it can also be
      used with other project retrieval methods that we're going
      to add.
      78434c68466d
    • Georges Racinet's avatar
      Project.webdriver_destroy: simpler check for effective destruction · cd10f4a320ef
      Georges Racinet authored
      It's a good thing not to rely on webdriver methods for this, as it
      is faster and more stable.
      cd10f4a320ef
    • Georges Racinet's avatar
      Reduced logging noise from concurrency control code · 115128936034
      Georges Racinet authored
      Keeping logs about tests claiming thread monopoly at the INFO
      level, but ordinary tests signaling can be pushed down to DEBUG.
      115128936034
    • 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)
      c9100ec2a964
    • Georges Racinet's avatar
      Backups: also testing on GDK installations · b81a192e8a51
      Georges Racinet authored
      All they need are services management and rake capability,
      previously only available for Docker installations.
      b81a192e8a51
    • Georges Racinet's avatar
      Running the tests for GDK installations · 554378d00e82
      Georges Racinet authored
      The `--heptapod-gdk` option declares the test to be launched
      in GDK context, leading to the new `GdkHeptapod` class to be
      instantiated, with the GDK root dir specified with `--heptapod-gdk-root`.
      
      The new `needs.services` decorator will allow to declare tests that need
      services (and rake) management, hence will be satisfied more broadly than
      the `docker` marker. Notably these tests won't be skipped in GDK context.
      554378d00e82
    • Georges Racinet's avatar
      conftest: reorder boolean variables · fff421a1f0ee
      Georges Racinet authored
      Just for readability
      fff421a1f0ee
    • 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
      `ctl_services()`.
      daf358925926
    • 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.
      c0a71291b3ac
    • 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()`
      4316399e1320
  3. 02 Jun, 2020 1 commit
  4. 29 May, 2020 1 commit
  5. 27 May, 2020 2 commits
  6. 09 May, 2020 2 commits
  7. 24 May, 2020 1 commit
  8. 22 May, 2020 1 commit
    • Georges Racinet's avatar
      hg: allow passing preencoded command arguments · 3a0317f9aa04
      Georges Racinet authored
      This will be necessary for tests about content that's
      not encoded with the current default encoding.
      
      Because of this, the output might not be utf-8 either. For now,
      just avoiding an error is good enough.
      3a0317f9aa04
  9. 23 May, 2020 1 commit
  10. 21 May, 2020 1 commit
  11. 19 May, 2020 2 commits
  12. 18 May, 2020 3 commits
  13. 14 May, 2020 2 commits