Skip to content

Commit

Permalink
Merge pull request #529 from awels/fix_double_unit_test
Browse files Browse the repository at this point in the history
Removed double run of unit test.
  • Loading branch information
awels authored Nov 19, 2018
2 parents b4fea7d + 5d794ca commit 1dd1986
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 39 deletions.
37 changes: 0 additions & 37 deletions pkg/importer/datastream_suite_test.go

This file was deleted.

28 changes: 26 additions & 2 deletions pkg/importer/importer_suite_test.go
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)
}
})

0 comments on commit 1dd1986

Please sign in to comment.