Commit Graph
15 Commits
Author SHA1 Message Date
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
Viktor Scharf f3693ef112 api-test: cover additional unified roles in acceptance tests (#3169) 2026-07-27 09:12:38 +02:00
Viktor Scharf a53eb44083 steps refactoring (#3100) 2026-07-14 09:32:35 +02:00
Viktor Scharf f6b5a961da clean up tests 2025-02-11 11:27:05 +01:00
Viktor Scharf 72fd765b93 delete unnecessary steps from context files 2025-02-05 19:43:12 +01:00
Jörn Friedrich Dreyer a5c9cbc26e drop project reference in testsuite headers, copyright and license remain
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-01-29 17:20:44 +01:00
Niraj Acharya 089ccc1ca3 updating lint rules for test code 2024-12-30 09:18:45 +05:45
amrita e83b63ffe6 rename variable name and remove unwanted function 2024-12-02 16:53:12 +05:45
amrita 8cc13a2dbe add tests for file version with OCIS_DISABLE_VERSIONING config 2024-10-22 12:26:47 +05:45
Saw-jan f86d137f87 test: make remote.php configurable
test: build dav paths

test: fix paths

test: merge method args

test: add issue tags

test: add new expected failure file

test: merge expected-failure files before running tests
2024-10-21 16:57:58 +05:45
Saw-jan ca76f79be3 test: get necessary contexts properly 2024-10-08 15:17:44 +05:45
Niraj Acharya e906f9f9b5 refactoring test code 2024-10-08 14:46:33 +05:45
Niraj Acharya db844fb5ab removing SPACE_ID_FROM_OCIS from test code 2024-10-03 09:08:10 +05:45
prashant-gurung899 809b7a4373 add tests to check versions of file in a space shared via link
Signed-off-by: prashant-gurung899 <prasantgrg777@gmail.com>
2024-09-10 11:56:58 +05:45
prashant-gurung899 d8d7b700cd reorganize test folders within the acceptance directory
Signed-off-by: prashant-gurung899 <prasantgrg777@gmail.com>
2024-08-28 14:54:45 +05:45