-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #529 from awels/fix_double_unit_test
Removed double run of unit test.
- Loading branch information
Showing
2 changed files
with
26 additions
and
39 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,39 @@ | ||
package importer | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"path/filepath" | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
|
||
"testing" | ||
|
||
"kubevirt.io/containerized-data-importer/tests/reporters" | ||
) | ||
|
||
// Known size.Size() exceptions due to: | ||
// 1) .gz and .xz not supporting size in their headers (but that's ok if they are wrapped by tar | ||
// or the underlying file is a qcow2 file), and | ||
// 2) in tinyCore.iso where the returned size is smaller than the original. Note: this is not | ||
// the case for larger iso files such as windows. | ||
var sizeExceptions = map[string]struct{}{ | ||
".iso": {}, | ||
".iso.gz": {}, | ||
".iso.xz": {}, | ||
} | ||
|
||
func TestImporter(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecsWithDefaultAndCustomReporters(t, "Importer Suite", reporters.NewReporters()) | ||
} | ||
|
||
var _ = AfterSuite(func() { | ||
for _, filename := range testfiles { | ||
os.Remove(filepath.Join(os.TempDir(), filename)) | ||
} | ||
fmt.Fprintf(GinkgoWriter, "\nINFO: the following file formats are skipped in the `size.Size()` tests:\n") | ||
for ex := range sizeExceptions { | ||
fmt.Fprintf(GinkgoWriter, "\t%s\n", ex) | ||
} | ||
}) |