Skip to content

Commit 6975d0d

Browse files
committed
added test to restart and resume all stale uploads
1 parent 34a8b9a commit 6975d0d

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

tests/acceptance/bootstrap/CliContext.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,4 +894,21 @@ public function theAdministratorRestoresTheTrashedResourcesOfSpaceOwnedByUser(
894894
];
895895
$this->featureContext->setResponse(CliHelper::runCommand($body));
896896
}
897+
898+
/**
899+
* @When /^the administrator (resumes|restarts) all the stale uploads$/
900+
*
901+
* @param string $flag
902+
*
903+
* @return void
904+
* @throws GuzzleException
905+
*/
906+
public function theAdministratorResumesOrRestartsAllTheStaleUploads(string $flag): void {
907+
$flag = rtrim($flag, "s");
908+
$command = "storage-users uploads sessions --$flag --json";
909+
$body = [
910+
"command" => $command
911+
];
912+
$this->featureContext->setResponse(CliHelper::runCommand($body));
913+
}
897914
}

tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,5 +403,10 @@ The expected failures in this file are from features in the owncloud/ocis repo.
403403
- [apiActivities/activities.feature:4108](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiActivities/activities.feature#L4108)
404404
- [apiActivities/activitiesByFileId.feature:1842](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiActivities/activitiesByFileId.feature#L1842)
405405

406+
#### [[CLI]Restart and Resume stale uploads returns empty list](https://github.com/owncloud/ocis/issues/11296)
407+
408+
- [cliCommands/staleUpload.feature:85](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/cliCommands/staleUpload.feature#L85)
409+
- [cliCommands/staleUpload.feature:97](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/cliCommands/staleUpload.feature#L97)
410+
406411
Note: always have an empty line at the end of this file.
407412
The bash script that processes this file requires that the last line has a newline on the end.

tests/acceptance/features/cliCommands/staleUpload.feature

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,27 @@ Feature: stale upload via CLI command
8080
Total stale nodes: 1
8181
"""
8282
And there should be "0" stale uploads of space "Personal" owned by user "Alice"
83+
84+
@issue-11296
85+
Scenario: resume all stale uploads
86+
Given the config "POSTPROCESSING_DELAY" has been set to "10s"
87+
And user "Alice" has uploaded file with content "some content" to "textfile.txt"
88+
And the administrator has stopped the server
89+
And the administrator has created stale upload
90+
And the administrator has started the server
91+
When the administrator resumes all the stale uploads
92+
Then the command should be successful
93+
And the CLI response should contain these entries:
94+
| textfile.txt |
95+
96+
@issue-11296
97+
Scenario: restart all stale uploads
98+
Given the config "POSTPROCESSING_DELAY" has been set to "10s"
99+
And user "Alice" has uploaded file with content "some content" to "textfile.txt"
100+
And the administrator has stopped the server
101+
And the administrator has created stale upload
102+
And the administrator has started the server
103+
When the administrator restarts all the stale uploads
104+
Then the command should be successful
105+
And the CLI response should contain these entries:
106+
| textfile.txt |

0 commit comments

Comments
 (0)