Setup for the integration tests
This section describes the steps required to properly run the integration tests.
Requirements
- It is necessary to install the program
yarn
Configuration
In order for all integration tests to work properly, some configuration has to be set before starting them.
Configure cypress.json
[integrationTests/cypress.json]
-
The base URL must be adapted to the host system.
- For this the field
baseUrl
has to be adjusted to the host FQDN (e.g.https://local.cloudogu.com
).
- For this the field
DoguName
- Determines the name of the current dogu and will be used in routing.MaxLoginRetries
- Determines the number of login attempts before a test fails.AdminUsername
- The username of the CES admin.AdminPassword
- The password of the CES admin.AdminGroup
- The user group for CES administrators.AdminRole
- The backup dogu-specific user group for CES administrators. If this value is set, CES administrators WITHOUT this group cannot operate the backup dogu by default.
Set admin role
For the integration tests to succeed, the admin_role
key has to be set:
- Set the admin role via
etcdctl set /config/backup/admin_role IntegrationTestAdmin
- Restart the dogu via
docker restart backup
-
(optional, but useful) assign a group "IntegrationTestAdmin" to your own CES administrator in Usermgt
- This group will probably be created in the test and not cleaned up again. Removing the group is difficult, as this only affects tests from the
@cloudogu/dogu-integration-test-library
and a change to the tests does not have to be valid for all dogus.
- This group will probably be created in the test and not cleaned up again. Removing the group is difficult, as this only affects tests from the
Starting the integration tests
Happy Path
In order to test the happy path, a valid configuration for backup dogu needs to be provided:
etcdctl set /config/backup/backup_type local
etcdctl set /config/backup/local_config/path /tmp
etcdctl set /config/backup/encryption_key test
The integration tests can be started in two ways:
- with
yarn cypress run
the tests start only in the console without UI feedback. This mode is useful when execution is the main focus, for example, in a Jenkins pipeline. yarn cypress open
starts an interactive window where you can run, visually observe and debug the tests. This mode is especially useful when developing new tests and finding bugs.
Unhappy Path
The unhappy path is represented by an invalid configuration. For this, it is enough to delete a valid config key:
etcdctl rm /config/backup/backup_type
The integration tests can be started in two ways:
- with
yarn cypress run --config '{"specPattern":["cypress/e2e/unhappy_path/*"], "excludeSpecPattern":[]}'
the tests start only in the console without UI feedback. This mode is useful when execution is the main focus, for example, in a Jenkins pipeline. yarn cypress open --config '{"specPattern":["cypress/e2e/unhappy_path/*"], "excludeSpecPattern":[]}'
starts an interactive window where you can run, visually observe and debug the tests. This mode is especially useful when developing new tests and finding bugs.
Updating included tests from the test library
From time to time it is necessary to update the test library @cloudogu/dogu-integration-test-library
.
Update the test library with the following call and don't forget to commit any changes to the tests.
yarn run updateTests