<commit_before>SHELL=/bin/bash

test-ansible1:
	type ansible || pip install ansible==1.9.3
	tests/test.sh

test-latest:
	type ansible || pip install ansible
	tests/test.sh

test-devel:
	git clone https://github.com/ansible/ansible.git
	cd ansible \
		&& git checkout stable-2.0 \
		&& git submodule update --init --recursive \
		&& make install
	tests/test.sh

local-test-base:
	docker build \
		--build-arg HOST_USER_UID=$$UID \
		-t $@ - < dockerfiles/$@

local-test-ansible1: local-test-base
	docker build -t $@ - < dockerfiles/$@
	docker run \
		-v $(PWD):/mnt \
		-ti $@ \
		make -C /mnt test-ansible1

local-test-latest: local-test-base
	docker build -t $@ - < dockerfiles/$@
	docker run \
		-v $(PWD):/mnt \
		-ti $@ \
		make -C /mnt test-latest

.PHONY: test-ansible1 test-latest test-devel local-test-ansible1<commit_msg>split image and run, added option to diff output.<commit_after>SHELL=/bin/bash

test-ansible1:
	type ansible || pip install ansible==1.9.3
	tests/test.sh

test-latest:
	type ansible || pip install ansible
	tests/test.sh

test-devel:
	git clone https://github.com/ansible/ansible.git
	cd ansible \
		&& git checkout stable-2.0 \
		&& git submodule update --init --recursive \
		&& make install
	tests/test.sh

docker-test-ansible1: local-test-ansible1
	docker run \
		-v $(PWD):/mnt \
		-ti local-test-ansible1 \
		make -C /mnt test-ansible1

docker-test-latest: local-test-latest
	docker run \
		-v $(PWD):/mnt \
		-ti local-test-latest \
		make -C /mnt test-latest

local-test-base:
	docker build \
		--build-arg HOST_USER_UID=$$UID \
		-t $@ - < dockerfiles/$@

local-test-%: local-test-base
	docker build -t $@ - < dockerfiles/$@

diff-output: local-test-ansible1 local-test-latest
	docker run \
		-v $(PWD):/mnt \
		-ti local-test-ansible1 \
		./inventory.py --file tests/test-group-vars/inventory.yml --list \
			> ansible1.out
	docker run \
		-v $(PWD):/mnt \
		-ti local-test-latest \
		./inventory.py --file tests/test-group-vars/inventory.yml --list \
			> latest.out


.PHONY: test-ansible1 test-latest test-devel
.PHONY: docker-test-ansible1 docker-test-latest
.PHONY: local-test-base diff-output
{'fraction_non_alphanumeric': 0.1539541413196069, 'fraction_numerical': 0.01169864295741694, 'mean_word_length': 2.804270462633452, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '6548665', 'n_tokens_mistral': 902, 'n_tokens_neox': 827, 'n_words': 185}