[BE] Manual Testing Multi-File Snippet Feature
Multi-File Snippet Testing
We need to ensure that the multiple file snippets feature is working before the feature flag is turned on (or removed).
We can enable it per user for testing (Feature.enable(:snippet_multiple_files, user)
), and the following is a proposed plan for how to test (these operations should be tested for both Personal and Project Snippets).
WIP Testing plan:
From a backend perspective, we need to test:
REST API Testing
-
Create a new Snippet with a single file
-
Creation with file_name
andcontent
should succeed -
Creation with files
andfile_name
should fail -
Creation with files
andcontent
should fail -
Creation with files
should succeed-
file_name
andcontent
are populated -
snippet.blobs.count
should be1
-
blob.data
should be correct -
blob.path
should be correct
-
-
-
Create a new Snippet with multiple files using
files
parameter-
with multiple files with same file_path
should error -
with multiple files with different file_path
should succeed-
file_name
andcontent
are populated -
snippet.blobs.count
should be correct -
blob.data
should be correct -
blob.path
should be correct
-
-
any file with missing content
should error -
any file with missing file_path
should error
-
-
Update a single file Snippet:
-
update title and description should succeed -
update title/description and content
should succeed -
update file_name
andcontent
should succeed-
snippet.blobs.count
should be 1 -
blob.data
should be correct -
blob.path
should be correct
-
-
using
files
-
rename the original file should succeed -
remove all files should error -
create a file and remove the original should succeed -
create multiple files with different file_path
should succeed -
create multiple files with same file_path
should error -
create a file and rename another should succeed
- for each successful update:
-
snippet.blobs.count
should be correct -
blob.data
should all be correct -
blob.path
should all be correct
-
-
-
-
Update a multiple file Snippet:
-
update using file_name
andcontent
should error
-
using
files
-
add more files should succeed -
update existing files content should succeed -
remove a file should succeed -
remove all files should error -
renaming files should succeed
- for each successful update:
-
snippet.blobs.count
should be correct -
blob.data
should all be correct -
blob.path
should all be correct
-
-
-
-
Deleting a Snippet should succeed
GraphQL Testing
-
Create a new Snippet with a single file
-
Creation withfile_name
andcontent
should succeed -
Creation withblob_actions
andfile_name
should fail -
Creation with blob_actions
should succeed-
file_name
andcontent
are populated -
snippet.blobs.count
should be 1 -
blob.data
should be correct -
blob.path
should be correct
-
-
-
Create a new Snippet with multiple files using
blob_actions
parameter-
with multiple files with same file_path
should error -
with multiple files with different file_path
should succeed -
any file with missing content
should error -
any file with missing file_path
should succeed asnippetfile1.txt
should be created -
file_name
andcontent
should be populated -
snippet.blobs.count
should be correct -
blob.data
should all be correct -
blob.path
should all be correct
-
-
Update a single file Snippet:
-
update title and description should succeed -
update title/description andcontent
should succeed -
updatefile_name
andcontent
should succeed
-
using
blob_actions
-
rename the original file should succeed -
remove all files should error -
create a file and remove the original should succeed -
create multiple files with different file_path
should succeed -
create multiple files with same file_path
should error -
create a file and rename another should succeed
- for each successful update:
-
snippet.blobs.count
should be correct -
blob.data
should all be correct -
blob.path
should all be correct
-
-
-
-
Update a multiple file Snippet:
-
update usingfile_name
andcontent
should error
-
using
blob_actions
-
add more files should succeed -
update existing files content should succeed -
remove a file should succeed -
remove all files should error -
renaming files should succeed
- for each successful update:
-
snippet.blobs.count
should be correct -
blob.data
should all be correct -
blob.path
should all be correct
-
-
-
-
Deleting a Snippet should succeed
Git Testing
-
add files to Snippet should succeed -
remove a file from Snippet should succeed -
remove all files from Snippet should error -
rename files should succeed -
update file content should succeed -
Pushing more than 10 files should error
- for each successful update:
-
snippet.blobs.count
should be correct -
blob.data
should all be correct -
blob.path
should all be correct
-
———————
From a full integration perspective, we need to test:
With the flag disabled:
-
Create a new Snippet via the UI
-
Snippet is successfully created -
Repository Blob is created snippet.blobs.count
should be1
-
Blob path
should match the snippetfile_name
-
Blob data
should match the snippetcontent
- Clone the repository
-
Only one file is present (should match file_name
andcontent
)
-
-
-
Update the Snippet via the UI
-
Check the Snippet DB fields are updated (title/description) -
Check the Snippet file is updated (file name / content) -
blob.data
should be updated -
blob.path
should be updated
-
-
-
Update the Snippet via git
-
Push changes to the single file should be successful -
Push multiple files should fail
- Go to the snippet in the UI
-
Pushed file change(s) should be visible in show view -
Pushed file change(s) should be visible in edit view
-
-
-
Delete the Snippet via the UI
-
Snippet should delete as normal
-
With the flag enabled:
-
Create a new single-file Snippet via the UI
-
Snippet is successfully created -
Repository Blob is created snippet.blobs.count
should be1
-
Blob path
should match the snippetfile_name
-
Blob data
should match the snippetcontent
- Clone the repository
-
Only one file is present (should match file_name
andcontent
)
-
-
-
Update the new single-file Snippet via the UI
-
Check the Snippet DB fields are updated (title/description) -
Check the Snippet file is updated (file name / content) -
blob.data
should be updated -
blob.path
should be updated
-
-
-
Add a file to the Snippet
-
Two blobs
should be present -
Blob data
andpath
for both files should be correct -
Two files visible in show view -
File content changes are visible in RAW endpoints
-
-
Add two files, remove one file (same submission)
-
Removed file blob should be removed -
Added file blobs should be correct -
Three blobs
should be present -
Blob data
andpath
for each file should be correct
-
-
Rename one file
-
File name is updated -
blob.path
is updated -
New file name visibile in UI show view -
New file name is visibile in UI edit view
-
-
Rename multiple files
-
File names are updated -
blob.path
for each are updated
-
-
Swap the name of two files
-
Error is displayed (known issue)
-
-
Attempt to remove all files
-
Error is displayed
-
-
Remove all files and add one or more
-
Action is successful
-
-
Try creating more than 10 files
-
The UI wouldn't allow it
-
-
Create a file with HTML content
-
The file should be displayed in the UI show
-
-
Update the Snippet via git
-
Clone the repo -
Files should be present (matching final actions above) -
Push file removal change -
Push file creation change -
Push file rename change -
Push file content update change -
snippet.blobs
matches changes
-
-
Go to the snippet in the UI
-
Pushed file change(s) should be visible in show view -
Pushed file change(s) should be visible in edit view -
File content changes are visible in RAW endpoint
-
-
Delete the Snippet via the UI
-
Snippet should delete as normal
-
-
Create a new multi-file Snippet in the UI
-
Snippet is successfully created -
Repository blobs are created snippet.blobs.count
-
Blobs path
should match -
Blobs data
should match
-
-
Update the Snippet via the UI
-
All created files are visible in Edit form
-
-
Add a file to the Snippet
-
snippet.blobs
should be match -
Blobs data
andpath
for all files should be correct
-
Rename one file
-
File name is updated -
blob.path
is updated
-
-
Rename multiple files
-
File names are updated -
blob.path
for each are updated
-
Swap the name of two files
-
Error is displayed (known issue)
-
-
Attempt to remove all files
-
Error is displayed
-
-
Remove all files and add one or more
-
Action is successful
-
-
Clone the repository
-
Files should be present (matching final actions above) -
Push file removal change -
Push file creation change -
Push file rename change -
Push file content update change -
snippet.blobs
matches changes
-
-
Go to the snippet in the UI
-
Pushed file change(s) should be visible in show view -
Pushed file change(s) should be visible in edit view
-
-
Delete the Snippet via the UI
-
Snippet should delete as normal
-
-
View an existing Snippet in the UI (pre-multi-file snippet feature)
-
Only one file should be visible
-
-
Update an existing Snippet in the UI (pre-multi-file snippet feature)
-
Add a file to the Snippet
-
snippet.blobs
should be match -
Blobs data
andpath
for all files should be correct -
Multiple files visibile in UI
-
-
Rename one file
-
File name is updated -
blob.path
is updated
-
-
Rename multiple files
-
File names are updated -
blob.path
for each are updated
-
-
Swap the name of two files
-
Error is displayed (known issue)
-
-
Attempt to remove all files
-
Error is displayed
-
-
Remove all files and add one or more
-
Action is successful
-
-
-
Export project with snippet with multiple files (operation should succeed) -
Import exported project (operation should succeed)
QA Testing
Performed by @a_mcdonald
To cover a happy path:
-
E2E test to create a personal snippet with multiple files gitlab-org/quality/testcases#842 (closed) -
E2E test to create a project snippet with multiple files gitlab-org/quality/testcases#1024 (closed) -
E2E test to delete one of multiple snippet files gitlab-org/quality/testcases#1023 (closed) -
E2E test to add a file to snippet gitlab-org/quality/testcases#1022 (closed)
Manual testing:
-
Exploratory testing - ongoing