Skip to content
Open
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
86 changes: 60 additions & 26 deletions .woodpecker.star
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,14 @@ config = {
"apiSearch1",
],
"skip": False,
"nightlyOpenSearch": True,
},
"search2": {
"suites": [
"apiSearch2",
],
"skip": False,
"nightlyOpenSearch": True,
},
"sharingNg": {
"suites": [
Expand Down Expand Up @@ -271,6 +273,7 @@ config = {
],
"skip": False,
"tikaNeeded": True,
"nightlyOpenSearch": True,
},
"ocm": {
"suites": [
Expand Down Expand Up @@ -817,30 +820,7 @@ def testOpencloud(ctx):
],
"environment": CI_HTTP_PROXY_ENV,
},
{
"name": "open-search",
"image": OPEN_SEARCH,
"detach": True,
"environment": {
"discovery.type": "single-node",
"DISABLE_INSTALL_DEMO_CONFIG": True,
"DISABLE_SECURITY_PLUGIN": True,
},
"entrypoint": ["/usr/share/opensearch/opensearch-docker-entrypoint.sh", "opensearch"],
},
{
"name": "wait-for-open-search",
"image": OC_CI_ALPINE,
"commands": [
"bash -c '" +
"until curl -sS \"http://open-search:9200/_cat/health?h=status\" | grep \"green\\|yellow\"; do\n" +
" echo \"Waiting for http://open-search:9200 to be healthy...\"\n" +
" sleep 5\n" +
"done\n" +
"echo \"http://open-search:9200 healthy...\"\n" +
"'",
],
},
] + waitForOpenSearch() + [
{
"name": "test",
"image": OC_CI_GOLANG,
Expand Down Expand Up @@ -872,6 +852,7 @@ def testOpencloud(ctx):
pipeline = {
"name": "test-lint-unit",
"steps": steps,
"services": openSearchService(),
"when": [
event["base"],
event["cron"],
Expand Down Expand Up @@ -1284,14 +1265,29 @@ def build_api_test_workflow_matrix(ctx, storage, suite_cfg, default_cfg):
matrix = {
"withRemotePhp": m["withRemotePhp"],
"enableWatchFs": m["enableWatchFs"],
"openSearch": False,
}
if override_with_remote_php != None:
matrix["withRemotePhp"] = override_with_remote_php
if override_enable_watch_fs != None:
matrix["enableWatchFs"] = override_enable_watch_fs

if matrix not in workflow_metrices and matrix in matrices:
base = {
"withRemotePhp": matrix["withRemotePhp"],
"enableWatchFs": matrix["enableWatchFs"],
}
if matrix not in workflow_metrices and base in matrices:
workflow_metrices.append(matrix)

# Add an OpenSearch search-engine variant for nightly running search tests
if ctx.build.event == "cron" and storage == "posix" and suite_cfg.get("nightlyOpenSearch", False):
os_matrix = {
"withRemotePhp": False,
"enableWatchFs": False,
"openSearch": True,
}
if os_matrix not in workflow_metrices:
workflow_metrices.append(os_matrix)
return workflow_metrices

def localApiTestPipeline(ctx):
Expand All @@ -1312,6 +1308,7 @@ def localApiTestPipeline(ctx):
"withRemotePhp": False,
"enableWatchFs": False,
"ldapNeeded": False,
"nightlyOpenSearch": False,
}

if "localApiTests" in config:
Expand All @@ -1337,6 +1334,7 @@ def localApiTestPipeline(ctx):
for m in matrices:
run_with_remote_php = m["withRemotePhp"]
run_with_watch_fs = m["enableWatchFs"]
run_with_open_search = m["openSearch"]

pipeline_name = "test-API"
if name.startswith("cli"):
Expand All @@ -1347,19 +1345,27 @@ def localApiTestPipeline(ctx):
pipeline_name += "-withRemotePhp"
if run_with_watch_fs:
pipeline_name += "-watchfs"
if run_with_open_search:
pipeline_name += "-opensearch"

server_environment = dict(params["extraServerEnvironment"])
if run_with_open_search:
server_environment["SEARCH_ENGINE_TYPE"] = "open-search"
server_environment["SEARCH_ENGINE_OPEN_SEARCH_CLIENT_ADDRESSES"] = "http://open-search:9200"

pipeline = {
"name": pipeline_name,
"steps": evaluateWorkflowStep() + restoreBuildArtifactCache(ctx, dirs["opencloudBinArtifact"], dirs["opencloudBinPath"]) +
(tikaService() if params["tikaNeeded"] else []) +
(waitForOpenSearch() if run_with_open_search else []) +
(waitForWebOffices(["https://collabora:9980", "https://onlyoffice", "http://fakeoffice:8080"]) if params["collaborationServiceNeeded"] else []) +
(waitForClamavService() if params["antivirusNeeded"] else []) +
(waitForEmailService() if params["emailNeeded"] else []) +
(ldapService() if params["ldapNeeded"] else []) +
(waitForLdapService() if params["ldapNeeded"] else []) +
opencloudServer(
storage,
extra_server_environment = params["extraServerEnvironment"],
extra_server_environment = server_environment,
with_wrapper = True,
tika_enabled = params["tikaNeeded"],
watch_fs_enabled = run_with_watch_fs,
Expand All @@ -1371,6 +1377,7 @@ def localApiTestPipeline(ctx):
logRequests(),
"services": (emailService() if params["emailNeeded"] else []) +
(clamavService() if params["antivirusNeeded"] else []) +
(openSearchService() if run_with_open_search else []) +
((fakeOffice() + collaboraService() + onlyofficeService()) if params["collaborationServiceNeeded"] else []),
"depends_on": getPipelineNames(buildOpencloudBinaryForTesting(ctx)),
"when": [
Expand Down Expand Up @@ -3436,6 +3443,33 @@ def tikaService():
],
}]

def openSearchService():
return [{
"name": "open-search",
"image": OPEN_SEARCH,
"environment": {
"discovery.type": "single-node",
"DISABLE_INSTALL_DEMO_CONFIG": True,
"DISABLE_SECURITY_PLUGIN": True,
},
"entrypoint": ["/usr/share/opensearch/opensearch-docker-entrypoint.sh", "opensearch"],
}]

def waitForOpenSearch():
return [{
"name": "wait-for-open-search",
"image": OC_CI_ALPINE,
"commands": [
"bash -c '" +
"until curl -sS \"http://open-search:9200/_cat/health?h=status\" | grep \"green\\|yellow\"; do\n" +
" echo \"Waiting for http://open-search:9200 to be healthy...\"\n" +
" sleep 5\n" +
"done\n" +
"echo \"http://open-search:9200 healthy...\"\n" +
"'",
],
}]

def logRequests():
return [{
"name": "api-test-failure-logs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Feature: search for favorites
Then the HTTP status code should be "207"
And the search result should contain "0" entries


@issue-3309
Scenario: search for favorite files after deleting a file
Given user "Alice" has uploaded file "filesForUpload/textfile.txt" to "textfile.txt"
And user "Alice" has marked file "textfile.txt" as favorite from space "Personal"
Expand Down
6 changes: 3 additions & 3 deletions tests/acceptance/features/apiSearch1/search.feature
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Feature: Search
| new |
| spaces |

@issue-10329
@issue-10329 @issue-3310
Scenario Outline: user can search hidden files
Given using <dav-path-version> DAV path
And user "Alice" has created a folder ".space" in space "project101"
Expand Down Expand Up @@ -320,7 +320,7 @@ Feature: Search
| name:*der2 | subFOLDER2 | patern 'name:'' |
| name:"*der2" | subFOLDER2 | pattern 'name:""' (with quotes) |

@issue-7812 @issue-8442 @issue-10329
@issue-7812 @issue-8442 @issue-10329 @issue-3312
Scenario: try to search with invalid patterns
Given using spaces DAV path
And user "Alice" has uploaded file with content "test file" to "testFile.txt"
Expand Down Expand Up @@ -395,7 +395,7 @@ Feature: Search
| new |
| spaces |

@issue-10329
@issue-10329 @issue-3310
Scenario Outline: search for entry with emoji by pattern
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file with content "hello world" to "upload😀 😁.txt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Feature: content search
| new |
| spaces |

@issue-10329
@issue-10329 @issue-3310
Scenario Outline: search files by different content types
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file with content "Using k6, you can test the reliability and performance of your systems" to "wordWithNumber.md"
Expand Down