-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update acceptance test docs (#4965)
* docs: fix docs for running acceptance tests docs: add makefile docs: add README in acceptance level docs: update configs * Update README.md
- Loading branch information
Showing
15 changed files
with
372 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
.PHONY: help | ||
help: | ||
@echo "Usage: make [target]" | ||
@echo "Available targets:" | ||
@echo " reva Start reva with ocis storage" | ||
@echo " reva-posix Start reva with posixfs storage" | ||
@echo " reva-s3ng Start reva with s3ng storage" | ||
|
||
CURR_DIR:=$(dir $(abspath $(firstword $(MAKEFILE_LIST)))) | ||
REVA_CMD:=$(abspath $(CURR_DIR)/../../cmd/revad/revad) | ||
CONFIG_DIR:=$(abspath $(CURR_DIR)/../oc-integration-tests/local) | ||
|
||
.PHONY: ldap | ||
ldap: | ||
@docker run --rm -d \ | ||
--name docker-slapd \ | ||
-e LDAP_TLS_VERIFY_CLIENT=never \ | ||
-e LDAP_DOMAIN=owncloud.com \ | ||
-e LDAP_ORGANISATION=ownCloud \ | ||
-e LDAP_ADMIN_PASSWORD=admin \ | ||
-p 389:389 \ | ||
-p 636:636 \ | ||
osixia/openldap:1.3.0 | ||
|
||
.PHONY: redis | ||
redis: | ||
@docker run --rm -d \ | ||
--name redis \ | ||
-e REDIS_DATABASES=1 \ | ||
-p 6379:6379 \ | ||
redis:6-alpine | ||
|
||
.PHONY: ceph | ||
ceph: | ||
@docker run --rm -d \ | ||
--name ceph \ | ||
-e CEPH_DAEMON=demo \ | ||
-e NETWORK_AUTO_DETECT=1 \ | ||
-e MON_IP=0.0.0.0 \ | ||
-e CEPH_PUBLIC_NETWORK=0.0.0.0/0 \ | ||
-e RGW_NAME=localhost \ | ||
-e CEPH_DEMO_UID=test-user \ | ||
-e CEPH_DEMO_ACCESS_KEY=testadmin \ | ||
-e CEPH_DEMO_SECRET_KEY=testadmin \ | ||
-e CEPH_DEMO_BUCKET=test \ | ||
-p 8080:8080 \ | ||
ceph/daemon | ||
@echo "Waiting for ceph to be ready..." | ||
@while [ `curl -s http://localhost:8080 -w %{http_code} -o /dev/null` -ne 200 ]; do sleep 1; done | ||
|
||
.PHONY: reva-services | ||
reva-services: | ||
@$(REVA_CMD) -c $(CONFIG_DIR)/frontend.toml & | ||
@$(REVA_CMD) -c $(CONFIG_DIR)/gateway.toml & | ||
@$(REVA_CMD) -c $(CONFIG_DIR)/shares.toml & | ||
@$(REVA_CMD) -c $(CONFIG_DIR)/storage-shares.toml & | ||
@$(REVA_CMD) -c $(CONFIG_DIR)/storage-publiclink.toml & | ||
@$(REVA_CMD) -c $(CONFIG_DIR)/machine-auth.toml & | ||
@$(REVA_CMD) -c $(CONFIG_DIR)/permissions-ocis-ci.toml & | ||
@$(REVA_CMD) -c $(CONFIG_DIR)/ldap-users.toml & | ||
|
||
.PHONY: reva | ||
reva: ldap reva-services | ||
@echo "Running reva with ocis storage" | ||
@$(REVA_CMD) -c $(CONFIG_DIR)/storage-users.toml | ||
|
||
.PHONY: reva-posix | ||
reva-posix: ldap redis reva-services | ||
@echo "Running reva with posixfs storage" | ||
@$(REVA_CMD) -c $(CONFIG_DIR)/storage-users-posixfs.toml | ||
|
||
.PHONY: reva-s3ng | ||
reva-s3ng: ldap ceph reva-services | ||
@echo "Running reva with posixfs storage" | ||
@$(REVA_CMD) -c $(CONFIG_DIR)/storage-users-s3ng.toml | ||
|
||
.PHONY: clean | ||
clean: | ||
@docker ps -q --filter "name=docker-slapd" | xargs -r docker stop | ||
@docker ps -q --filter "name=redis" | xargs -r docker stop | ||
@docker ps -q --filter "name=ceph" | xargs -r docker stop | ||
@pkill revad || true | ||
@rm -rf /tmp/reva |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
## Acceptance Tests (ownCloud Legacy) | ||
|
||
This will require some PHP-related tools to run, for instance on Ubuntu you will need `apt install -y php-xml php-curl composer`. | ||
|
||
1. [Build reva](https://github.com/cs3org/reva/tree/edge?tab=readme-ov-file#build) | ||
|
||
2. Start the reva server (with ocis storage driver) | ||
|
||
```bash | ||
make reva | ||
``` | ||
|
||
> **INFO:** | ||
> | ||
> You can run reva with other storage drivers. | ||
> | ||
> To run reva with `posix` storage driver: | ||
> | ||
> ```bash | ||
> make reva-posix | ||
> ``` | ||
> | ||
> To run reva with `s3ng` storage driver: | ||
> | ||
> ```bash | ||
> make reva-s3ng | ||
> ``` | ||
3. Get ownCloud Infinite Scale `OCIS` | ||
```bash | ||
git clone https://github.com/owncloud/ocis.git ./testrunner | ||
``` | ||
4. To run the correct version of the testsuite check out the commit id from the `.drone.env` file | ||
|
||
```bash | ||
cd testrunner | ||
git checkout <commit-id> | ||
``` | ||
|
||
5. Run the tests | ||
|
||
```bash | ||
TEST_SERVER_URL='http://localhost:20080' \ | ||
TEST_REVA='true' \ | ||
TEST_WITH_LDAP='true' \ | ||
OCIS_REVA_DATA_ROOT='/tmp/reva/' \ | ||
DELETE_USER_DATA_CMD="rm -rf /tmp/reva/data/nodes/root/* /tmp/reva/data/nodes/*-*-*-* /tmp/reva/data/blobs/*" \ | ||
SKELETON_DIR='./apps/testing/data/apiSkeleton' \ | ||
REVA_LDAP_HOSTNAME='localhost' \ | ||
BEHAT_FILTER_TAGS='~@skip&&~@skipOnReva' \ | ||
EXPECTED_FAILURES_FILE=<path-to-reva>/tests/acceptance/expected-failures-on-OCIS-storage.md \ | ||
DIVIDE_INTO_NUM_PARTS=1 \ | ||
RUN_PART=1 \ | ||
ACCEPTANCE_TEST_TYPE=core-api \ | ||
make test-acceptance-api | ||
``` | ||
|
||
This will run all tests that are relevant to reva. | ||
|
||
To run a single test add `BEHAT_FEATURE=<feature file>` and specify the path to the feature file and an optional line number. | ||
For example: | ||
|
||
```bash | ||
... | ||
BEHAT_FEATURE='tests/acceptance/features/coreApiWebdavUpload/uploadFile.feature:20' \ | ||
make test-acceptance-api | ||
``` | ||
|
||
**NOTE:** | ||
Make sure to double check the paths if you are changing the `OCIS_REVA_DATA_ROOT`. The `DELETE_USER_DATA_CMD` needs to clean up the correct folders. | ||
|
||
> **INFO:** | ||
> | ||
> Use these proper environment variables to run tests with different storage drivers: | ||
> | ||
> 1. Run tests with `s3ng` storage driver: | ||
> | ||
> ```bash | ||
> ... | ||
> DELETE_USER_DATA_CMD="rm -rf /tmp/reva/data/spaces/* /tmp/reva/data/blobs/* /tmp/reva/data/indexes/by-type/*" \ | ||
> EXPECTED_FAILURES_FILE=<path-to-reva>/tests/acceptance/expected-failures-on-S3NG-storage.md \ | ||
> make test-acceptance-api | ||
> ``` | ||
> | ||
> 2. Run tests with `posix` storage driver: | ||
> | ||
> ```bash | ||
> ... | ||
> DELETE_USER_DATA_CMD="bash -cx 'rm -rf /tmp/reva/data/users/* /tmp/reva/data/indexes/by-type/*'" \ | ||
> EXPECTED_FAILURES_FILE=<path-to-reva>/tests/acceptance/expected-failures-on-POSIX-storage.md \ | ||
> make test-acceptance-api | ||
> ``` | ||
6. Cleanup the setup | ||
```bash | ||
make clean | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.