distro/*: remove redundant manifest tests

The same test is run in distro/distro_test.go. The redundancy was probably
caused by a bitrot in several commits.

I decided to remove the test from distro implementations to reduce the amount
of duplicated code.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
Ondřej Budai 2021-03-11 13:01:05 +01:00 committed by Ondřej Budai
parent 3c715c7cf8
commit a7dee8b604
5 changed files with 6 additions and 24 deletions

View file

@ -65,10 +65,6 @@ func main() {
}
distros := distroregistry.NewDefault()
if err != nil {
panic(err)
}
d := distros.GetDistro(composeRequest.Distro)
if d == nil {
_, _ = fmt.Fprintf(os.Stderr, "The provided distribution '%s' is not supported. Use one of these:\n", composeRequest.Distro)

View file

@ -3,11 +3,12 @@ package fedora32_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/osbuild/osbuild-composer/internal/blueprint"
"github.com/osbuild/osbuild-composer/internal/distro"
"github.com/osbuild/osbuild-composer/internal/distro/distro_test_common"
"github.com/osbuild/osbuild-composer/internal/distro/fedora32"
"github.com/stretchr/testify/assert"
)
func TestFilenameFromType(t *testing.T) {
@ -295,10 +296,6 @@ func TestImageType_BasePackages(t *testing.T) {
}
}
func TestDistro_Manifest(t *testing.T) {
distro_test_common.TestDistro_Manifest(t, "../../../test/data/manifests/", "fedora_32*", fedora32.New())
}
// Check that Manifest() function returns an error for unsupported
// configurations.
func TestDistro_ManifestError(t *testing.T) {

View file

@ -3,11 +3,12 @@ package fedora33_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/osbuild/osbuild-composer/internal/blueprint"
"github.com/osbuild/osbuild-composer/internal/distro"
"github.com/osbuild/osbuild-composer/internal/distro/distro_test_common"
"github.com/osbuild/osbuild-composer/internal/distro/fedora33"
"github.com/stretchr/testify/assert"
)
func TestFilenameFromType(t *testing.T) {
@ -301,10 +302,6 @@ func TestImageType_BasePackages(t *testing.T) {
}
}
func TestDistro_Manifest(t *testing.T) {
distro_test_common.TestDistro_Manifest(t, "../../../test/data/manifests/", "fedora_33*", fedora33.New())
}
// Check that Manifest() function returns an error for unsupported
// configurations.
func TestDistro_ManifestError(t *testing.T) {

View file

@ -3,11 +3,12 @@ package rhel8_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/osbuild/osbuild-composer/internal/blueprint"
"github.com/osbuild/osbuild-composer/internal/distro"
"github.com/osbuild/osbuild-composer/internal/distro/distro_test_common"
"github.com/osbuild/osbuild-composer/internal/distro/rhel8"
"github.com/stretchr/testify/assert"
)
func TestFilenameFromType(t *testing.T) {
@ -354,10 +355,6 @@ func TestImageType_BasePackages(t *testing.T) {
}
}
func TestDistro_Manifest(t *testing.T) {
distro_test_common.TestDistro_Manifest(t, "../../../test/data/manifests/", "rhel_8-*", rhel8.New())
}
// Check that Manifest() function returns an error for unsupported
// configurations.
func TestDistro_ManifestError(t *testing.T) {

View file

@ -414,11 +414,6 @@ func TestImageType_BasePackages(t *testing.T) {
}
}
func TestDistro_Manifest(t *testing.T) {
distro_test_common.TestDistro_Manifest(t, "../../../test/data/manifests/", "rhel_84*", rhel84.New())
distro_test_common.TestDistro_Manifest(t, "../../../test/data/manifests/", "centos_8*", rhel84.NewCentos())
}
// Check that Manifest() function returns an error for unsupported
// configurations.
func TestDistro_ManifestError(t *testing.T) {