Skip to content

Commit

Permalink
Merge pull request #9900 from owncloud/cleanup-parallel-deployment
Browse files Browse the repository at this point in the history
[tests-only][full-ci] cleanup ocis/oc10 parallel-deployment tests
  • Loading branch information
saw-jan authored Sep 10, 2024
2 parents e224264 + 2506502 commit 2b8ba4f
Show file tree
Hide file tree
Showing 19 changed files with 0 additions and 653 deletions.
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ help:
@echo -e "${GREEN}Testing with test suite natively installed:${RESET}\n"
@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-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 @@ -122,17 +121,11 @@ 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

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

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

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

Expand Down
50 changes: 0 additions & 50 deletions docs/ocis/development/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,56 +419,6 @@ BEHAT_FEATURE="tests/acceptance/features/apiSearchContent/contentSearch.feature"
make test-acceptance-api
```

## Running Tests for Parallel Deployment

### Setup the Parallel Deployment Environment

Instruction on setup is available [here](https://owncloud.dev/ocis/deployment/oc10_ocis_parallel/#local-setup)

Edit the `.env` file and uncomment this line:

```bash
COMPOSE_FILE=docker-compose.yml:testing/docker-compose-additions.yml
```

Start the docker stack with the following command:

```bash
docker-compose up -d
```

### Getting the Test Helpers

All the test helpers are located in the core repo.

```bash
git clone https://github.com/owncloud/core.git
```

### Run the Acceptance Tests

Run the acceptance tests with the following command from the root of the oCIS repository:

```bash
make test-paralleldeployment-api \
TEST_SERVER_URL="https://cloud.owncloud.test" \
TEST_OC10_URL="http://localhost:8080" \
TEST_PARALLEL_DEPLOYMENT=true \
TEST_WITH_LDAP=true \
PATH_TO_CORE="<path_to_core>" \
SKELETON_DIR="<path_to_core>/apps/testing/data/apiSkeleton"
```

Replace `<path_to_core>` with the actual path to the root directory of core repo that you have cloned earlier.

In order to run a single test, use the `BEHAT_FEATURE` environment variable.

```bash
make test-paralleldeployment-api \
... \
BEHAT_FEATURE="tests/parallelDeployAcceptance/features/apiShareManagement/acceptShares.feature"
```

## Running Test Suite With Antivirus Service (@antivirus)
Test suites that are tagged with `@antivirus` require antivirus service. The available antivirus and the configuration related to them can be found [here](https://doc.owncloud.com/ocis/next/deployment/services/s-list/antivirus.html). This documentation is only going to use `clamAv` as antivirus.

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
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 2b8ba4f

Please sign in to comment.