diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2021-01-28 21:41:53 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2021-01-28 21:41:53 -0300 |
commit | caac6a103f1a76a4ec4a096bb569cd7820a0ff14 (patch) | |
tree | 1c41a36ed49e85afb95b64722632818503c2e77f /Makefile | |
parent | ae3abe5a4c14a2e1b50aaf1f41e3225a5c34140b (diff) | |
download | csv-hasher-caac6a103f1a76a4ec4a096bb569cd7820a0ff14.tar.gz csv-hasher-caac6a103f1a76a4ec4a096bb569cd7820a0ff14.tar.bz2 |
Fix: improvements and tests for large files
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 29 |
1 files changed, 23 insertions, 6 deletions
@@ -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 |