- Jun 09, 2020
-
-
Georges Racinet authored
Done as a parametrization of the existing `test_cli_named_branch`. Because now the GitLab branch can be pruned, we move that assertion from the helper function to the actual test cases.
-
- Jun 08, 2020
-
-
Georges Racinet authored
In this test we make a MR from `topic/other/antelope` to `branch/default`, manually merge it and assert detection. This is an interesting case, expected to work on Heptapod 0.13.0, that we want to cover for the Mercurial specific post-receive payload (heptapod#269)
-
- Jun 06, 2020
-
-
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
-
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 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 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.
-
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.
-
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.
-
- Jun 05, 2020
-
-
Georges Racinet authored
This is a step towards having only User instances on the Heptapod object.
-
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 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
-
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 authored
This is a bit different than for regular users, since we have potentially the root password first initialization sequence.
-
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 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 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 authored
Can be used to obtain more information about the user, and also to test that an existing access token is working.
-
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)
-
Georges Racinet authored
-
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.
-
Georges Racinet authored
We don't need to repeat the Heptapod instance in all log messages, nor the password
-
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).
-
- Jun 03, 2020
-
-
Georges Racinet authored
It is for now only used in Docker mode, that's why the obviously lack of command was there.
-
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.
-
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.
-
Georges Racinet authored
It's a good thing not to rely on webdriver methods for this, as it is faster and more stable.
-
Georges Racinet authored
Keeping logs about tests claiming thread monopoly at the INFO level, but ordinary tests signaling can be pushed down to DEBUG.
-
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 authored
All they need are services management and rake capability, previously only available for Docker installations.
-
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.
-
Georges Racinet authored
Just for readability
-
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()`.
-
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 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()`
-
- Jun 02, 2020
-
-
Georges Racinet authored
Closes #9
-
- May 29, 2020
-
-
Georges Racinet authored
At this stage we only want to prevent unwanted publication. See heptapod#284 for future actual support.
-
- May 27, 2020
-
-
Georges Racinet authored
We simply build up on the test for fast-forward refusal, by performing the rebase after the refusal and proceeding up to the full merge.
-
Georges Racinet authored
It will wait automatically for the rebase to be finished and assert its success. We could later on add options to test bad rebases if we need to.
-
- May 09, 2020
-
-
Georges Racinet authored
This is to reproduce heptapod#243 We also add a counter test that only deploy tokens for the right project are accepted.
-
Georges Racinet authored
The API method won't work for a while, wrote them before noticing the version information in online documentation. So we had to make a lengthy webdriver_create_deploy_token, hoping the page structure won't change too much before we can rely on the API methods.
-