<commit_before>package smoke

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/pivotal-cf-experimental/cf-test-helpers/cf"
	. "github.com/pivotal-cf-experimental/cf-test-helpers/generator"
	. "github.com/vito/cmdtest/matchers"
	"os"
)

var _ = Describe("Loggregator:", func() {
	BeforeEach(func() {
		os.Setenv("CF_COLOR", "false")
		if os.Getenv("CLEANUP_ENVIRONMENT") == "true" {
			AppName = RandomName()
		}  else {
			AppName = "smoke-test-app"
		}
	})

	AfterEach(func() {
		if os.Getenv("CLEANUP_ENVIRONMENT") == "true" {
			Expect(Cf("delete", AppName, "-f")).To(Say("OK"))
		}
	})

	It("can see router requests in the logs", func() {
		if os.Getenv("CLEANUP_ENVIRONMENT") == "true" {
			Expect(Cf("push", AppName, "-p", AppPath)).To(Say("App started"))
		}

		Eventually(Curling("/")).Should(Say("It just needed to be restarted!"))

		// Curling multiple times because loggregator makes no guarantees about delivery of logs.
		Eventually(Curling("/")).Should(Say("Healthy"))
		Eventually(Cf("logs", "--recent", AppName)).Should(Say("[RTR]"))

		Eventually(Curling("/")).Should(Say("Healthy"))
		Eventually(Cf("logs", "--recent", AppName)).Should(Say("[App/0]"))
	})
})<commit_msg>[#66893118] Make CLEANUP_ENVIRONMENT tests more backwards-compatible<commit_after>package smoke

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/pivotal-cf-experimental/cf-test-helpers/cf"
	. "github.com/pivotal-cf-experimental/cf-test-helpers/generator"
	. "github.com/vito/cmdtest/matchers"
	"os"
)

var _ = Describe("Loggregator:", func() {
	BeforeEach(func() {
		os.Setenv("CF_COLOR", "false")
		if os.Getenv("CLEANUP_ENVIRONMENT") == "false" {
			AppName = "smoke-test-app"
		}  else {
			AppName = RandomName()
		}
	})

	AfterEach(func() {
		if os.Getenv("CLEANUP_ENVIRONMENT") != "false" {
			Expect(Cf("delete", AppName, "-f")).To(Say("OK"))
		}
	})

	It("can see router requests in the logs", func() {
		if os.Getenv("CLEANUP_ENVIRONMENT") != "false" {
			Expect(Cf("push", AppName, "-p", AppPath)).To(Say("App started"))
		}

		Eventually(Curling("/")).Should(Say("It just needed to be restarted!"))

		// Curling multiple times because loggregator makes no guarantees about delivery of logs.
		Eventually(Curling("/")).Should(Say("Healthy"))
		Eventually(Cf("logs", "--recent", AppName)).Should(Say("[RTR]"))

		Eventually(Curling("/")).Should(Say("Healthy"))
		Eventually(Cf("logs", "--recent", AppName)).Should(Say("[App/0]"))
	})
})
{'fraction_non_alphanumeric': 0.20736589271417133, 'fraction_numerical': 0.0040032025620496394, 'mean_word_length': 4.615730337078651, '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': '782377', 'n_tokens_mistral': 1021, 'n_tokens_neox': 936, 'n_words': 149}