<commit_before>OS = "$(shell uname | awk '{ print tolower($0) }')"

setup:
	@npm install .

run-sandbox-fg: redis
	@node tests/sandbox/app.js host=127.0.0.1 port=3334 clientPort=3333 frontend=true serverType=metagame

# get a redis instance up (localhost:3434)
redis: kill-redis
	@redis-server ./tests/redis.conf; sleep 1
	@redis-cli -p 3434 info > /dev/null

# kill this redis instance (localhost:3434)
kill-redis:
	@-redis-cli -p 3434 shutdown

drop-test-khan:
	@psql -d postgres -f tests/drop-test.sql > /dev/null
	@echo "Test database created successfully!"

migrate-test-khan:
	@./bin/khan-$(OS) migrate -c ./tests/khan.yaml

run-test-khan: kill-test-khan drop-test-khan migrate-test-khan
	@rm -rf /tmp/kublai-khan.log
	@./bin/khan-$(OS) start -p 8888 -c ./tests/khan.yaml 2>&1 > /tmp/kublai-khan.log &

kill-test-khan:
	@ps aux | egrep './bin/khan' | egrep -v egrep | awk ' { print $$2 } ' | xargs kill -9

run-test-game-server: kill-game-server
	@rm -rf /tmp/kublai-pomelo.log
	@node tests/sandbox/app.js host=127.0.0.1 port=3334 clientPort=3333 frontend=true serverType=metagame 2>&1 > /tmp/kublai-pomelo.log &
	@sleep 3

kill-game-server:
	@ps aux | egrep 'sandbox/app.js' | egrep -v egrep | awk ' { print $$2 } ' | xargs kill -9

test: redis run-test-khan run-test-game-server run-tests

test-ci: run-test-khan run-test-game-server run-tests<commit_msg>OS name<commit_after>OS = "$(shell uname | awk '{ print tolower($$0) }')"

setup:
	@npm install .

run-sandbox-fg: redis
	@node tests/sandbox/app.js host=127.0.0.1 port=3334 clientPort=3333 frontend=true serverType=metagame

# get a redis instance up (localhost:3434)
redis: kill-redis
	@redis-server ./tests/redis.conf; sleep 1
	@redis-cli -p 3434 info > /dev/null

# kill this redis instance (localhost:3434)
kill-redis:
	@-redis-cli -p 3434 shutdown

drop-test-khan:
	@psql -d postgres -f tests/drop-test.sql > /dev/null
	@echo "Test database created successfully!"

migrate-test-khan:
	@echo "Running migrations in $(OS)"
	@./bin/khan-$(OS) migrate -c ./tests/khan.yaml

run-test-khan: kill-test-khan drop-test-khan migrate-test-khan
	@echo "Running test khan in $(OS)"
	@rm -rf /tmp/kublai-khan.log
	@./bin/khan-$(OS) start -p 8888 -c ./tests/khan.yaml 2>&1 > /tmp/kublai-khan.log &

kill-test-khan:
	@ps aux | egrep './bin/khan' | egrep -v egrep | awk ' { print $$2 } ' | xargs kill -9

run-test-game-server: kill-game-server
	@rm -rf /tmp/kublai-pomelo.log
	@node tests/sandbox/app.js host=127.0.0.1 port=3334 clientPort=3333 frontend=true serverType=metagame 2>&1 > /tmp/kublai-pomelo.log &
	@sleep 3

kill-game-server:
	@ps aux | egrep 'sandbox/app.js' | egrep -v egrep | awk ' { print $$2 } ' | xargs kill -9

test: redis run-test-khan run-test-game-server run-tests

test-ci: run-test-khan run-test-game-server run-tests
{'fraction_non_alphanumeric': 0.1635647816750179, 'fraction_numerical': 0.04223335719398712, 'mean_word_length': 3.5299837925445705, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '5943274', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1159, 'n_words': 271}