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] add test to clean upload sessions that are not processing using CLI command #10260

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
8 changes: 5 additions & 3 deletions tests/acceptance/bootstrap/CliContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,14 @@ public function theAdministratorListsAllTheUploadSessions(?string $flag = null):
}

/**
* @When the administrator cleans all expired upload sessions
* @When the administrator cleans upload sessions with flag :flag
*
* @param string $flag
*
* @return void
*/
public function theAdministratorCleansAllExpiredUploadSessions(): void {
$command = "storage-users uploads sessions --expired --clean --json";
public function theAdministratorCleansAllExpiredUploadSessions(string $flag): void {
$command = "storage-users uploads sessions --$flag --clean --json";
$body = [
"command" => $command
];
Expand Down
18 changes: 17 additions & 1 deletion tests/acceptance/features/cliCommands/uploadSessions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,26 @@ Feature: List upload sessions via CLI command
And the config "STORAGE_USERS_UPLOAD_EXPIRATION" has been set to "0"
And user "Alice" has uploaded file with content "upload content" to "/file2.txt"
And user "Alice" has uploaded file with content "upload content" to "/file3.txt"
When the administrator cleans all expired upload sessions
When the administrator cleans upload sessions with flag "expired"
Then the command should be successful
And the CLI response should contain these entries:
| file2.txt |
| file3.txt |
And the CLI response should not contain these entries:
| file1.txt |


Scenario: user cleans all upload sessions that are not processing
Given the following configs have been set:
| config | value |
| POSTPROCESSING_STEPS | virusscan |
| ANTIVIRUS_INFECTED_FILE_HANDLING | abort |
And user "Alice" has uploaded file "filesForUpload/filesWithVirus/eicar.com" to "/virusFile.txt"
And the config "POSTPROCESSING_DELAY" has been set to "10s"
And user "Alice" has uploaded file with content "upload content" to "/file1.txt"
When the administrator cleans upload sessions with flag "processing=false"
Then the command should be successful
And the CLI response should contain these entries:
| virusFile.txt |
And the CLI response should not contain these entries:
| file1.txt |