From caac6a103f1a76a4ec4a096bb569cd7820a0ff14 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 28 Jan 2021 21:41:53 -0300 Subject: Fix: improvements and tests for large files --- Makefile | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 16311a1..1a13c56 100644 --- a/Makefile +++ b/Makefile @@ -2,20 +2,37 @@ # 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 200 + @#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 5 tests/sample.csv tests/output.csv id + pipenv run ./csv-hasher.py --chunksize $(CHUNKSIZE) $(SAMPLE) $(OUTPUT) $(COLNAME) show-test-output: - head -20 tests/sample.csv - head -20 tests/output.csv + 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 tests/*.csv + rm -f tests/*.csv + +clean: clean-sample -test: clean-sample sample test-sample show-test-output clean-sample +test: clean-sample sample test-sample show-test-output -- cgit v1.2.3