<commit_before>
REDIS_VERSON=3.0.0

help:
	@echo "make test	- run phpunit tests using a docker environment"
	@echo "make docker	- run redis in docker and set the redis port in test config"
	@echo "make clean	- stop docker and remove container"

test: docker
	phpunit


docker:
	cd tests/docker/redis && sh build.sh
	docker run -d -P yiitest/redis:${REDIS_VERSION} > redis-dockerid
	sed -ri "s/^(\s*'port' => )[0-9]*,/\\1$(shell docker port $(shell cat redis-dockerid) | grep -Po ":(\d+)" | cut -b 2-),/" tests/data/config.php

clean:
	docker stop $(shell cat redis-dockerid)
	docker rm $(shell cat redis-dockerid)
	rm redis-dockerid
<commit_msg>use local config to avoid git conflict<commit_after>
REDIS_VERSON=3.0.0

help:
	@echo "make test	- run phpunit tests using a docker environment"
	@echo "make clean	- stop docker and remove container"

test: adjust-config
	phpunit

adjust-config: docker
	echo "<?php \$$config['databases']['redis']['port'] = $(shell docker port $(shell cat redis-dockerid) | grep -Po ":(\d+)" | cut -b 2-);" > tests/data/config.local.php

docker:
	cd tests/docker/redis && sh build.sh
	docker run -d -P yiitest/redis:${REDIS_VERSION} > redis-dockerid


clean:
	docker stop $(shell cat redis-dockerid)
	docker rm $(shell cat redis-dockerid)
	rm redis-dockerid

{'fraction_non_alphanumeric': 0.13908313908313907, 'fraction_numerical': 0.008547008547008548, 'mean_word_length': 4.050980392156863, 'pattern_counts': {'":': 2, '<': 4, '<?xml version=': 0, '>': 7, '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': '6103051', 'n_tokens_mistral': 502, 'n_tokens_neox': 463, 'n_words': 151}