-
Notifications
You must be signed in to change notification settings - Fork 223
[tests-only][full-ci] add tests for post processing command for different steps #11607
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
base: master
Are you sure you want to change the base?
Conversation
da6ed82
to
d9deb78
Compare
2245bce
to
d1d300b
Compare
// $responseBody["message"] contains a message info with the array of output json of the upload sessions command | ||
// Example Output: "INFO memory is not limited, skipping package=github.com/KimMachineGun/automemlimit/memlimit [{<output-json>}]" | ||
// So, only extracting the array of output json from the message | ||
\preg_match('/(\[.*\])/', $responseBody["message"], $matches); | ||
return \json_decode($matches[1], null, 512, JSON_THROW_ON_ERROR); | ||
\preg_match('/(\[.*?\])/', $responseBody["message"], $matches); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- \preg_match('/(\[.*\])/', $responseBody["message"], $matches);
+ \preg_match('/(\[.*?\])/', $responseBody["message"], $matches);
making regex non-greedy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but why was it required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not needed for current scenario, so I will leave it as is (no changes)
d1d300b
to
087234c
Compare
Signed-off-by: nabim777 <[email protected]>
087234c
to
418ddc0
Compare
Signed-off-by: nabim777 <[email protected]>
418ddc0
to
d6eab5f
Compare
|
@@ -525,6 +525,38 @@ public function theAdministratorResumesOrRestartsUploadSessionOfFileUsingPostpro | |||
$this->featureContext->setResponse(CliHelper::runCommand($body)); | |||
} | |||
|
|||
/** | |||
* @When /^the administrator resumes all the uploads session using the post processing command$/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @When /^the administrator resumes all the uploads session using the post processing command$/ | |
* @When the administrator resumes all the uploads session using the post processing command |
Scenario: resume virus file upload failed on virus scan step using postprocessing command | ||
Given the following configs have been set: | ||
| config | value | | ||
| POSTPROCESSING_STEPS | delay,virusscan | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above scenario should cover this as well
| POSTPROCESSING_STEPS | delay,virusscan | | ||
| ANTIVIRUS_INFECTED_FILE_HANDLING | abort | | ||
| POSTPROCESSING_DELAY | 10s | | ||
And user "Alice" has created a new TUS resource in the space "Personal" with the following headers: | ||
| Upload-Length | 10 | | ||
# dGV4dEZpbGUudHh0 is the base64 encode of textFile.txt | ||
| Upload-Metadata | filename dGV4dEZpbGUudHh0 | | ||
| Tus-Resumable | 1.0.0 | | ||
And user "Alice" has uploaded file with checksum "SHA1 8cb2237d0679ca88db6464eac60da96345513964" to the last created TUS Location with offset "0" and content "12345" via TUS inside of the space "Personal" using the WebDAV API | ||
And user "Alice" has uploaded file "filesForUpload/filesWithVirus/eicar.com" to "/virusFile.txt" | ||
And user "Alice" has uploaded file with content "uploaded content" to "file.txt" | ||
And the administrator has waited for "1" seconds | ||
And the administrator has stopped the server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with this flow, the file upload doesn't fail on virusscan, it fails on delay step
@@ -245,3 +245,107 @@ Feature: List upload sessions via CLI command | |||
When the administrator waits for "3" seconds | |||
Then for user "Alice" file "file2.txt" of space "Personal" should be in postprocessing | |||
And the content of file "file1.txt" for user "Alice" should be "uploaded content" | |||
|
|||
|
|||
Scenario: resume all failed upload but not for unfinished upload using postprocessing command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
finding it difficult to understand the title
Scenario: resume all failed upload but not for unfinished upload using postprocessing command | |
Scenario: resume all upload sessions containing unfinished upload using postprocessing command |
And the administrator has waited for "1" seconds | ||
And the administrator has stopped the server | ||
And the administrator has started the server | ||
When the administrator resumes all uploads session in finished step using post processing command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what constitutes a finished step? the test flow is same creating failed uploads
And the administrator has waited for "1" seconds | ||
And the administrator has stopped the server | ||
And the administrator has started the server | ||
When the administrator resumes all the uploads session using the post processing command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the administrator resumes all the uploads session using the post processing command | |
When the administrator resumes all the upload sessions using the postprocessing command |
And the administrator has waited for "1" seconds | ||
And the administrator has stopped the server | ||
And the administrator has started the server | ||
When the administrator resumes all uploads session in finished step using post processing command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the administrator resumes all uploads session in finished step using post processing command | |
When the administrator resumes all upload sessions in finished step using postprocessing command |
Description
This PR adds a test for postprocessing command to resume on
finished
andvirusscan
steps defined failed uploads.For more information about this command 👉 click here
Related Issue
Motivation and Context
Screenshots (if appropriate):
Types of changes
Checklist: