mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
Added support for chunked uploads. (#1208)
* Added tests for mid-size and big artifacts, reproducing a problem with chunked uploads. * Added support for chunked uploads. * Enforced overwriting uploaded artifacts on receiving the first chunk. Co-authored-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
parent
6b4cd9973b
commit
1d45a5f2c7
3 changed files with 126 additions and 3 deletions
|
@ -51,6 +51,16 @@ func (fsys MapFsImpl) Open(path string) (fs.File, error) {
|
|||
return WritableFile{result, fsys.MapFS, path}, err
|
||||
}
|
||||
|
||||
func (fsys MapFsImpl) OpenAtEnd(path string) (fs.File, error) {
|
||||
var file = fstest.MapFile{
|
||||
Data: []byte("content2"),
|
||||
}
|
||||
fsys.MapFS[path] = &file
|
||||
|
||||
result, err := fsys.MapFS.Open(path)
|
||||
return WritableFile{result, fsys.MapFS, path}, err
|
||||
}
|
||||
|
||||
func TestNewArtifactUploadPrepare(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue