1. 04 Jan, 2020 1 commit
    • Georges Racinet's avatar
      Supporting Heptapod source installs · 6b9f58423048
      Georges Racinet authored
      We have two new options:
      
        --heptapod-source-install
        --heptapod-repositories-root
      
      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.
      6b9f58423048
  2. 01 Jan, 2020 4 commits
  3. 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.
      199fdc12838a
    • 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
      README.
      
      The Heptapod object now has a `ssh_url` property that will
      serve as the base for performing hg commands over SSH.
      558194059562
  4. 17 Nov, 2019 1 commit
  5. 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)
      334fdada8eb9
  6. 15 Sep, 2019 1 commit
  7. 10 Nov, 2019 1 commit
  8. 09 Nov, 2019 1 commit
  9. 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
      anyway.
      a6796784bc7f
  10. 13 Sep, 2019 1 commit
  11. 10 Sep, 2019 1 commit
  12. 09 Sep, 2019 2 commits
    • Georges Racinet's avatar
      Project: made creation through Web UI a classmethod · cea504e617dc
      Georges Racinet authored
      This avoids importing the project module, and in particular
      the masking niceties that can endeavour.
      cea504e617dc
    • Georges Racinet's avatar
      Project: made destroy() a method · e38e11512c90
      Georges Racinet authored
      This is a bit simpler for callers, but the fixtures need it to
      become idempotent (hence skip_missing) for tests that call destroy()
      directly. In turn those tests (currently test_destroy only) don't
      need to depend on many fixtures nor to import 'project'
      e38e11512c90
  13. 28 Aug, 2019 1 commit
  14. 12 Aug, 2019 1 commit
  15. 16 Jul, 2019 1 commit
    • Georges Racinet's avatar
      Heptapod fixture creates a basic user who owns projects · 156d2f6215e2
      Georges Racinet authored
      With this change, a persistent unprivileged user `test_basic` is
      created, with its API token.
      The Heptapod fixture retrieves the token and starts a web session as
      this user, the project fixtures have it own their projects.
      
      It felt reasonible to have this generic user persist across test
      sessions, notably because user destruction is partly asynchronous in
      GitLab, because removing all objects authored by this user can be
      very long.
      
      We'll probably have this user own further test projects and create
      auxiliary, transient additional users to interact with the projects.
      156d2f6215e2
  16. 02 Aug, 2019 1 commit
    • Georges Racinet's avatar
      Rationalize fixtures · 5bd43e6b7682
      Georges Racinet authored
      The `heptapod` fixture now has a Selenium driver with a running session for
      the root user (previously represented by the `webdriver` fixture).
      
      Since it represents external state that persists even across test sessions,
      it is given the "session" scope, but only the Selenium part is actually
      teared down. Using this scope makes my running times go down from 1mn to
      a bit more than 40s.
      
      Factorized code between the two kinds of projects
      
      In adapting the tests to this, realized that now most of them don't even
      need direct references to the `heptapod` fixture.
      5bd43e6b7682
  17. 03 Jul, 2019 3 commits
    • Georges Racinet's avatar
      b1881e85f08d
    • Georges Racinet's avatar
      New fixture: public_project · 75794bb6c328
      Georges Racinet authored
      This leverages Project.api_edit
      75794bb6c328
    • Georges Racinet's avatar
      Generate, retrieve and store root user private token · 3074e12a0d71
      Georges Racinet authored
      This makes the `heptapod` fixture hold user password and private token
      information, something that we may want to revisit later, but that is
      simple enough for now.
      
      At instance creation, we generate a new private token for the root user,
      as it seems that the initially displayed value is not activated.
      
      Upon normal login, we retrieve the user private token, and store it in the
      `heptapod` fixture, along with its password.
      
      This should also enable us to stop hardcoding the root password and makes
      us close to be able to support tests running with regular users.
      3074e12a0d71
  18. 28 Jun, 2019 1 commit
    • Georges Racinet's avatar
      Refactored project fixture to provide requests helper · cd22bd429be9
      Georges Racinet authored
      with this it becomes much easier to perform direct HTTP request
      or GitLab JSON API requests on the test project.
      
      Also, this is a step towards multi-user tests, or at least tests
      not running as the 'root' user, although the fact that we're using the
      'root' user and that it is the owner of all sessions and projects is
      still hardcoded a lot.
      cd22bd429be9
  19. 25 May, 2019 1 commit
    • Georges Racinet's avatar
      Testing that project removal works from the UI · c61c62dcc44c
      Georges Racinet authored
      In order to test that, we separate the cleanup from the
      destroy call so that test_project_destroy actually tests the
      feature,  and keep the cleanup in the teardown sequence, as
      a protection for other tests in case of regressions.
      c61c62dcc44c
  20. 03 Apr, 2019 1 commit
    • Raphaël Gomès's avatar
      File structure reorganization · 132ff457ae4d
      Raphaël Gomès authored
      Moving tests to a tests subpackage, and their support to `tests.utils`
      
      (split from orginal commit by Georges Racinet <georges.racinet@octobus.net>)
      132ff457ae4d
  21. 05 Oct, 2018 2 commits
  22. 04 Oct, 2018 1 commit