Skip to content

Commit 8abef52

Browse files
authored
Merge pull request #11593 from owncloud/tests/resume-specific-file
[tests-only][full-ci] add tests for resume upload sessions of a single file using cli
2 parents 8330c11 + 7e06756 commit 8abef52

File tree

8 files changed

+34
-11
lines changed

8 files changed

+34
-11
lines changed

tests/acceptance/bootstrap/CliContext.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,14 +397,16 @@ public function theAdministratorRestartsTheUploadSessionsThatAreInPostprocessing
397397
}
398398

399399
/**
400-
* @When the administrator restarts the upload sessions of file :file
400+
* @When /^the administrator (restarts|resumes) the upload session of file "([^"]*)" using the CLI$/
401401
*
402+
* @param string $flag
402403
* @param string $file
403404
*
404405
* @return void
405406
* @throws JsonException
406407
*/
407-
public function theAdministratorRestartsUploadSessionsOfFile(string $file): void {
408+
public function theAdministratorResumesOrRestartsUploadSessionOfFileUsingTheCLI(string $flag, string $file): void {
409+
$flag = rtrim($flag, "s");
408410
$response = CliHelper::runCommand(["command" => "storage-users uploads sessions --json"]);
409411
$this->featureContext->theHTTPStatusCodeShouldBe(200, '', $response);
410412
$responseArray = $this->getJSONDecodedCliMessage($response);
@@ -415,7 +417,7 @@ public function theAdministratorRestartsUploadSessionsOfFile(string $file): void
415417
}
416418
}
417419

418-
$command = "storage-users uploads sessions --id=$uploadId --restart --json";
420+
$command = "storage-users uploads sessions --id=$uploadId --$flag --json";
419421
$body = [
420422
"command" => $command,
421423
];

tests/acceptance/features/cliCommands/authAppToken.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@env-config
22
Feature: create auth-app token
3-
As an admin
3+
As an administrator
44
I want to create auth-app Tokens
55
So that I can use 3rd party apps
66

tests/acceptance/features/cliCommands/backupConsistency.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@env-config
22
Feature: backup consistency
3-
As a user
3+
As an administrator
44
I want to check my data for inconsistencies
55
So that I can backup my data
66

tests/acceptance/features/cliCommands/emailNotification.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@env-config @email
22
Feature: get grouped email notification
3-
As a user
3+
As an administrator
44
I want to get email notification of grouped events related to me either daily or weekly
55
So that I can stay updated about the events either once a day or once a week
66

tests/acceptance/features/cliCommands/searchReIndex.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@env-config
22
Feature: reindex space via CLI command
3-
As an admin
3+
As an administrator
44
I want to reindex space
55
So that I can improve search performance by ensuring that the index is up-to-date
66

tests/acceptance/features/cliCommands/staleUpload.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@env-config @cli-stale-uploads
22
Feature: stale upload via CLI command
3-
As a user
3+
As an administrator
44
I want to manage stale uploads
55
So that I clean up stale uploads from storage
66

tests/acceptance/features/cliCommands/trashBin.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@env-config
22
Feature: trashbin
3-
As a administrator
3+
As an administrator
44
I want to manage trash-bin
55
So that I can manage handle trashed resources efficiently
66

tests/acceptance/features/cliCommands/uploadSessions.feature

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@env-config @cli-uploads-sessions
22
Feature: List upload sessions via CLI command
3-
As a user
3+
As an administrator
44
I want to list the upload sessions
55
So that I can manage the upload sessions
66

@@ -106,7 +106,7 @@ Feature: List upload sessions via CLI command
106106
When the administrator waits for "3" seconds
107107
Then for user "Alice" file "file1.txt" of space "Personal" should be in postprocessing
108108
And for user "Alice" file "file2.txt" of space "Personal" should be in postprocessing
109-
When the administrator restarts the upload sessions of file "file1.txt"
109+
When the administrator restarts the upload session of file "file1.txt" using the CLI
110110
Then the command should be successful
111111
And the CLI response should contain these entries:
112112
| file1.txt |
@@ -179,6 +179,27 @@ Feature: List upload sessions via CLI command
179179
Then the content of file "file.txt" for user "Alice" should be "upload content"
180180

181181

182+
Scenario: resume upload session of a single file
183+
Given the config "POSTPROCESSING_DELAY" has been set to "3s"
184+
And user "Alice" has uploaded file with content "uploaded content" to "file1.txt"
185+
And user "Alice" has uploaded file with content "uploaded content" to "file2.txt"
186+
And the administrator has waited for "1" seconds
187+
And the administrator has stopped the server
188+
And the administrator has started the server
189+
When the administrator waits for "3" seconds
190+
Then for user "Alice" file "file1.txt" of space "Personal" should be in postprocessing
191+
And for user "Alice" file "file2.txt" of space "Personal" should be in postprocessing
192+
When the administrator resumes the upload session of file "file1.txt" using the CLI
193+
Then the command should be successful
194+
And the CLI response should contain these entries:
195+
| file1.txt |
196+
And the CLI response should not contain these entries:
197+
| file2.txt |
198+
When the administrator waits for "3" seconds
199+
Then for user "Alice" file "file2.txt" of space "Personal" should be in postprocessing
200+
And the content of file "file1.txt" for user "Alice" should be "uploaded content"
201+
202+
182203
Scenario: restart expired upload sessions
183204
Given a file "large.zip" with the size of "2GB" has been created locally
184205
And the config "STORAGE_USERS_UPLOAD_EXPIRATION" has been set to "1"

0 commit comments

Comments
 (0)