aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2023-10-29 18:51:33 +0100
committerJoas Schilling <coding@schilljs.com>2024-01-26 13:53:34 +0100
commit52cc18efc0baa916b23350fe5fbb0b0081af5def (patch)
treec7f2760679e0b14189396af7ce3c44f574065857 /build
parentb64d03279586c0b26ca73818e9d5110176d8ae7b (diff)
downloadnextcloud-server-52cc18efc0baa916b23350fe5fbb0b0081af5def.tar.gz
nextcloud-server-52cc18efc0baa916b23350fe5fbb0b0081af5def.zip
fix(tests): Ensure ldap server can be reached in integration tests on GitHub Actions and other improvments
* Run integration tests for every pull request * Also print docker logs of service containers (ldap, redis) * Ensure consistent `datadir` for test assertions * Test openldap features separatly * Only the LDAP tests rely on `/dev/shm` while `federated.feature` rely on real directory access Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'build')
-rw-r--r--build/integration/config/behat.yml20
-rw-r--r--build/integration/features/bootstrap/LDAPContext.php5
-rw-r--r--build/integration/openldap_features/openldap-uid-username.feature (renamed from build/integration/ldap_features/openldap-uid-username.feature)0
-rw-r--r--build/integration/openldap_numerical_features/openldap-numerical-id.feature (renamed from build/integration/ldap_features/openldap-numerical-id.feature)0
4 files changed, 24 insertions, 1 deletions
diff --git a/build/integration/config/behat.yml b/build/integration/config/behat.yml
index 080752a3d6f..8401b841cdd 100644
--- a/build/integration/config/behat.yml
+++ b/build/integration/config/behat.yml
@@ -192,6 +192,26 @@ default:
- admin
- admin
regular_user_password: 123456
+ openldap_numerical:
+ paths:
+ - "%paths.base%/../openldap_numerical_features"
+ contexts:
+ - LDAPContext:
+ baseUrl: http://localhost:8080
+ admin:
+ - admin
+ - admin
+ regular_user_password: 123456
+ openldap:
+ paths:
+ - "%paths.base%/../openldap_features"
+ contexts:
+ - LDAPContext:
+ baseUrl: http://localhost:8080
+ admin:
+ - admin
+ - admin
+ regular_user_password: 123456
remoteapi:
paths:
- "%paths.base%/../remoteapi_features"
diff --git a/build/integration/features/bootstrap/LDAPContext.php b/build/integration/features/bootstrap/LDAPContext.php
index e0315bce84e..fd4a448b5e9 100644
--- a/build/integration/features/bootstrap/LDAPContext.php
+++ b/build/integration/features/bootstrap/LDAPContext.php
@@ -104,7 +104,7 @@ class LDAPContext implements Context {
$this->asAn('admin');
$this->creatingAnLDAPConfigurationAt('/apps/user_ldap/api/v1/config');
$data = new TableNode([
- ['configData[ldapHost]', 'openldap'],
+ ['configData[ldapHost]', getenv('LDAP_HOST') ?: 'openldap'],
['configData[ldapPort]', '389'],
['configData[ldapBase]', 'dc=nextcloud,dc=ci'],
['configData[ldapAgentName]', 'cn=admin,dc=nextcloud,dc=ci'],
@@ -141,6 +141,9 @@ class LDAPContext implements Context {
$this->asAn('admin');
$configData = $table->getRows();
foreach ($configData as &$row) {
+ if (str_contains($row[0], 'Host') && getenv('LDAP_HOST')) {
+ $row[1] = str_replace('openldap', getenv('LDAP_HOST'), $row[1]);
+ }
$row[0] = 'configData[' . $row[0] . ']';
}
$this->settingTheLDAPConfigurationTo(new TableNode($configData));
diff --git a/build/integration/ldap_features/openldap-uid-username.feature b/build/integration/openldap_features/openldap-uid-username.feature
index 6793273e8c7..6793273e8c7 100644
--- a/build/integration/ldap_features/openldap-uid-username.feature
+++ b/build/integration/openldap_features/openldap-uid-username.feature
diff --git a/build/integration/ldap_features/openldap-numerical-id.feature b/build/integration/openldap_numerical_features/openldap-numerical-id.feature
index 75eb6827192..75eb6827192 100644
--- a/build/integration/ldap_features/openldap-numerical-id.feature
+++ b/build/integration/openldap_numerical_features/openldap-numerical-id.feature