@@ -556,8 +556,8 @@ func TestClient_New_ImageRegistryDefaults(t *testing.T) {
556556// Deploy (and confirms expected fields calculated).
557557func TestClient_New_Delegation (t * testing.T ) {
558558 var (
559- root = "testdata/example.com/test-new-delegates" // .. in which to initialize
560- expectedName = "test-new-delegates" // expected to be derived
559+ root = absPath ( "testdata/example.com/test-new-delegates" ) // .. in which to initialize
560+ expectedName = "test-new-delegates" // expected to be derived
561561 expectedImage = "example.com/alice/test-new-delegates:latest"
562562 builder = mock .NewBuilder ()
563563 pusher = mock .NewPusher ()
@@ -642,7 +642,7 @@ func TestClient_New_Delegation(t *testing.T) {
642642// See TestClient_Runner for the test of the default runner implementation.
643643func TestClient_Run (t * testing.T ) {
644644 // Create the root function directory
645- root := "testdata/example.com/test-run"
645+ root := absPath ( "testdata/example.com/test-run" )
646646 defer Using (t , root )()
647647
648648 // client with the mock runner and the new test function
@@ -2235,3 +2235,11 @@ func TestClient_BuildPopulatesRuntimeImage(t *testing.T) {
22352235 t .Fatalf ("written image in ./.func/built-image '%s' does not match expected '%s'" , got , expect )
22362236 }
22372237}
2238+
2239+ func absPath (p string ) string {
2240+ abs , err := filepath .Abs (p )
2241+ if err != nil {
2242+ panic (err )
2243+ }
2244+ return abs
2245+ }
0 commit comments