diff --git a/.travis.yml b/.travis.yml index 2b091888c..86f8858fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,13 +10,13 @@ addons: - systemd-container matrix: include: - - name: fedora-30 + - name: f30 arch: amd64 - - name: fedora-30 + - name: f30 arch: arm64 - - name: fedora-31 + - name: f31 arch: amd64 - - name: fedora-31 + - name: f31 arch: arm64 language: generic @@ -26,4 +26,4 @@ script: # ubuntu's rpm package sets dbpath to ~/.rpmdb, which makes rpm fail... - sudo sh -c 'mkdir /etc/rpm; echo "%_dbpath /var/lib/rpm" > /etc/rpm/macros' - go test -c -tags travis,integration -o osbuild-image-tests ./cmd/osbuild-image-tests - - sudo ./osbuild-image-tests -test.v --distro $TRAVIS_JOB_NAME + - sudo ./osbuild-image-tests -test.v test/cases/$TRAVIS_JOB_NAME* diff --git a/cmd/osbuild-image-tests/main_test.go b/cmd/osbuild-image-tests/main_test.go index 83f722f21..0210b33ef 100644 --- a/cmd/osbuild-image-tests/main_test.go +++ b/cmd/osbuild-image-tests/main_test.go @@ -22,11 +22,8 @@ import ( "github.com/stretchr/testify/require" "github.com/osbuild/osbuild-composer/internal/common" - "github.com/osbuild/osbuild-composer/internal/distro" ) -var distroArg = flag.String("distro", "", "which distro tests to run") - type testcaseStruct struct { ComposeRequest struct { Distro string @@ -296,7 +293,7 @@ func getAllCases() ([]string, error) { } // runTests opens, parses and runs all the specified testcases -func runTests(t *testing.T, cases []string, d string) { +func runTests(t *testing.T, cases []string) { for _, path := range cases { t.Run(path, func(t *testing.T) { f, err := os.Open(path) @@ -311,19 +308,6 @@ func runTests(t *testing.T, cases []string, d string) { t.Skipf("the required arch is %s, the current arch is %s", testcase.ComposeRequest.Arch, currentArch) } - if d != "" { - if testcase.ComposeRequest.Distro != d { - t.Skipf("the required distro is %s, the passed distro is %s", testcase.ComposeRequest.Distro, d) - } - } else { - hostDistroName, err := distro.GetHostDistroName() - require.Nil(t, err) - - if testcase.ComposeRequest.Distro != hostDistroName { - t.Skipf("the required distro is %s, the host distro is %s", testcase.ComposeRequest.Distro, hostDistroName) - } - } - runTestcase(t, testcase) }) @@ -339,5 +323,5 @@ func TestImages(t *testing.T) { require.Nil(t, err) } - runTests(t, cases, *distroArg) + runTests(t, cases) }