aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 1a13c569019c55b321272bd9d15e78941fc43068 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#
# Makefile for csv-hasher
#

CHUNKSIZE   							= 10000
CHECK_LINES 							= 20
SAMPLE_ITERATIONS         = 1000
SAMPLE_ROWS_PER_ITERATION = 1000
TESTS       							= tests
COLNAME     							= id
SAMPLE      							= $(TESTS)/sample.csv
OUTPUT      							= $(TESTS)/output.csv

vendor:
	pipenv install

sample:
	@#bin/make-sample $(ITERATIONS)
	pipenv run ./csv-sampler.py --iterations $(SAMPLE_ITERATIONS) --rows_per_iteration $(SAMPLE_ROWS_PER_ITERATION) $(SAMPLE)

test-sample:
	pipenv run ./csv-hasher.py --chunksize $(CHUNKSIZE) $(SAMPLE) $(OUTPUT) $(COLNAME)

show-test-output:
	head -$(CHECK_LINES) $(SAMPLE)
	head -$(CHECK_LINES) $(OUTPUT)
	tail -$(CHECK_LINES) $(SAMPLE)
	tail -$(CHECK_LINES) $(OUTPUT)
	wc -l    						 $(SAMPLE)
	wc -l    						 $(OUTPUT)
	ls -lh   						 $(TESTS)

clean-sample:
	rm -f tests/*.csv

clean: clean-sample

test: clean-sample sample test-sample show-test-output