<commit_before>package elasticsearch_test

import (
	"os"
	"testing"

	"encoding/json"
	"github.com/kyani-inc/storage/providers/elasticsearch"
	"github.com/subosito/gotenv"
	"reflect"
)

var (
	host, index, scheme, namespace, awsKey, awsSecret string
)

type product struct {
	Name        string      `json:"name"`
	Price       int         `json:"price"`
	Description description `json:"description"`
}

type description struct {
	Description string `json:"nickname"`
}

func init() {
	gotenv.Load(".env")
	host = os.Getenv("ES_HOST")
	index = os.Getenv("ES_INDEX")
	namespace = os.Getenv("ES_NAMESPACE")
	scheme = os.Getenv("ES_SCHEME")
	awsKey = os.Getenv("AWS_KEY")
	awsSecret = os.Getenv("AWS_SECRET")
}

func emptyVars() bool {
	return host == "" || index == "" || scheme == "" || awsKey == "" || awsSecret == ""

}

func TestES(t *testing.T) {
	if emptyVars() {
		t.Error("Must have ENV set")
	}

	es, err := elasticsearch.New(host, scheme, index, namespace, awsKey, awsSecret)

	if err != nil {
		t.Errorf("Building new ES client error %+v", err)
	}

	td := product{
		Name:        "Kyäni Sunrise",<commit_msg>skip instead of fail for travis build<commit_after>package elasticsearch_test

import (
	"os"
	"testing"

	"encoding/json"
	"github.com/kyani-inc/storage/providers/elasticsearch"
	"github.com/subosito/gotenv"
	"reflect"
)

var (
	host, index, scheme, namespace, awsKey, awsSecret string
)

type product struct {
	Name        string      `json:"name"`
	Price       int         `json:"price"`
	Description description `json:"description"`
}

type description struct {
	Description string `json:"nickname"`
}

func init() {
	gotenv.Load(".env")
	host = os.Getenv("ES_HOST")
	index = os.Getenv("ES_INDEX")
	namespace = os.Getenv("ES_NAMESPACE")
	scheme = os.Getenv("ES_SCHEME")
	awsKey = os.Getenv("AWS_KEY")
	awsSecret = os.Getenv("AWS_SECRET")
}

func emptyVars() bool {
	return host == "" || index == "" || scheme == "" || awsKey == "" || awsSecret == ""

}

func TestES(t *testing.T) {
	if emptyVars() {
		t.Skip("Must have ENV set")
	}

	es, err := elasticsearch.New(host, scheme, index, namespace, awsKey, awsSecret)

	if err != nil {
		t.Errorf("Building new ES client error %+v", err)
	}

	td := product{
		Name:        "Kyäni Sunrise",
{'fraction_non_alphanumeric': 0.1595037660611431, 'fraction_numerical': 0.0, 'mean_word_length': 3.876889848812095, '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': '5554489', 'n_tokens_mistral': 820, 'n_tokens_neox': 821, 'n_words': 187}