Commit Graph
3 Commits
Author SHA1 Message Date
Viktor Scharf 67d63d608e tests: remove unused tags, run the search properties scenarios as expected failures (#4142)
* tests: remove unused tags from the acceptance tests

Remove the tags that neither the CI of opencloud nor the one of reva
filters on, and that no hook uses: @smokeTest, @skipOnStorage:ceph,
@skipOnStorage:scality, @skipOnOpencloud-decomposeds3-Storage (the CI only
runs posix and decomposed), @sqliteDB, @notification and @skip-local-run.
A tag line left empty becomes an empty line, so that the line numbers of
the scenarios, which the expected failures of opencloud and reva refer to,
stay the same.

Also fix the typo @@skipOnReva, and write the issue tags the same way:
@issues-<n> becomes @issue-<n>, @web-issue-<n> becomes @issue-web-<n>.

Assisted-by: Claude Code:claude-opus-5-5

* tests: run the search properties scenarios as expected failures

The two scenarios that check the properties of search results were
skipped, since the search REPORT returns an empty d:getetag (#3501) and
the step retried the whole check for 20 seconds, which made them too slow
as expected failures.

- retry the search only until the entry is indexed, then check its
  properties once: once found, the entry is complete, so a wrong value
  fails right away
- check what the search returns: d:getcontentlength for files, the real
  size of 12 bytes, a file id of the form <uuid>$<uuid>!<uuid>, anchored
  patterns, and no oc:owner-id and oc:owner-display-name, which the
  search response never contains
- list them as expected failures of #3501 instead of skipping them

Without the d:getetag check, both scenarios pass.

Assisted-by: Claude Code:claude-opus-5-5

* lint fix
2026-11-27 08:01:41 +00:00
Pascal Bleser 5e8a88a05f feat: 1419: clean up revisions by the time they were created
Follows opencloud-eu/reva#895, which makes the revision cleanup go by
the time a revision was created, recorded by the server, instead of the
modification time of its content, which clients choose with X-OC-Mtime.
"auto" keeps the oldest revision of each slot (#3735).

- The storage-users README explains the new age of a revision.
- The acceptance scenario outline that checked the age as the time the
  content was written is replaced by two scenarios: versions whose
  content is dated 60 and 50 days ago are kept by "30d", and a version
  with content dated 10 years ahead doesn't push out the newest one
  under "1".

Assisted-by: Claude Code:claude-opus-5-5
2026-11-23 23:59:43 +01:00
Pascal Bleser 9c99eeae36 test: 1419: acceptance tests for the revision cleanup
A new cliCommands feature, cleanupFileVersions.feature, tests the
"storage-users revisions cleanup" command against a running server,
checking the remaining versions through the WebDAV versions API:

- keeping the newest version of every file in all spaces
- a dry run, which deletes nothing
- only a folder within the personal space (--space with --path)
- only a project space (--space)
- the JSON output (--json)
- no strategy while the configured one is disabled: exit code 1
- a timeout: exit code 2, nothing deleted
- a strategy without spaces after its commas ("auto,1"), as the CLI
  wrapper splits commands on spaces
- a folder by its path on disk (--fs-path), posix only
- the configured strategy (STORAGE_USERS_REVISIONS_CLEANUP_STRATEGY),
  which cleans up a file whenever it gets a new version: without
  background workers, and with them, the default
- the configured strategy for uploads with TUS, as the web UI and the
  clients upload
- the age of a version, which is the time its content was written:
  uploads with an older modification time (X-OC-Mtime) make versions
  that "30d" deletes right away, while "1,30d" keeps the newest one
- restoring a version with the strategy "0": the content from before
  the restore is kept, so that the restore can be undone

A second feature, collaborativePosix/cleanupFileVersions.feature, tests
the versions that changes on the POSIX filesystem create, with
STORAGE_USERS_POSIX_ENABLE_FS_REVISIONS: the configured strategy cleans
up a file whenever a change on disk creates a version, with and without
background workers, and the command deletes such versions. The
collaborativePosix suite doesn't run in the CI for now
(https://github.com/opencloud-eu/opencloud/issues/2036), so these
scenarios are ready for when it does again; they pass locally. The
suite gets the FilesVersionsContext, whose steps its existing version
scenarios already use.

New steps: in CliContext, running the command for all spaces, a space,
a path within a space, a path on the POSIX filesystem, or with flags
only; checking the exact exit code; and checking the objects of a JSON
output, which "the command output should contain" can't match as it
contains quotes. In FilesVersionsContext, a number of versions that is
checked until it matches, for the cleanup that runs in the background
after postprocessing. In WebDav, the Given form of an upload with
content and a modification time.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-23 23:59:43 +01:00