aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2021-01-28 21:41:53 -0300
committerSilvio Rhatto <rhatto@riseup.net>2021-01-28 21:41:53 -0300
commitcaac6a103f1a76a4ec4a096bb569cd7820a0ff14 (patch)
tree1c41a36ed49e85afb95b64722632818503c2e77f /Makefile
parentae3abe5a4c14a2e1b50aaf1f41e3225a5c34140b (diff)
downloadcsv-hasher-caac6a103f1a76a4ec4a096bb569cd7820a0ff14.tar.gz
csv-hasher-caac6a103f1a76a4ec4a096bb569cd7820a0ff14.tar.bz2
Fix: improvements and tests for large files
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 23 insertions, 6 deletions
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