1414 - directory
1515 - wildcard-patterns
1616 - large-files
17+ - large-multipart-test
1718 bucket :
1819 description : ' OBS bucket name for testing'
1920 required : false
4546 chmod +x generate-test-files.sh
4647 ./generate-test-files.sh
4748
49+ - name : Create large test file (>1GB) for multipart upload testing
50+ if : inputs.test_scenario == 'large-files' || inputs.test_scenario == 'large-multipart-test'
51+ run : |
52+ echo "π₯ Creating large test file (>1GB) for multipart upload testing..."
53+
54+ # Create a 1.2GB test file using dd with /dev/zero for speed
55+ # This will trigger the multipart upload functionality
56+ dd if=/dev/zero of=test-files/large-multipart-test.bin bs=1M count=1200 status=progress
57+
58+ # Verify file size
59+ FILE_SIZE=$(stat -c%s test-files/large-multipart-test.bin)
60+ FILE_SIZE_MB=$((FILE_SIZE / 1024 / 1024))
61+ echo "β
Created large test file: ${FILE_SIZE_MB}MB (${FILE_SIZE} bytes)"
62+
63+ # This should be larger than 1GB threshold (1073741824 bytes)
64+ if [ $FILE_SIZE -gt 1073741824 ]; then
65+ echo "π― File size exceeds 1GB threshold - will trigger multipart upload"
66+ else
67+ echo "β οΈ File size is below 1GB threshold - multipart upload may not be triggered"
68+ fi
69+
70+ # List all test files for verification
71+ echo "π All test files created:"
72+ ls -lh test-files/
73+
4874 - name : Test Single File Upload
4975 if : inputs.test_scenario == 'single-file'
5076 uses : ./
@@ -119,13 +145,61 @@ jobs:
119145 storage_class : STANDARD
120146 retry_count : 5
121147
148+ - name : Test Large Multipart Upload (>1GB)
149+ if : inputs.test_scenario == 'large-files' || inputs.test_scenario == 'large-multipart-test'
150+ uses : ./
151+ with :
152+ access_key : ${{ env.OBS_ACCESS_KEY }}
153+ secret_key : ${{ env.OBS_SECRET_KEY }}
154+ region : ${{ env.OBS_REGION }}
155+ bucket : ${{ env.OBS_BUCKET }}
156+ operation : upload
157+ local_path : test-files/large-multipart-test.bin
158+ obs_path : test-uploads/multipart/
159+ progress : true
160+ checksum_validation : false # Disable for large files to save time
161+ storage_class : STANDARD
162+ retry_count : 3
163+ timeout : 1800000 # 30 minutes timeout for large uploads
164+
122165 - name : Verify Upload Results
123166 run : |
167+ echo "## π― Upload Test Results Summary"
124168 echo "Upload test completed for scenario: ${{ inputs.test_scenario }}"
169+ echo ""
170+
171+ if [ "${{ inputs.test_scenario }}" = "large-files" ] || [ "${{ inputs.test_scenario }}" = "large-multipart-test" ]; then
172+ echo "### π Large File Upload Test"
173+ echo "- β
1.2GB test file created and uploaded"
174+ echo "- π§ Multipart upload should have been triggered automatically"
175+ echo "- π Check logs above for multipart upload messages:"
176+ echo " - Look for: 'π¦ Large file detected (1200MB), using multipart upload'"
177+ echo " - Look for: 'π¦ Multipart upload initialized'"
178+ echo " - Look for: 'π¦ Part X uploaded'"
179+ echo " - Look for: 'β
Large file uploaded successfully'"
180+ echo ""
181+ echo "### π What to Verify in OBS:"
182+ echo "- File should be uploaded to: test-uploads/multipart/large-multipart-test.bin"
183+ echo "- File size should be exactly 1,258,291,200 bytes (1.2GB)"
184+ echo "- No 403 Forbidden errors should occur"
185+ fi
186+
125187 echo "Check the action outputs and OBS bucket for uploaded files"
126188
127189 - name : Cleanup Test Files
128190 if : always()
129191 run : |
192+ echo "π§Ή Cleaning up test files..."
193+
194+ # Show space usage before cleanup
195+ echo "Disk usage before cleanup:"
196+ df -h
197+
198+ # Remove test files
130199 rm -rf test-files/
131- echo "Test files cleaned up"
200+
201+ echo "β
Test files cleaned up"
202+
203+ # Show space usage after cleanup
204+ echo "Disk usage after cleanup:"
205+ df -h
0 commit comments