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:
Grigory Entin
2022-06-21 00:06:55 +02:00
committed by GitHub
parent 1d4c2aaa3f
commit 7105919f0c
3 changed files with 126 additions and 3 deletions

View File

@@ -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)