Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only][full-ci]Search files by content #6678

Merged
merged 1 commit into from
Jul 17, 2023
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
11 changes: 10 additions & 1 deletion .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ config = {
"OCIS_ADD_RUN_SERVICES": "antivirus",
},
},
"apiFullTextSearch": {
"suites": [
"apiFullTextSearch",
],
"skip": False,
"tikaNeeded": True,
},
},
"apiTests": {
"numberOfParts": 10,
Expand Down Expand Up @@ -735,6 +742,7 @@ def localApiTestPipeline(ctx):
"accounts_hash_difficulty": 4,
"emailNeeded": False,
"antivirusNeeded": False,
"tikaNeeded": False,
}

if "localApiTests" in config:
Expand All @@ -755,7 +763,8 @@ def localApiTestPipeline(ctx):
},
"steps": skipIfUnchanged(ctx, "acceptance-tests") +
restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") +
ocisServer(storage, params["accounts_hash_difficulty"], extra_server_environment = params["extraServerEnvironment"], with_wrapper = True) +
(tikaService() if params["tikaNeeded"] else []) +
ocisServer(storage, params["accounts_hash_difficulty"], extra_server_environment = params["extraServerEnvironment"], with_wrapper = True, tika_enabled = params["tikaNeeded"]) +
(waitForClamavService() if params["antivirusNeeded"] else []) +
(waitForEmailService() if params["emailNeeded"] else []) +
localApiTests(suite, storage, params["extraEnvironment"]),
Expand Down
15 changes: 15 additions & 0 deletions tests/acceptance/config/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,21 @@ default:
- OcisConfigContext:
- PublicWebDavContext:

apiFullTextSearch:
paths:
- '%paths.base%/../features/apiFullTextSearch'
saw-jan marked this conversation as resolved.
Show resolved Hide resolved
context: *common_ldap_suite_context
contexts:
- SettingsContext:
- GraphContext:
- SpacesContext:
- PublicWebDavContext:
- FeatureContext: *common_feature_context_params
- SearchContext:
- CapabilitiesContext:
- FilesVersionsContext:
- OCSContext:

extensions:
rdx\behatvars\BehatVariablesExtension: ~

Expand Down
27 changes: 27 additions & 0 deletions tests/acceptance/features/apiFullTextSearch/search.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@api
Feature: full text search
As a user
I want to do full text search
So that I can find the files with the content I am looking for

Background:
Given user "Alice" has been created with default attributes and without skeleton files


Scenario Outline: search files by content
nabim777 marked this conversation as resolved.
Show resolved Hide resolved
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file with content "hello world from nepal" to "keywordAtStart.txt"
And user "Alice" has uploaded file with content "saying hello to the world" to "keywordAtMiddle.txt"
And user "Alice" has uploaded file with content "nepal want to say hello" to "keywordAtLast.txt"
And user "Alice" has uploaded file with content "namaste from nepal" to "hello.txt"
When user "Alice" searches for "Content:hello" using the WebDAV API
Then the HTTP status code should be "207"
And the search result of user "Alice" should contain only these files:
| keywordAtStart.txt |
| keywordAtMiddle.txt |
| keywordAtLast.txt |
Examples:
| dav-path-version |
| old |
| new |
| spaces |