Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 99 additions & 74 deletions .woodpecker.star
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ OC_CI_ALPINE = "owncloudci/alpine:latest"
OC_CI_BAZEL_BUILDIFIER = "owncloudci/bazel-buildifier"
OC_CI_DRONE_ANSIBLE = "owncloudci/drone-ansible:latest"
OC_CI_GOLANG = "docker.io/golang:1.24"
OC_CI_NODEJS = "owncloudci/nodejs:20"
OC_CI_NODEJS = "owncloudci/nodejs:22"
OC_CI_WAIT_FOR = "owncloudci/wait-for:latest"
OC_UBUNTU = "owncloud/ubuntu:20.04"
ONLYOFFICE_DOCUMENT_SERVER = "onlyoffice/documentserver:8.1.3"
Expand Down Expand Up @@ -60,6 +60,11 @@ config = {
"journeys",
"smoke",
],
"browsers": [
"chromium",
"firefox",
"webkit",
],
},
"2": {
"earlyFail": True,
Expand Down Expand Up @@ -100,6 +105,11 @@ config = {
"suites": [
"a11y",
],
"browsers": [
"chromium",
"firefox",
"webkit",
],
},
"app-provider": {
"skip": False,
Expand Down Expand Up @@ -515,6 +525,7 @@ def e2eTests(ctx):
"federationServer": False,
"failOnUncaughtConsoleError": False,
"extraServerEnvironment": {},
"browsers": ["chromium"],
}

e2e_trigger = [
Expand Down Expand Up @@ -546,78 +557,91 @@ def e2eTests(ctx):
if "with-tracing" in ctx.build.title.lower():
params["reportTracing"] = True

environment = {
"HEADLESS": True,
"RETRY": "1",
"REPORT_TRACING": params["reportTracing"],
"OC_BASE_URL": "opencloud:9200",
"OC_SHOW_USER_EMAIL_IN_RESULTS": True,
"FAIL_ON_UNCAUGHT_CONSOLE_ERR": True,
"PLAYWRIGHT_BROWSERS_PATH": ".playwright",
"BROWSER": "chromium",
}

steps = restoreBuildArtifactCache(ctx, "pnpm", ".pnpm-store") + \
installPnpm() + \
restoreBrowsersCache() + \
restoreBuildArtifactCache(ctx, "web-dist", "dist")

if ctx.build.event == "cron":
steps += restoreBuildArtifactCache(ctx, "opencloud", "opencloud")
else:
steps += restoreOpenCloudCache()

if "app-provider-onlyOffice" in suite:
environment["FAIL_ON_UNCAUGHT_CONSOLE_ERR"] = False
steps += onlyofficeService() + \
waitForServices("onlyOffice", ["onlyoffice:443"]) + \
openCloudService(params["extraServerEnvironment"]) + \
wopiCollaborationService("onlyoffice") + \
waitForServices("wopi", ["wopi-onlyoffice:9300"])

elif "app-provider" in suite:
environment["FAIL_ON_UNCAUGHT_CONSOLE_ERR"] = False
steps += collaboraService() + \
waitForServices("collabora", ["collabora:9980"]) + \
openCloudService(params["extraServerEnvironment"]) + \
wopiCollaborationService("collabora") + \
waitForServices("wopi", ["wopi-collabora:9300"])

elif "ocm" in suite:
steps += openCloudService(params["extraServerEnvironment"]) + \
(openCloudService(params["extraServerEnvironment"], "federation") if params["federationServer"] else [])
else:
# OpenCloud specific steps
steps += (tikaService() if params["tikaNeeded"] else []) + \
openCloudService(params["extraServerEnvironment"])

command = "bash run-e2e.sh "
if "suites" in matrix:
command += "--suites %s" % ",".join(params["suites"])
elif "features" in matrix:
command += "%s" % " ".join(params["features"])
else:
print("Error: No suites or features defined for e2e test suite '%s'" % suite)
return []

steps += [{
"name": "e2e-tests",
"image": OC_CI_NODEJS,
"environment": environment,
"commands": [
"cd tests/e2e",
command,
],
}] + \
uploadTracingResult(ctx)

pipelines.append({
"name": "e2e-tests-%s" % suite,
"workspace": web_workspace,
"steps": steps,
"depends_on": ["cache-opencloud"],
"when": e2e_trigger,
})
browsers_for_suite = params["browsers"]

for browser_name in browsers_for_suite:
environment = {
"HEADLESS": True,
"RETRY": "1",
"REPORT_TRACING": params["reportTracing"],
"OC_BASE_URL": "opencloud:9200",
"OC_SHOW_USER_EMAIL_IN_RESULTS": True,
"FAIL_ON_UNCAUGHT_CONSOLE_ERR": True,
"PLAYWRIGHT_BROWSERS_PATH": ".playwright",
"BROWSER": browser_name,
}

steps = restoreBuildArtifactCache(ctx, "pnpm", ".pnpm-store") + \
installPnpm() + \
restoreBrowsersCache() + \
restoreBuildArtifactCache(ctx, "web-dist", "dist")

if ctx.build.event == "cron":
steps += restoreBuildArtifactCache(ctx, "opencloud", "opencloud")
else:
steps += restoreOpenCloudCache()

if "app-provider-onlyOffice" in suite:
environment["FAIL_ON_UNCAUGHT_CONSOLE_ERR"] = False
steps += onlyofficeService() + \
waitForServices("onlyOffice", ["onlyoffice:443"]) + \
openCloudService(params["extraServerEnvironment"]) + \
wopiCollaborationService("onlyoffice") + \
waitForServices("wopi", ["wopi-onlyoffice:9300"])

elif "app-provider" in suite:
environment["FAIL_ON_UNCAUGHT_CONSOLE_ERR"] = False
steps += collaboraService() + \
waitForServices("collabora", ["collabora:9980"]) + \
openCloudService(params["extraServerEnvironment"]) + \
wopiCollaborationService("collabora") + \
waitForServices("wopi", ["wopi-collabora:9300"])

elif "ocm" in suite:
steps += openCloudService(params["extraServerEnvironment"]) + \
(openCloudService(params["extraServerEnvironment"], "federation") if params["federationServer"] else [])
else:
# OpenCloud specific steps
steps += (tikaService() if params["tikaNeeded"] else []) + \
openCloudService(params["extraServerEnvironment"])

if browser_name == "webkit":
environment["FAIL_ON_UNCAUGHT_CONSOLE_ERR"] = "False"
command = "pnpm exec playwright install webkit --with-deps && cd tests/e2e && bash run-e2e.sh "
else:
command = "cd tests/e2e && bash run-e2e.sh "

if browser_name == "firefox":
environment["FAIL_ON_UNCAUGHT_CONSOLE_ERR"] = "False"

if "suites" in matrix:
command += "--suites %s" % ",".join(params["suites"])
elif "features" in matrix:
command += "%s" % " ".join(params["features"])
else:
print("Error: No suites or features defined for e2e test suite '%s'" % suite)
return []

steps += [{
"name": "e2e-tests",
"image": OC_CI_NODEJS,
"environment": environment,
"commands": [
command,
],
}] + \
uploadTracingResult(ctx)

pipeline_name = "e2e-tests-%s-%s" % (suite, browser_name)

pipelines.append({
"name": pipeline_name,
"workspace": web_workspace,
"steps": steps,
"depends_on": ["cache-opencloud"],
"when": e2e_trigger,
})

return pipelines

def notify():
Expand Down Expand Up @@ -673,7 +697,8 @@ def installBrowsers():
"commands": [
". ./.woodpecker.env",
"if $BROWSER_CACHE_FOUND; then exit 0; fi",
"pnpm exec playwright install chromium --with-deps",
"pnpm exec playwright install chromium firefox --with-deps",
"pnpm exec playwright install --list",
"tar -czvf %s .playwright" % dir["playwrightBrowsersArchive"],
],
}]
Expand Down
1 change: 1 addition & 0 deletions cucumber.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const e2e = `
--import ./tests/e2e/**/*.ts
--retry ${config.retry}
--format @cucumber/pretty-formatter
--format pretty
--format json:${path.join(config.reportDir, 'cucumber', 'report.json')}
--format message:${path.join(config.reportDir, 'cucumber', 'report.ndjson')}
--format html:${path.join(config.reportDir, 'cucumber', 'report.html')}
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"format:write": "prettier . --config packages/prettier-config/index.js --write",
"serve": "SERVER=true pnpm build:w",
"test:e2e:cucumber": "NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e --parallel ${PARALLEL:-1}",
"test:e2e:cucumber:chromium": "BROWSER=chrome NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e --parallel ${PARALLEL:-1}",
"test:e2e:cucumber:firefox": "BROWSER=firefox NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e --parallel ${PARALLEL:-1}",
"test:e2e:cucumber:webkit": "BROWSER=webkit NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e --parallel ${PARALLEL:-1} --tags 'not @webkit-skip'",
"test:unit": "NODE_OPTIONS=--unhandled-rejections=throw vitest",
"licenses:check": "license-checker-rseidelsohn --summary --relativeLicensePath --onlyAllow 'Python-2.0;Apache*;Apache License, Version 2.0;Apache-2.0;Apache 2.0;Artistic-2.0;BSD;BSD-3-Clause;CC-BY-3.0;CC-BY-4.0;CC0-1.0;ISC;MIT;MPL-2.0;Public Domain;Unicode-TOU;Unlicense;WTFPL;BlueOak-1.0.0' --excludePackages '@opencloud-eu/babel-preset;@opencloud-eu/eslint-config;@opencloud-eu/prettier-config;@opencloud-eu/tsconfig;@opencloud-eu/web-client;@opencloud-eu/web-pkg;external;web-app-files;text-editor;preview;web-app-ocm;@opencloud-eu/design-system;pdf-viewer;web-app-search;admin-settings;webfinger;web-runtime;@opencloud-eu/web-test-helpers'",
"licenses:csv": "license-checker-rseidelsohn --relativeLicensePath --csv --out ./third-party-licenses/third-party-licenses.csv",
Expand Down
55 changes: 40 additions & 15 deletions tests/e2e/cucumber/environment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,25 +82,50 @@ Before(async function (this: World, { pickle }: ITestCaseHookParameter) {
})

BeforeAll(async (): Promise<void> => {
const browserConfiguration = {
slowMo: config.slowMo,
args: ['--use-fake-ui-for-media-stream', '--use-fake-device-for-media-stream'],
firefoxUserPrefs: {
'media.navigator.streams.fake': true,
'media.navigator.permission.disabled': true
},
headless: config.headless
}
const browserType = config.browser ?? 'chromium'
const headless = config.headless
const slowMo = config.slowMo

const chromiumArgs = ['--use-fake-ui-for-media-stream', '--use-fake-device-for-media-stream']

const browsers: Record<string, () => Promise<Browser>> = {
firefox: async (): Promise<Browser> => await firefox.launch(browserConfiguration),
webkit: async (): Promise<Browser> => await webkit.launch(browserConfiguration),
chrome: async (): Promise<Browser> =>
await chromium.launch({ ...browserConfiguration, channel: 'chrome' }),
chromium: async (): Promise<Browser> => await chromium.launch(browserConfiguration)
firefox: async () =>
await firefox.launch({
headless,
slowMo,
firefoxUserPrefs: {
'media.navigator.streams.fake': true,
'media.navigator.permission.disabled': true
}
}),

webkit: async () =>
await webkit.launch({
headless,
slowMo
}),

chrome: async () =>
await chromium.launch({
headless,
slowMo,
channel: 'chrome',
args: chromiumArgs
}),

chromium: async () =>
await chromium.launch({
headless,
slowMo,
args: chromiumArgs
})
}

if (!(browserType in browsers)) {
throw new Error(`Unknown browser: ${browserType}`)
}

state.browser = await browsers[config.browser]()
state.browser = await browsers[browserType]()

// setup keycloak admin user
if (config.keycloak) {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/cucumber/features/smoke/sse.feature
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Feature: server sent events
And "Brian" logs out
And "Alice" logs out


@webkit-skip
Scenario: sse events on file operations
Given "Admin" assigns following roles to the users using API
| id | role |
Expand Down
12 changes: 2 additions & 10 deletions tests/e2e/cucumber/features/smoke/upload.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Feature: Upload
And "Alice" logs in
And "Alice" opens the "files" app


@webkit-skip
Scenario: Upload files in personal space
Given "Alice" creates the following resources
| resource | type | content |
Expand Down Expand Up @@ -58,14 +58,6 @@ Feature: Upload
| resource |
| simple.pdf |
And "Alice" closes the file viewer

# upload empty folder
When "Alice" uploads the following resources
| resource | type |
| FOLDER | folder |
Then following resources should be displayed in the files list for user "Alice"
| resource |
| FOLDER |

# folder upload via drag-n-drop
When "Alice" uploads the following resources via drag-n-drop
Expand All @@ -77,7 +69,7 @@ Feature: Upload
| child.txt |
And "Alice" logs out


@webkit-skip
Scenario: try to upload resources when the quota is insufficient
Given "Admin" logs in
And "Admin" opens the "admin-settings" app
Expand Down
Empty file.
Loading