From 415a4b5f56a00a070b577770be384e65127a061a Mon Sep 17 00:00:00 2001 From: Niraj Acharya Date: Mon, 26 Aug 2024 12:12:56 +0545 Subject: [PATCH] removing `test-acceptance-from-core-api` and merging core and api behat config files to use single command to run api tests --- .drone.star | 3 +- Makefile | 11 +- tests/acceptance/config/behat-core.yml | 334 ----------------------- tests/acceptance/config/behat.yml | 316 +++++++++++++++++++++ tests/acceptance/docker/src/run-tests.sh | 13 +- 5 files changed, 325 insertions(+), 352 deletions(-) delete mode 100644 tests/acceptance/config/behat-core.yml diff --git a/.drone.star b/.drone.star index 6755c99df28..0fc38fb7156 100644 --- a/.drone.star +++ b/.drone.star @@ -1129,12 +1129,13 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", ac "BEHAT_FILTER_TAGS": filterTags, "DIVIDE_INTO_NUM_PARTS": number_of_parts, "RUN_PART": part_number, + "ACCEPTANCE_TEST_TYPE": "core-api", "EXPECTED_FAILURES_FILE": expectedFailuresFile, "UPLOAD_DELETE_WAIT_TIME": "1" if storage == "owncloud" else 0, "OCIS_WRAPPER_URL": "http://ocis-server:5200", }, "commands": [ - "make -C %s test-acceptance-from-core-api" % (dirs["base"]), + "make -C %s test-acceptance-api" % (dirs["base"]), ], }, ] + diff --git a/Makefile b/Makefile index 5c2a3060571..d031aa36af9 100644 --- a/Makefile +++ b/Makefile @@ -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-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 @@ -125,20 +124,14 @@ clean-tests: 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 .PHONY: test-acceptance-api test-acceptance-api: vendor-bin/behat/vendor - BEHAT_BIN=$(BEHAT_BIN) $(PWD)/tests/acceptance/run.sh - -.PHONY: test-acceptance-from-core-api -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 + 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) $(PWD)/tests/acceptance/run.sh + BEHAT_BIN=$(BEHAT_BIN) BEHAT_YML=$(PARALLEL_BEHAT_YML) tests/acceptance/run.sh vendor/bamarni/composer-bin-plugin: composer.lock composer install diff --git a/tests/acceptance/config/behat-core.yml b/tests/acceptance/config/behat-core.yml deleted file mode 100644 index 1d3ae9c1f5d..00000000000 --- a/tests/acceptance/config/behat-core.yml +++ /dev/null @@ -1,334 +0,0 @@ -default: - autoload: - "": "%paths.base%/../bootstrap" - suites: - coreApiMain: - paths: - - "%paths.base%/../features/coreApiMain" - context: &common_ldap_suite_context - parameters: - ldapAdminPassword: admin - ldapUsersOU: TestUsers - ldapGroupsOU: TestGroups - ldapInitialUserFilePath: /../config/ldap-users.ldif - contexts: - - FeatureContext: &common_feature_context_params - baseUrl: http://localhost:8080 - adminUsername: admin - adminPassword: admin - regularUserPassword: 123456 - ocPath: apps/testing/api/v1/occ - - ChecksumContext: - - FilesVersionsContext: - - TrashbinContext: - - CapabilitiesContext: - - SharingNgContext: - - coreApiAuth: - paths: - - "%paths.base%/../features/coreApiAuth" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - SearchContext: - - PublicWebDavContext: - - WebDavPropertiesContext: - - AuthContext: - - coreApiCapabilities: - paths: - - "%paths.base%/../features/coreApiCapabilities" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - CapabilitiesContext: - - coreApiFavorites: - paths: - - "%paths.base%/../features/coreApiFavorites" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - SpacesContext: - - FavoritesContext: - - WebDavPropertiesContext: - - SharingNgContext: - - coreApiShareCreateSpecialToShares1: - paths: - - "%paths.base%/../features/coreApiShareCreateSpecialToShares1" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - TrashbinContext: - - WebDavPropertiesContext: - - SettingsContext: - - coreApiShareCreateSpecialToShares2: - paths: - - "%paths.base%/../features/coreApiShareCreateSpecialToShares2" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - TrashbinContext: - - WebDavPropertiesContext: - - SettingsContext: - - SharingNgContext: - - coreApiSharees: - paths: - - "%paths.base%/../features/coreApiSharees" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - ShareesContext: - - OcisConfigContext: - - coreApiShareManagementToShares: - paths: - - "%paths.base%/../features/coreApiShareManagementToShares" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - SpacesContext: - - PublicWebDavContext: - - TrashbinContext: - - WebDavPropertiesContext: - - FilesVersionsContext: - - SettingsContext: - - SharingNgContext: - - coreApiShareManagementBasicToShares: - paths: - - "%paths.base%/../features/coreApiShareManagementBasicToShares" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - PublicWebDavContext: - - TrashbinContext: - - WebDavPropertiesContext: - - AuthContext: - - SharingNgContext: - - coreApiShareOperationsToShares1: - paths: - - "%paths.base%/../features/coreApiShareOperationsToShares1" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - PublicWebDavContext: - - TrashbinContext: - - WebDavPropertiesContext: - - SettingsContext: - - SharingNgContext: - - coreApiShareOperationsToShares2: - paths: - - "%paths.base%/../features/coreApiShareOperationsToShares2" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - PublicWebDavContext: - - TrashbinContext: - - WebDavPropertiesContext: - - SharingNgContext: - - coreApiSharePublicLink1: - paths: - - "%paths.base%/../features/coreApiSharePublicLink1" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - PublicWebDavContext: - - TrashbinContext: - - SharingNgContext: - - WebDavPropertiesContext: - - OcisConfigContext: - - coreApiSharePublicLink2: - paths: - - "%paths.base%/../features/coreApiSharePublicLink2" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - PublicWebDavContext: - - TrashbinContext: - - WebDavPropertiesContext: - - OcisConfigContext: - - SharingNgContext: - - coreApiShareUpdateToShares: - paths: - - "%paths.base%/../features/coreApiShareUpdateToShares" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - PublicWebDavContext: - - TrashbinContext: - - WebDavPropertiesContext: - - SharingNgContext: - - coreApiTrashbin: - paths: - - "%paths.base%/../features/coreApiTrashbin" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - TrashbinContext: - - WebDavPropertiesContext: - - SharingNgContext: - - coreApiTrashbinRestore: - paths: - - "%paths.base%/../features/coreApiTrashbinRestore" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - TrashbinContext: - - WebDavPropertiesContext: - - coreApiVersions: - paths: - - "%paths.base%/../features/coreApiVersions" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - ChecksumContext: - - FilesVersionsContext: - - WebDavPropertiesContext: - - TrashbinContext: - - SharingNgContext: - - coreApiWebdavDelete: - paths: - - "%paths.base%/../features/coreApiWebdavDelete" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - SearchContext: - - PublicWebDavContext: - - WebDavPropertiesContext: - - TrashbinContext: - - coreApiWebdavLocks: - paths: - - "%paths.base%/../features/coreApiWebdavLocks" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - PublicWebDavContext: - - WebDavLockingContext: - - WebDavPropertiesContext: - - coreApiWebdavLocks2: - paths: - - "%paths.base%/../features/coreApiWebdavLocks2" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - PublicWebDavContext: - - WebDavLockingContext: - - WebDavPropertiesContext: - - coreApiWebdavMove1: - paths: - - "%paths.base%/../features/coreApiWebdavMove1" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - WebDavPropertiesContext: - - TrashbinContext: - - coreApiWebdavMove2: - paths: - - "%paths.base%/../features/coreApiWebdavMove2" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - SharingNgContext: - - WebDavPropertiesContext: - - FilesVersionsContext: - - TrashbinContext: - - coreApiWebdavOperations: - paths: - - "%paths.base%/../features/coreApiWebdavOperations" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - SearchContext: - - PublicWebDavContext: - - SharingNgContext: - - WebDavPropertiesContext: - - TrashbinContext: - - OcisConfigContext: - - coreApiWebdavPreviews: - paths: - - "%paths.base%/../features/coreApiWebdavPreviews" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - SharingNgContext: - - WebDavPropertiesContext: - - coreApiWebdavProperties: - paths: - - "%paths.base%/../features/coreApiWebdavProperties" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - SharingNgContext: - - WebDavPropertiesContext: - - coreApiWebdavUpload: - paths: - - "%paths.base%/../features/coreApiWebdavUpload" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - PublicWebDavContext: - - WebDavPropertiesContext: - - SharingNgContext: - - coreApiWebdavUploadTUS: - paths: - - "%paths.base%/../features/coreApiWebdavUploadTUS" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - PublicWebDavContext: - - TUSContext: - - FilesVersionsContext: - - ChecksumContext: - - SharingNgContext: - - coreApiWebdavEtagPropagation1: - paths: - - "%paths.base%/../features/coreApiWebdavEtagPropagation1" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - TrashbinContext: - - PublicWebDavContext: - - FilesVersionsContext: - - SharingNgContext: - - WebDavPropertiesContext: - - coreApiWebdavEtagPropagation2: - paths: - - "%paths.base%/../features/coreApiWebdavEtagPropagation2" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - - TrashbinContext: - - PublicWebDavContext: - - FilesVersionsContext: - - SharingNgContext: - - WebDavPropertiesContext: - - OcisConfigContext: - - extensions: - rdx\behatvars\BehatVariablesExtension: ~ - - Cjm\Behat\StepThroughExtension: ~ diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index 3ff29e1b548..74cc8b559d1 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -424,6 +424,322 @@ default: - TagContext: - TrashbinContext: + coreApiMain: + paths: + - "%paths.base%/../features/coreApiMain" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - ChecksumContext: + - FilesVersionsContext: + - TrashbinContext: + - CapabilitiesContext: + - SharingNgContext: + + coreApiAuth: + paths: + - "%paths.base%/../features/coreApiAuth" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - SearchContext: + - PublicWebDavContext: + - WebDavPropertiesContext: + - AuthContext: + + coreApiCapabilities: + paths: + - "%paths.base%/../features/coreApiCapabilities" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - CapabilitiesContext: + + coreApiFavorites: + paths: + - "%paths.base%/../features/coreApiFavorites" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - SpacesContext: + - FavoritesContext: + - WebDavPropertiesContext: + - SharingNgContext: + + coreApiShareCreateSpecialToShares1: + paths: + - "%paths.base%/../features/coreApiShareCreateSpecialToShares1" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - TrashbinContext: + - WebDavPropertiesContext: + - SettingsContext: + + coreApiShareCreateSpecialToShares2: + paths: + - "%paths.base%/../features/coreApiShareCreateSpecialToShares2" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - TrashbinContext: + - WebDavPropertiesContext: + - SettingsContext: + - SharingNgContext: + + coreApiSharees: + paths: + - "%paths.base%/../features/coreApiSharees" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - ShareesContext: + - OcisConfigContext: + + coreApiShareManagementToShares: + paths: + - "%paths.base%/../features/coreApiShareManagementToShares" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - SpacesContext: + - PublicWebDavContext: + - TrashbinContext: + - WebDavPropertiesContext: + - FilesVersionsContext: + - SettingsContext: + - SharingNgContext: + + coreApiShareManagementBasicToShares: + paths: + - "%paths.base%/../features/coreApiShareManagementBasicToShares" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - TrashbinContext: + - WebDavPropertiesContext: + - AuthContext: + - SharingNgContext: + + coreApiShareOperationsToShares1: + paths: + - "%paths.base%/../features/coreApiShareOperationsToShares1" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - TrashbinContext: + - WebDavPropertiesContext: + - SettingsContext: + - SharingNgContext: + + coreApiShareOperationsToShares2: + paths: + - "%paths.base%/../features/coreApiShareOperationsToShares2" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - TrashbinContext: + - WebDavPropertiesContext: + - SharingNgContext: + + coreApiSharePublicLink1: + paths: + - "%paths.base%/../features/coreApiSharePublicLink1" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - TrashbinContext: + - SharingNgContext: + - WebDavPropertiesContext: + - OcisConfigContext: + + coreApiSharePublicLink2: + paths: + - "%paths.base%/../features/coreApiSharePublicLink2" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - TrashbinContext: + - WebDavPropertiesContext: + - OcisConfigContext: + - SharingNgContext: + + coreApiShareUpdateToShares: + paths: + - "%paths.base%/../features/coreApiShareUpdateToShares" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - TrashbinContext: + - WebDavPropertiesContext: + - SharingNgContext: + + coreApiTrashbin: + paths: + - "%paths.base%/../features/coreApiTrashbin" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - TrashbinContext: + - WebDavPropertiesContext: + - SharingNgContext: + + coreApiTrashbinRestore: + paths: + - "%paths.base%/../features/coreApiTrashbinRestore" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - TrashbinContext: + - WebDavPropertiesContext: + + coreApiVersions: + paths: + - "%paths.base%/../features/coreApiVersions" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - ChecksumContext: + - FilesVersionsContext: + - WebDavPropertiesContext: + - TrashbinContext: + - SharingNgContext: + + coreApiWebdavDelete: + paths: + - "%paths.base%/../features/coreApiWebdavDelete" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - SearchContext: + - PublicWebDavContext: + - WebDavPropertiesContext: + - TrashbinContext: + + coreApiWebdavLocks: + paths: + - "%paths.base%/../features/coreApiWebdavLocks" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - WebDavLockingContext: + - WebDavPropertiesContext: + + coreApiWebdavLocks2: + paths: + - "%paths.base%/../features/coreApiWebdavLocks2" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - WebDavLockingContext: + - WebDavPropertiesContext: + + coreApiWebdavMove1: + paths: + - "%paths.base%/../features/coreApiWebdavMove1" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - WebDavPropertiesContext: + - TrashbinContext: + + coreApiWebdavMove2: + paths: + - "%paths.base%/../features/coreApiWebdavMove2" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - SharingNgContext: + - WebDavPropertiesContext: + - FilesVersionsContext: + - TrashbinContext: + + coreApiWebdavOperations: + paths: + - "%paths.base%/../features/coreApiWebdavOperations" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - SearchContext: + - PublicWebDavContext: + - SharingNgContext: + - WebDavPropertiesContext: + - TrashbinContext: + - OcisConfigContext: + + coreApiWebdavPreviews: + paths: + - "%paths.base%/../features/coreApiWebdavPreviews" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - SharingNgContext: + - WebDavPropertiesContext: + + coreApiWebdavProperties: + paths: + - "%paths.base%/../features/coreApiWebdavProperties" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - SharingNgContext: + - WebDavPropertiesContext: + + coreApiWebdavUpload: + paths: + - "%paths.base%/../features/coreApiWebdavUpload" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - WebDavPropertiesContext: + - SharingNgContext: + + coreApiWebdavUploadTUS: + paths: + - "%paths.base%/../features/coreApiWebdavUploadTUS" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - PublicWebDavContext: + - TUSContext: + - FilesVersionsContext: + - ChecksumContext: + - SharingNgContext: + + coreApiWebdavEtagPropagation1: + paths: + - "%paths.base%/../features/coreApiWebdavEtagPropagation1" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - TrashbinContext: + - PublicWebDavContext: + - FilesVersionsContext: + - SharingNgContext: + - WebDavPropertiesContext: + + coreApiWebdavEtagPropagation2: + paths: + - "%paths.base%/../features/coreApiWebdavEtagPropagation2" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + - TrashbinContext: + - PublicWebDavContext: + - FilesVersionsContext: + - SharingNgContext: + - WebDavPropertiesContext: + - OcisConfigContext: + extensions: rdx\behatvars\BehatVariablesExtension: ~ diff --git a/tests/acceptance/docker/src/run-tests.sh b/tests/acceptance/docker/src/run-tests.sh index 09808f77376..098365953b3 100644 --- a/tests/acceptance/docker/src/run-tests.sh +++ b/tests/acceptance/docker/src/run-tests.sh @@ -9,6 +9,7 @@ git config --global advice.detachedHead false if [ "$TEST_SOURCE" = "oc10" ] then + export ACCEPTANCE_TEST_TYPE='core-api' if [ "$STORAGE_DRIVER" = "ocis" ] then export OCIS_REVA_DATA_ROOT='' @@ -67,17 +68,13 @@ fi ## RUN TEST -if [ "$TEST_SOURCE" = "oc10" ] -then - sleep 10 - make -C $OCIS_ROOT test-acceptance-from-core-api -elif [ "$TEST_SOURCE" = "ocis" ] +if [[ -z "$TEST_SOURCE" ]] then - sleep 10 - make -C $OCIS_ROOT test-acceptance-api -else echo "non existing TEST_SOURCE selected" exit 1 +else + sleep 10 + make -C $OCIS_ROOT test-acceptance-api fi chmod -R 777 vendor-bin/**/vendor vendor-bin/**/composer.lock tests/acceptance/output