99 "strings"
1010 "testing"
1111
12+ "github.com/docker/app/internal/relocated"
13+
1214 "gotest.tools/fs"
1315
1416 "github.com/docker/app/internal/store"
@@ -30,11 +32,8 @@ func TestBuild(t *testing.T) {
3032
3133 cfg := getDockerConfigDir (t , cmd )
3234
33- f := path .Join (cfg , "app" , "bundles" , "docker.io" , "library" , "single" , "_tags" , "1.0.0" , "bundle.json" )
34- data , err := ioutil .ReadFile (f )
35- assert .NilError (t , err )
36- var bndl bundle.Bundle
37- err = json .Unmarshal (data , & bndl )
35+ f := path .Join (cfg , "app" , "bundles" , "docker.io" , "library" , "single" , "_tags" , "1.0.0" , relocated .BundleFilename )
36+ bndl , err := relocated .BundleFromFile (f )
3837 assert .NilError (t , err )
3938
4039 built := []string {bndl .InvocationImages [0 ].Digest , bndl .Images ["web" ].Digest , bndl .Images ["worker" ].Digest }
@@ -53,7 +52,7 @@ func TestBuild(t *testing.T) {
5352 bytes , err := ioutil .ReadFile (iidfile )
5453 assert .NilError (t , err )
5554 iid := string (bytes )
56- actualID , err := store .FromBundle (& bndl )
55+ actualID , err := store .FromBundle (bndl )
5756 assert .NilError (t , err )
5857 assert .Equal (t , iid , fmt .Sprintf ("sha256:%s" , actualID .String ()))
5958 })
@@ -96,7 +95,7 @@ func TestBuildWithoutTag(t *testing.T) {
9695 assert .Equal (t , len (infos ), 1 )
9796 id := infos [0 ].Name ()
9897
99- f = path .Join (cfg , "app" , "bundles" , "_ids" , id , "bundle.json" )
98+ f = path .Join (cfg , "app" , "bundles" , "_ids" , id , relocated . BundleFilename )
10099 data , err := ioutil .ReadFile (f )
101100 assert .NilError (t , err )
102101 var bndl bundle.Bundle
@@ -127,7 +126,7 @@ func TestBuildWithArgs(t *testing.T) {
127126 assert .Equal (t , len (infos ), 1 )
128127 id := infos [0 ].Name ()
129128
130- f = path .Join (cfg , "app" , "bundles" , "_ids" , id , "bundle.json" )
129+ f = path .Join (cfg , "app" , "bundles" , "_ids" , id , relocated . BundleFilename )
131130 data , err := ioutil .ReadFile (f )
132131 assert .NilError (t , err )
133132 var bndl bundle.Bundle
0 commit comments