Merge pull request #360 from opencloud-eu/runE2EInCI

Run E2E tests in CI
This commit is contained in:
Artur Neumann
2025-03-13 19:08:45 +05:45
committed by GitHub
parent 66508c2518
commit 9e80334e8d
7 changed files with 36 additions and 31 deletions

View File

@@ -1,3 +0,0 @@
# The test runner source for UI tests
WEB_COMMITID=8222156ec19d5a201ba3eb9293c1cd4516329400
WEB_BRANCH=stable-11.0

3
.woodpecker.env Normal file
View File

@@ -0,0 +1,3 @@
# The test runner source for UI tests
WEB_COMMITID=ca1353b89f74602a9f60674543d5703ff83dfe7d
WEB_BRANCH=main

View File

@@ -304,9 +304,9 @@ config = {
}, },
"e2eTests": { "e2eTests": {
"part": { "part": {
"skip": True, "skip": False,
"totalParts": 4, # divide and run all suites in parts (divide pipelines) "totalParts": 4, # divide and run all suites in parts (divide pipelines)
"xsuites": ["search", "app-provider", "oidc", "ocm"], # suites to skip "xsuites": ["search", "app-provider", "app-provider-onlyOffice", "app-store", "keycloak", "oidc", "ocm"], # suites to skip
}, },
"search": { "search": {
"skip": True, "skip": True,
@@ -1198,7 +1198,11 @@ def e2eTestPipeline(ctx):
} }
extra_server_environment = { extra_server_environment = {
"OCIS_PASSWORD_POLICY_BANNED_PASSWORDS_LIST": "%s" % dirs["bannedPasswordList"], "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST": "%s" % dirs["bannedPasswordList"],
"OC_SHOW_USER_EMAIL_IN_RESULTS": True,
"FRONTEND_OCS_ENABLE_DENIALS": True,
# Needed for enabling all roles
"GRAPH_AVAILABLE_ROLES": "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5,a8d5fe5e-96e3-418d-825b-534dbdf22b99,fb6c3e19-e378-47e5-b277-9732f9de6e21,58c63c02-1d89-4572-916a-870abc5a1b7d,2d00ce52-1fc2-4dbc-8b95-a73b73395f5a,1c996275-f1c9-4e71-abdf-a42f6495e960,312c0871-5ef7-4b3a-85b6-0e4074c64049,aa97fe03-7980-45ac-9e50-b325749fd7e6,63e64e19-8d43-42ec-a738-2b6af2610efa",
} }
e2e_trigger = [ e2e_trigger = [
@@ -1255,7 +1259,7 @@ def e2eTestPipeline(ctx):
"name": "e2e-tests", "name": "e2e-tests",
"image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
"environment": { "environment": {
"BASE_URL_OCIS": OC_DOMAIN, "OC_BASE_URL": OC_DOMAIN,
"HEADLESS": True, "HEADLESS": True,
"RETRY": "1", "RETRY": "1",
"WEB_UI_CONFIG_FILE": "%s/%s" % (dirs["base"], dirs["opencloudConfig"]), "WEB_UI_CONFIG_FILE": "%s/%s" % (dirs["base"], dirs["opencloudConfig"]),
@@ -1267,7 +1271,8 @@ def e2eTestPipeline(ctx):
} }
# steps_after = uploadTracingResult(ctx) + \ # steps_after = uploadTracingResult(ctx) + \
steps_after = logTracingResults() # steps_after = logTracingResults()
steps_after = []
if params["totalParts"]: if params["totalParts"]:
for index in range(params["totalParts"]): for index in range(params["totalParts"]):
@@ -2720,15 +2725,15 @@ def setupForLitmus():
], ],
}] }]
def getDroneEnvAndCheckScript(ctx): def getWoodpeckerEnvAndCheckScript(ctx):
ocis_git_base_url = "https://raw.githubusercontent.com/opencloud-eu/opencloud" opencloud_git_base_url = "https://raw.githubusercontent.com/opencloud-eu/opencloud"
path_to_drone_env = "%s/%s/.drone.env" % (ocis_git_base_url, ctx.build.commit) path_to_woodpecker_env = "%s/%s/.woodpecker.env" % (opencloud_git_base_url, ctx.build.commit)
path_to_check_script = "%s/%s/tests/config/woodpecker/check_web_cache.sh" % (ocis_git_base_url, ctx.build.commit) path_to_check_script = "%s/%s/tests/config/woodpecker/check_web_cache.sh" % (opencloud_git_base_url, ctx.build.commit)
return { return {
"name": "get-drone-env-and-check-script", "name": "get-woodpecker-env-and-check-script",
"image": OC_UBUNTU, "image": OC_UBUNTU,
"commands": [ "commands": [
"curl -s -o .drone.env %s" % path_to_drone_env, "curl -s -o .woodpecker.env %s" % path_to_woodpecker_env,
"curl -s -o check_web_cache.sh %s" % path_to_check_script, "curl -s -o check_web_cache.sh %s" % path_to_check_script,
], ],
} }
@@ -2755,16 +2760,16 @@ def cloneWeb():
"name": "clone-web", "name": "clone-web",
"image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION, "image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
"commands": [ "commands": [
". ./.drone.env", ". ./.woodpecker.env",
"rm -rf %s" % dirs["web"], "rm -rf %s" % dirs["web"],
"git clone -b $WEB_BRANCH --single-branch --no-tags https://github.com/owncloud/web.git %s" % dirs["web"], "git clone -b $WEB_BRANCH --single-branch --no-tags https://github.com/opencloud-eu/web.git %s" % dirs["web"],
"cd %s && git checkout $WEB_COMMITID" % dirs["web"], "cd %s && git checkout $WEB_COMMITID" % dirs["web"],
], ],
} }
def generateWebPnpmCache(ctx): def generateWebPnpmCache(ctx):
return [ return [
getDroneEnvAndCheckScript(ctx), getWoodpeckerEnvAndCheckScript(ctx),
checkForWebCache("web-pnpm"), checkForWebCache("web-pnpm"),
cloneWeb(), cloneWeb(),
{ {
@@ -2792,7 +2797,7 @@ def generateWebPnpmCache(ctx):
"image": MINIO_MC, "image": MINIO_MC,
"environment": MINIO_MC_ENV, "environment": MINIO_MC_ENV,
"commands": [ "commands": [
"source ./.drone.env", "source ./.woodpecker.env",
# cache using the minio/mc client to the public bucket (long term bucket) # cache using the minio/mc client to the public bucket (long term bucket)
"mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY",
"mc cp -r -a %s s3/$CACHE_BUCKET/opencloud/web-test-runner/$WEB_COMMITID" % dirs["webPnpmZip"], "mc cp -r -a %s s3/$CACHE_BUCKET/opencloud/web-test-runner/$WEB_COMMITID" % dirs["webPnpmZip"],
@@ -2802,7 +2807,7 @@ def generateWebPnpmCache(ctx):
def generateWebCache(ctx): def generateWebCache(ctx):
return [ return [
getDroneEnvAndCheckScript(ctx), getWoodpeckerEnvAndCheckScript(ctx),
checkForWebCache("web"), checkForWebCache("web"),
cloneWeb(), cloneWeb(),
{ {
@@ -2818,7 +2823,7 @@ def generateWebCache(ctx):
"image": MINIO_MC, "image": MINIO_MC,
"environment": MINIO_MC_ENV, "environment": MINIO_MC_ENV,
"commands": [ "commands": [
"source ./.drone.env", "source ./.woodpecker.env",
# cache using the minio/mc client to the 'owncloud' bucket (long term bucket) # cache using the minio/mc client to the 'owncloud' bucket (long term bucket)
"mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY",
"mc cp -r -a %s s3/$CACHE_BUCKET/opencloud/web-test-runner/$WEB_COMMITID" % dirs["webZip"], "mc cp -r -a %s s3/$CACHE_BUCKET/opencloud/web-test-runner/$WEB_COMMITID" % dirs["webZip"],
@@ -2832,7 +2837,7 @@ def restoreWebCache():
"image": MINIO_MC, "image": MINIO_MC,
"environment": MINIO_MC_ENV, "environment": MINIO_MC_ENV,
"commands": [ "commands": [
"source ./.drone.env", "source ./.woodpecker.env",
"rm -rf %s" % dirs["web"], "rm -rf %s" % dirs["web"],
"mkdir -p %s" % dirs["web"], "mkdir -p %s" % dirs["web"],
"mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY",
@@ -2852,7 +2857,7 @@ def restoreWebPnpmCache():
"image": MINIO_MC, "image": MINIO_MC,
"environment": MINIO_MC_ENV, "environment": MINIO_MC_ENV,
"commands": [ "commands": [
"source ./.drone.env", "source ./.woodpecker.env",
"mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY", "mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY",
"mc cp -r -a s3/$CACHE_BUCKET/opencloud/web-test-runner/$WEB_COMMITID/pnpm-store.tar.gz %s" % dirs["zip"], "mc cp -r -a s3/$CACHE_BUCKET/opencloud/web-test-runner/$WEB_COMMITID/pnpm-store.tar.gz %s" % dirs["zip"],
], ],

View File

@@ -1,10 +1,10 @@
services: services:
acceptance-tests: acceptance-tests:
image: owncloudci/php:8.2 image: owncloudci/php:8.2
working_dir: /drone/src working_dir: /woodpecker/src/github.com/opencloud-eu/opencloud
command: /bin/bash /test/run-tests.sh command: /bin/bash /test/run-tests.sh
environment: environment:
OC_ROOT: /drone/src OC_ROOT: /woodpecker/src/github.com/opencloud-eu/opencloud
TEST_SERVER_URL: https://opencloud-server:9200 TEST_SERVER_URL: https://opencloud-server:9200
OC_WRAPPER_URL: http://opencloud-server:5200 OC_WRAPPER_URL: http://opencloud-server:5200
STORAGE_DRIVER: $STORAGE_DRIVER STORAGE_DRIVER: $STORAGE_DRIVER
@@ -17,8 +17,8 @@ services:
EMAIL_HOST: email EMAIL_HOST: email
EMAIL_PORT: 9000 EMAIL_PORT: 9000
env_file: env_file:
- ../../../../.drone.env - ../../../../.woodpecker.env
volumes: volumes:
- ./run-tests.sh:/test/run-tests.sh - ./run-tests.sh:/test/run-tests.sh
- ../../../../:/drone/src - ../../../../:/woodpecker/src/github.com/opencloud-eu/opencloud
- ../../../../vendor-bin/behat/composer.json:/tmp/vendor-bin/behat/composer.json - ../../../../vendor-bin/behat/composer.json:/tmp/vendor-bin/behat/composer.json

View File

@@ -15,7 +15,7 @@ services:
STORAGE_SYSTEM_DRIVER_OC_ROOT: /srv/app/tmp/opencloud/storage/metadata STORAGE_SYSTEM_DRIVER_OC_ROOT: /srv/app/tmp/opencloud/storage/metadata
SHARING_USER_JSON_FILE: /srv/app/tmp/opencloud/shares.json SHARING_USER_JSON_FILE: /srv/app/tmp/opencloud/shares.json
PROXY_ENABLE_BASIC_AUTH: "true" PROXY_ENABLE_BASIC_AUTH: "true"
WEB_UI_CONFIG_FILE: /drone/src/tests/config/drone/opencloud-config.json WEB_UI_CONFIG_FILE: /woodpecker/src/github.com/opencloud-eu/opencloud/tests/config/drone/opencloud-config.json
ACCOUNTS_HASH_DIFFICULTY: 4 ACCOUNTS_HASH_DIFFICULTY: 4
OC_INSECURE: "true" OC_INSECURE: "true"
IDM_CREATE_DEMO_USERS: "true" IDM_CREATE_DEMO_USERS: "true"
@@ -52,11 +52,11 @@ services:
SEARCH_EXTRACTOR_CS3SOURCE_INSECURE: "true" SEARCH_EXTRACTOR_CS3SOURCE_INSECURE: "true"
# fonts map for txt thumbnails (including unicode support) # fonts map for txt thumbnails (including unicode support)
THUMBNAILS_TXT_FONTMAP_FILE: "/drone/src/tests/config/drone/fontsMap.json" THUMBNAILS_TXT_FONTMAP_FILE: "/woodpecker/src/github.com/opencloud-eu/opencloud/tests/config/drone/fontsMap.json"
ports: ports:
- '9200:9200' - '9200:9200'
- '5200:5200' ## ocwrapper - '5200:5200' ## ocwrapper
- '9174:9174' ## notifications debug - '9174:9174' ## notifications debug
volumes: volumes:
- ../../../config:/drone/src/tests/config - ../../../config:/woodpecker/src/github.com/opencloud-eu/opencloud/tests/config
- ../../../ocwrapper/bin/ocwrapper:/usr/bin/ocwrapper - ../../../ocwrapper/bin/ocwrapper:/usr/bin/ocwrapper

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
source .drone.env source .woodpecker.env
# if no $1 is supplied end the script # if no $1 is supplied end the script
# Can be web, acceptance or e2e # Can be web, acceptance or e2e

View File

@@ -1,3 +1,3 @@
{ {
"defaultFont": "/drone/src/tests/config/drone/NotoSans.ttf" "defaultFont": "/woodpecker/src/github.com/opencloud-eu/opencloud/tests/config/woodpecker/NotoSans.ttf"
} }