<commit_before>package integration_test

import (
	"os/exec"
	"testing"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/onsi/gomega/gbytes"
	. "github.com/onsi/gomega/gexec"
)

func TestIntegration(t *testing.T) {
	RegisterFailHandler(Fail)
	RunSpecs(t, "CLI Integration")
}

var _ = Describe("exit codes", func() {
	It("exits non-zero when an unknown command is invoked", func() {
		result := Cf("some-command-that-should-never-actually-be-a-real-thing-i-can-use")

		Eventually(result).Should(Say("not a registered command"))
		Expect(result).Should(Exit(1))
	})
})

func Cf(args ...string) *Session {
	path, err := Build("github.com/cloudfoundry/cli/main")
	Expect(err).NotTo(HaveOccurred())

	session, err := Start(exec.Command(path, args...), GinkgoWriter, GinkgoWriter)
	Expect(err).NotTo(HaveOccurred())<commit_msg>Allow integration test to take longer<commit_after>package integration_test

import (
	"os/exec"
	"testing"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/onsi/gomega/gbytes"
	. "github.com/onsi/gomega/gexec"
)

func TestIntegration(t *testing.T) {
	RegisterFailHandler(Fail)
	RunSpecs(t, "CLI Integration")
}

var _ = Describe("exit codes", func() {
	It("exits non-zero when an unknown command is invoked", func() {
		result := Cf("some-command-that-should-never-actually-be-a-real-thing-i-can-use")

		Eventually(result, 10).Should(Say("not a registered command"))
		Expect(result).Should(Exit(1))
	})
})

func Cf(args ...string) *Session {
	path, err := Build("github.com/cloudfoundry/cli/main")
	Expect(err).NotTo(HaveOccurred())

	session, err := Start(exec.Command(path, args...), GinkgoWriter, GinkgoWriter)
	Expect(err).NotTo(HaveOccurred())
{'fraction_non_alphanumeric': 0.17383720930232557, 'fraction_numerical': 0.002325581395348837, 'mean_word_length': 4.873720136518771, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4004509', 'n_tokens_mistral': 660, 'n_tokens_neox': 631, 'n_words': 107}