VerifyAppPackageContentsV3 verifies the contents of a V3 app package by downloading the package zip and verifying the zipped files match the passed files.
(appName string, files ...string)
| 14 | // VerifyAppPackageContentsV3 verifies the contents of a V3 app package by downloading the package zip and |
| 15 | // verifying the zipped files match the passed files. |
| 16 | func VerifyAppPackageContentsV3(appName string, files ...string) { |
| 17 | tmpZipFilepath, err := os.CreateTemp("", "") |
| 18 | defer os.Remove(tmpZipFilepath.Name()) |
| 19 | Expect(err).ToNot(HaveOccurred()) |
| 20 | |
| 21 | downloadFirstAppPackage(appName, tmpZipFilepath.Name()) |
| 22 | Expect(err).ToNot(HaveOccurred()) |
| 23 | |
| 24 | info, err := tmpZipFilepath.Stat() |
| 25 | Expect(err).ToNot(HaveOccurred()) |
| 26 | reader, err := ykk.NewReader(tmpZipFilepath, info.Size()) |
| 27 | Expect(err).ToNot(HaveOccurred()) |
| 28 | |
| 29 | seenFiles := []string{} |
| 30 | for _, file := range reader.File { |
| 31 | seenFiles = append(seenFiles, file.Name) |
| 32 | } |
| 33 | |
| 34 | Expect(seenFiles).To(ConsistOf(files)) |
| 35 | } |
| 36 | |
| 37 | func GetFirstAppPackageGuid(appName string) string { |
| 38 | commandName := "v3-packages" |
no test coverage detected