diff --git a/.woodpecker.star b/.woodpecker.star index 4f23824b4f..5efe2c716d 100644 --- a/.woodpecker.star +++ b/.woodpecker.star @@ -202,12 +202,14 @@ config = { "apiSearch1", ], "skip": False, + "nightlyOpenSearch": True, }, "search2": { "suites": [ "apiSearch2", ], "skip": False, + "nightlyOpenSearch": True, }, "sharingNg": { "suites": [ @@ -271,6 +273,7 @@ config = { ], "skip": False, "tikaNeeded": True, + "nightlyOpenSearch": True, }, "ocm": { "suites": [ @@ -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, @@ -872,6 +852,7 @@ def testOpencloud(ctx): pipeline = { "name": "test-lint-unit", "steps": steps, + "services": openSearchService(), "when": [ event["base"], event["cron"], @@ -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): @@ -1312,6 +1308,7 @@ def localApiTestPipeline(ctx): "withRemotePhp": False, "enableWatchFs": False, "ldapNeeded": False, + "nightlyOpenSearch": False, } if "localApiTests" in config: @@ -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"): @@ -1347,11 +1345,19 @@ 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 []) + @@ -1359,7 +1365,7 @@ def localApiTestPipeline(ctx): (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, @@ -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": [ @@ -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", diff --git a/tests/acceptance/features/apiSearch1/favoriteSearch.feature b/tests/acceptance/features/apiSearch1/favoriteSearch.feature index d087d045d9..0befecaacc 100644 --- a/tests/acceptance/features/apiSearch1/favoriteSearch.feature +++ b/tests/acceptance/features/apiSearch1/favoriteSearch.feature @@ -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" diff --git a/tests/acceptance/features/apiSearch1/search.feature b/tests/acceptance/features/apiSearch1/search.feature index 2712ea01c4..266ac82895 100644 --- a/tests/acceptance/features/apiSearch1/search.feature +++ b/tests/acceptance/features/apiSearch1/search.feature @@ -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 And user "Alice" has created a folder ".space" in space "project101" @@ -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" @@ -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 And user "Alice" has uploaded file with content "hello world" to "upload😀 😁.txt" diff --git a/tests/acceptance/features/apiSearchContent/contentSearch.feature b/tests/acceptance/features/apiSearchContent/contentSearch.feature index b7189c4dcd..83a275815a 100644 --- a/tests/acceptance/features/apiSearchContent/contentSearch.feature +++ b/tests/acceptance/features/apiSearchContent/contentSearch.feature @@ -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 And user "Alice" has uploaded file with content "Using k6, you can test the reliability and performance of your systems" to "wordWithNumber.md"