Skip to content

Commit

Permalink
cleanup parallel deployment tests
Browse files Browse the repository at this point in the history
Signed-off-by: prashant-gurung899 <[email protected]>
  • Loading branch information
prashant-gurung899 committed Sep 4, 2024
1 parent 3f34700 commit 6e4c0a8
Show file tree
Hide file tree
Showing 19 changed files with 2 additions and 629 deletions.
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ help:
@echo -e "${PURPLE}\tdocs: https://owncloud.dev/ocis/development/testing/#testing-with-test-suite-natively-installed${RESET}\n"
@echo -e "\tmake test-acceptance-api\t\t${BLUE}run API acceptance tests${RESET}"
@echo -e "\tmake test-acceptance-from-core-api\t\t${BLUE}run core API acceptance tests${RESET}"
@echo -e "\tmake test-paralleldeployment-api\t${BLUE}run API acceptance tests for parallel deployment${RESET}"
@echo -e "\tmake clean-tests\t\t\t${BLUE}delete API tests framework dependencies${RESET}"
@echo
@echo -e "${BLACK}---------------------------------------------------------${RESET}"
Expand Down Expand Up @@ -123,8 +122,6 @@ clean-tests:
@rm -Rf vendor-bin/**/vendor vendor-bin/**/composer.lock tests/acceptance/output

BEHAT_BIN=vendor-bin/behat/vendor/bin/behat
# behat config file for parallel deployment tests
PARALLEL_BEHAT_YML=tests/parallelDeployAcceptance/config/behat.yml
# behat config file for core api tests
CORE_BEHAT_YML=tests/acceptance/config/behat-core.yml

Expand All @@ -136,10 +133,6 @@ test-acceptance-api: vendor-bin/behat/vendor
test-acceptance-from-core-api: vendor-bin/behat/vendor
BEHAT_BIN=$(BEHAT_BIN) BEHAT_YML=$(CORE_BEHAT_YML) $(PWD)/tests/acceptance/run.sh --type core-api

.PHONY: test-paralleldeployment-api
test-paralleldeployment-api: vendor-bin/behat/vendor
BEHAT_BIN=$(BEHAT_BIN) BEHAT_YML=$(PARALLEL_BEHAT_YML) $(PWD)/tests/acceptance/run.sh

vendor/bamarni/composer-bin-plugin: composer.lock
composer install

Expand Down
31 changes: 0 additions & 31 deletions tests/acceptance/TestHelpers/HttpRequestHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,6 @@
class HttpRequestHelper {
public const HTTP_TOO_EARLY = 425;
public const HTTP_CONFLICT = 409;
private static ?string $oCSelectorCookie = null;

/**
* @return string
*/
public static function getOCSelectorCookie(): string {
return self::$oCSelectorCookie;
}

/**
* @param string $oCSelectorCookie "owncloud-selector=oc10;path=/;"
*
* @return void
*/
public static function setOCSelectorCookie(string $oCSelectorCookie): void {
self::$oCSelectorCookie = $oCSelectorCookie;
}

/**
* Some systems-under-test do async post-processing of operations like upload,
Expand Down Expand Up @@ -409,20 +392,6 @@ public static function createRequest(
$headers['Content-Type'] = 'application/x-www-form-urlencoded';
}

if (OcisHelper::isTestingParallelDeployment()) {
// oCIS cannot handle '/apps/testing' endpoints
// so those requests must be redirected to oC10 server
// change server to oC10 if the request url has `/apps/testing`
if (strpos($url, "/apps/testing") !== false) {
$oCISServerUrl = \getenv('TEST_SERVER_URL');
$oC10ServerUrl = \getenv('TEST_OC10_URL');
$url = str_replace($oCISServerUrl, $oC10ServerUrl, $url);
} else {
// set 'owncloud-server' selector cookie for oCIS requests
$headers['Cookie'] = self::getOCSelectorCookie();
}
}

$request = new Request(
$method,
$url,
Expand Down
7 changes: 0 additions & 7 deletions tests/acceptance/TestHelpers/OcisHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ public static function isTestingOnReva():bool {
return (\getenv("TEST_REVA") === "true");
}

/**
* @return bool
*/
public static function isTestingParallelDeployment(): bool {
return (\getenv("TEST_PARALLEL_DEPLOYMENT") === "true");
}

/**
* @return bool|string false if no command given or the command as string
*/
Expand Down
21 changes: 0 additions & 21 deletions tests/acceptance/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,24 +214,6 @@ public function isUsingSharingNG(): bool {
return $this->useSharingNG;
}

private string $oCSelector;

/**
* @param string $selector
*
* @return void
*/
public function setOCSelector(string $selector): void {
$this->oCSelector = $selector;
}

/**
* @return string
*/
public function getOCSelector(): string {
return $this->oCSelector;
}

/**
* @param string|null $httpStatusCode
*
Expand Down Expand Up @@ -502,9 +484,6 @@ public function __construct(
$this->cookieJar = new CookieJar();
$this->ocPath = $ocPath;

// PARALLEL DEPLOYMENT: ownCloud selector
$this->oCSelector = "oc10";

// These passwords are referenced in tests and can be overridden by
// setting environment variables.
$this->alt1UserPassword = "1234";
Expand Down
11 changes: 0 additions & 11 deletions tests/acceptance/bootstrap/Provisioning.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,13 +352,6 @@ public function connectToLdap(array $suiteParameters):void {
$this->ldap->bind();

$ldifFile = __DIR__ . $suiteParameters['ldapInitialUserFilePath'];
if (OcisHelper::isTestingParallelDeployment()) {
$behatYml = \getenv("BEHAT_YML");
if ($behatYml) {
$configPath = \dirname($behatYml);
$ldifFile = $configPath . "/" . \basename($ldifFile);
}
}
if (!$this->skipImportLdif) {
$this->importLdifFile($ldifFile);
}
Expand Down Expand Up @@ -458,10 +451,6 @@ public function createLdapUser(array $setting):void {
$entry['ownCloudUUID'] = WebDavHelper::generateUUIDv4();
}

if (OcisHelper::isTestingParallelDeployment()) {
$entry['ownCloudSelector'] = $this->getOCSelector();
}

if ($this->federatedServerExists()) {
if (!\in_array($setting['userid'], $this->ldapCreatedUsers)) {
$this->ldap->add($newDN, $entry);
Expand Down
28 changes: 2 additions & 26 deletions tests/acceptance/docker/src/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,7 @@ git config --global advice.detachedHead false

## CONFIGURE TEST

if [ "$TEST_SOURCE" = "oc10" ]
then
if [ "$STORAGE_DRIVER" = "ocis" ]
then
export OCIS_REVA_DATA_ROOT=''
export BEHAT_FILTER_TAGS='~@skipOnOcis-OCIS-Storage'
export OCIS_SKELETON_STRATEGY='upload'
export EXPECTED_FAILURES_FILE='/drone/src/tests/acceptance/expected-failures-API-on-OCIS-storage.md'
elif [ "$STORAGE_DRIVER" = "s3ng" ]
then
export BEHAT_FILTER_TAGS='~@skip&&~@skipOnOcis-S3NG-Storage'
export OCIS_REVA_DATA_ROOT=''
export OCIS_SKELETON_STRATEGY='upload'
else
echo "non existing STORAGE selected"
exit 1
fi

unset BEHAT_SUITE

elif [ "$TEST_SOURCE" = "ocis" ]
if [ "$TEST_SOURCE" = "ocis" ]
then

if [ "$STORAGE_DRIVER" = "ocis" ]
Expand Down Expand Up @@ -67,11 +47,7 @@ fi

## RUN TEST

if [ "$TEST_SOURCE" = "oc10" ]
then
sleep 10
make -C $OCIS_ROOT test-acceptance-from-core-api
elif [ "$TEST_SOURCE" = "ocis" ]
if [ "$TEST_SOURCE" = "ocis" ]
then
sleep 10
make -C $OCIS_ROOT test-acceptance-api
Expand Down
2 changes: 0 additions & 2 deletions tests/parallelDeployAcceptance/.gitignore

This file was deleted.

35 changes: 0 additions & 35 deletions tests/parallelDeployAcceptance/config/behat.yml

This file was deleted.

7 changes: 0 additions & 7 deletions tests/parallelDeployAcceptance/config/ldap_users_groups.ldif

This file was deleted.

This file was deleted.

33 changes: 0 additions & 33 deletions tests/parallelDeployAcceptance/drone/oc10/10-custom-config.sh

This file was deleted.

53 changes: 0 additions & 53 deletions tests/parallelDeployAcceptance/drone/oc10/ldap-config.tmpl.json

This file was deleted.

22 changes: 0 additions & 22 deletions tests/parallelDeployAcceptance/drone/oc10/oidc.config.php

This file was deleted.

Loading

0 comments on commit 6e4c0a8

Please sign in to comment.