(t *testing.T, rootPath string, archiveName string)
| 1711 | } |
| 1712 | |
| 1713 | func createZipFromDir(t *testing.T, rootPath string, archiveName string) string { |
| 1714 | zipDir := filepath.Join(t.TempDir(), rootPath) |
| 1715 | require.NoError(t, os.MkdirAll(zipDir, 0755)) |
| 1716 | |
| 1717 | storageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks()) |
| 1718 | testdataBucket, err := storageosProvider.NewReadWriteBucket( |
| 1719 | rootPath, |
| 1720 | storageos.ReadWriteBucketWithSymlinksIfSupported(), |
| 1721 | ) |
| 1722 | require.NoError(t, err) |
| 1723 | |
| 1724 | buffer := bytes.NewBuffer(nil) |
| 1725 | require.NoError(t, storagearchive.Zip( |
| 1726 | t.Context(), |
| 1727 | testdataBucket, |
| 1728 | buffer, |
| 1729 | true, |
| 1730 | )) |
| 1731 | |
| 1732 | zipBucket, err := storageosProvider.NewReadWriteBucket( |
| 1733 | zipDir, |
| 1734 | storageos.ReadWriteBucketWithSymlinksIfSupported(), |
| 1735 | ) |
| 1736 | require.NoError(t, err) |
| 1737 | require.NoError(t, storage.PutPath( |
| 1738 | t.Context(), |
| 1739 | zipBucket, |
| 1740 | archiveName, |
| 1741 | buffer.Bytes(), |
| 1742 | )) |
| 1743 | return zipDir |
| 1744 | } |
| 1745 | |
| 1746 | type expectedFileInfo struct { |
| 1747 | isImport bool |
no test coverage detected
searching dependent graphs…