clj-headlights.test-helpers

Tools to test dataflow jobs

assign-dummy-key

(assign-dummy-key val)

cat-files-like

(cat-files-like tempfile)

create-pcoll

(create-pcoll elems)(create-pcoll pipeline elems)

create-pcoll-KVs

(create-pcoll-KVs elems)(create-pcoll-KVs pipeline elems)

create-test-pipeline

(create-test-pipeline)

get-data-from-sinks

(get-data-from-sinks sinks)

pcoll-contains

macro

(pcoll-contains pcoll expected)

pcoll-counter

pcoll-is

macro

(pcoll-is expected-pcoll result-pcoll)

pcoll-matches

(pcoll-matches expected-f pcoll)

pcoll-results-match

(pcoll-results-match func)

Inputs: [func :- IFn] Returns: IFn

Checker that runs a pcoll’s pipeline, gather its output, and passes it to func. If func throws or returns false, the test failed.

Example: see pcoll-contains

pcoll-to-data

(pcoll-to-data pcoll)

pipeline-to-data

(pipeline-to-data pcolls)

prn-cogbkresult

(prn-cogbkresult [id co-gbkresult])

sink-counter

sink-pcoll

(sink-pcoll pcoll)

sink-pcolls

(sink-pcolls pcolls)

try-read-file

(try-read-file file-name)