<commit_before>package test_helpers

import "github.com/pivotal-cf-experimental/cf-mysql-quota-enforcer/database"

func NewRootDatabaseConfig(dbName string) database.Config {
	return database.Config{
		Host:     "127.0.0.1",
		Port:     3306,
		User:     "root",
		Password: "password",
		DBName:   dbName,
	}
}
<commit_msg>Load same config in test as in main.<commit_after>package test_helpers

import (
	"os"

	"github.com/pivotal-cf-experimental/cf-mysql-quota-enforcer/config"
	"github.com/pivotal-cf-experimental/cf-mysql-quota-enforcer/database"
)

func NewRootDatabaseConfig(dbName string) database.Config {
	configPath := os.Getenv("CONFIG")
	if configPath == "" {
		panic("CONFIG path must be specified")
	}

	config, err := config.Load(configPath)
	if err != nil {
		panic(err.Error())
	}

	return database.Config{
		Host:     config.Host,
		Port:     config.Port,
		User:     config.User,
		Password: config.Password,
		DBName:   dbName,
	}
}

{'fraction_non_alphanumeric': 0.1310272536687631, 'fraction_numerical': 0.010482180293501049, 'mean_word_length': 3.8477157360406093, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '5427001', 'n_tokens_mistral': 362, 'n_tokens_neox': 341, 'n_words': 65}