<commit_before>package _tests_test

import (
	"bytes"
	"fmt"
	"math/rand"
	"os"
	"os/exec"
	"os/user"
	"path"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/ginkgo/config"

	. "github.com/onsi/gomega"

	"testing"
)

func init() {
	rand.Seed(GinkgoConfig.RandomSeed)
}

func getRandAppName() string {
	return fmt.Sprintf("apps-test-%d", rand.Int())
}

func TestTests(t *testing.T) {
	RegisterFailHandler(Fail)
	RunSpecs(t, "Tests Suite")
}

var (
	testAdminUser     = fmt.Sprintf("test-admin-%d", GinkgoConfig.RandomSeed)
	testAdminPassword = "<PASSWORD>"
	testAdminEmail    = fmt.Sprintf("<EMAIL>", GinkgoConfig.RandomSeed)
	testUser          = fmt.Sprintf("test-%d", GinkgoConfig.RandomSeed)
	testPassword      = "<PASSWORD>"
	testEmail         = fmt.Sprintf("<EMAIL>", GinkgoConfig.RandomSeed)
	url               = getController()
)

var _ = BeforeSuite(func() {
	workflowHost := os.Getenv("DEIS_WORKFLOW_SERVICE_HOST")
	workflowPort := os.Getenv("DEIS_WORKFLOW_SERVICE_PORT")
	Expect(workflowHost).ShouldNot(BeEmpty())
	Expect(workflowPort).ShouldNot(BeEmpty())
	Expect("../client/deis").Should(BeAnExistingFile())

	// register the test-admin user
	register(url, testAdminUser, testAdminPassword, testAdminEmail)
	// TODO: verify that this user is actually an admin

	// register the test user and add a key
	register(url, testUser, testPassword, testEmail)
	addKey("deis-test")
})

var _ = AfterSuite(func() {
	// cancel the test user
	cancel(url, testUser, testPassword)
<commit_msg>fix(_tests): check for "deis" in the $PATH<commit_after>package _tests_test

import (
	"bytes"
	"fmt"
	"math/rand"
	"os"
	"os/exec"
	"os/user"
	"path"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/ginkgo/config"

	. "github.com/onsi/gomega"

	"testing"
)

func init() {
	rand.Seed(GinkgoConfig.RandomSeed)
}

func getRandAppName() string {
	return fmt.Sprintf("apps-test-%d", rand.Int())
}

func TestTests(t *testing.T) {
	RegisterFailHandler(Fail)
	RunSpecs(t, "Tests Suite")
}

var (
	testAdminUser     = fmt.Sprintf("test-admin-%d", GinkgoConfig.RandomSeed)
	testAdminPassword = "<PASSWORD>"
	testAdminEmail    = fmt.Sprintf("<EMAIL>", GinkgoConfig.RandomSeed)
	testUser          = fmt.Sprintf("test-%d", GinkgoConfig.RandomSeed)
	testPassword      = "<PASSWORD>"
	testEmail         = fmt.Sprintf("<EMAIL>", GinkgoConfig.RandomSeed)
	url               = getController()
)

var _ = BeforeSuite(func() {
	workflowHost := os.Getenv("DEIS_WORKFLOW_SERVICE_HOST")
	workflowPort := os.Getenv("DEIS_WORKFLOW_SERVICE_PORT")
	Expect(workflowHost).ShouldNot(BeEmpty())
	Expect(workflowPort).ShouldNot(BeEmpty())
	// use the "deis" executable in the search $PATH
	_, err := exec.LookPath("deis")
	Expect(err).NotTo(HaveOccurred())

	// register the test-admin user
	register(url, testAdminUser, testAdminPassword, testAdminEmail)
	// TODO: verify that this user is actually an admin

	// register the test user and add a key
	register(url, testUser, testPassword, testEmail)
	addKey("deis-test")
})

var _ = AfterSuite(func() {
	// cancel the test user
	cancel(url, testUser, testPassword)

{'fraction_non_alphanumeric': 0.14596879063719115, 'fraction_numerical': 0.0, 'mean_word_length': 4.426807760141093, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '485842', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1114, 'n_words': 210}