import (
	g "github.com/onsi/ginkgo"
	o "github.com/onsi/gomega"

	s2istatus "github.com/openshift/source-to-image/pkg/util/status"

	buildapi "github.com/openshift/origin/pkg/build/api"
	exutil "github.com/openshift/origin/test/extended/util"
)

var _ = g.Describe("[builds][Slow] update failure status", func() {
	defer g.GinkgoRecover()

	var (
		// convert the s2i failure cases to our own StatusReason
		reasonAssembleFailed  = buildapi.StatusReason(s2istatus.ReasonAssembleFailed)
		messageAssembleFailed = string(s2istatus.ReasonMessageAssembleFailed)

		oc                    = exutil.NewCLI("update-buildstatus", exutil.KubeConfigPath())
		postCommitHookFixture = exutil.FixturePath("testdata", "statusfail-postcommithook.yaml")
		gitCloneFixture       = exutil.FixturePath("testdata", "statusfail-fetchsource.yaml")
		builderImageFixture   = exutil.FixturePath("testdata", "statusfail-fetchbuilderimage.yaml")
		pushToRegistryFixture = exutil.FixturePath("testdata", "statusfail-pushtoregistry.yaml")
		failedAssembleFixture = exutil.FixturePath("testdata", "statusfail-failedassemble.yaml")
	)

	g.JustBeforeEach(func() {
		g.By("waiting for the builder service account")
		err := exutil.WaitForBuilderAccount(oc.KubeClient().ServiceAccounts(oc.Namespace()))
		o.Expect(err).NotTo(o.HaveOccurred())
	})
Example #2
0
func convertS2IFailureType(reason s2iapi.StepFailureReason, message s2iapi.StepFailureMessage) (api.StatusReason, string) {
	return api.StatusReason(reason), fmt.Sprintf("%s", message)
}
Example #3
0
	g "github.com/onsi/ginkgo"
	o "github.com/onsi/gomega"

	s2istatus "github.com/openshift/source-to-image/pkg/util/status"

	buildapi "github.com/openshift/origin/pkg/build/api"
	exutil "github.com/openshift/origin/test/extended/util"
)

var _ = g.Describe("[builds][Slow] update failure status", func() {
	defer g.GinkgoRecover()

	var (
		// convert the s2i failure cases to our own StatusReason
		reasonAssembleFailed     = buildapi.StatusReason(s2istatus.ReasonAssembleFailed)
		messageAssembleFailed    = string(s2istatus.ReasonMessageAssembleFailed)
		reasonFetchSourceFailed  = buildapi.StatusReason(s2istatus.ReasonFetchSourceFailed)
		messageFetchSourceFailed = string(s2istatus.ReasonMessageFetchSourceFailed)
		postCommitHookFixture    = exutil.FixturePath("testdata", "statusfail-postcommithook.yaml")
		fetchDockerSrc           = exutil.FixturePath("testdata", "statusfail-fetchsourcedocker.yaml")
		fetchS2ISrc              = exutil.FixturePath("testdata", "statusfail-fetchsources2i.yaml")
		builderImageFixture      = exutil.FixturePath("testdata", "statusfail-fetchbuilderimage.yaml")
		pushToRegistryFixture    = exutil.FixturePath("testdata", "statusfail-pushtoregistry.yaml")
		failedAssembleFixture    = exutil.FixturePath("testdata", "statusfail-failedassemble.yaml")
		binaryBuildDir           = exutil.FixturePath("testdata", "statusfail-assemble")
		oc                       = exutil.NewCLI("update-buildstatus", exutil.KubeConfigPath())
	)

	g.JustBeforeEach(func() {
		g.By("waiting for the builder service account")