OpenTracing for Fission (#1079)
Added Opentracing integration using opencensus libraries for all Fission components.
This commit is contained in:
@@ -18,6 +18,7 @@ package client
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
@@ -64,7 +65,8 @@ func TestStorageService(t *testing.T) {
|
||||
|
||||
// store it
|
||||
metadata := make(map[string]string)
|
||||
fileId, err := client.Upload(tmpfile.Name(), &metadata)
|
||||
ctx := context.Background()
|
||||
fileId, err := client.Upload(ctx, tmpfile.Name(), &metadata)
|
||||
panicIf(err)
|
||||
|
||||
// make a temp file for verification
|
||||
@@ -73,7 +75,7 @@ func TestStorageService(t *testing.T) {
|
||||
os.Remove(retrievedfile.Name())
|
||||
|
||||
// retrieve uploaded file
|
||||
err = client.Download(fileId, retrievedfile.Name())
|
||||
err = client.Download(ctx, fileId, retrievedfile.Name())
|
||||
panicIf(err)
|
||||
defer os.Remove(retrievedfile.Name())
|
||||
|
||||
@@ -87,11 +89,11 @@ func TestStorageService(t *testing.T) {
|
||||
}
|
||||
|
||||
// delete uploaded file
|
||||
err = client.Delete(fileId)
|
||||
err = client.Delete(ctx, fileId)
|
||||
panicIf(err)
|
||||
|
||||
// make sure download fails
|
||||
err = client.Download(fileId, "xxx")
|
||||
err = client.Download(ctx, fileId, "xxx")
|
||||
if err == nil {
|
||||
log.Panic("Download succeeded but file isn't supposed to exist")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user