To pull the latest Docker image from DockerHub use the following command:
docker pull drtesthelps/drtest:latest
You can create the Docker image locally by using the following command:
git clone [email protected]:otto-de/dr-test.git
cd dr-test
docker build -t drtest .
run.sh
is meant to simplify the usage of dr-test
. After building the docker image
using the step described above, call the script with the schema files you want to serve
data for.
./run.sh drtest:latest my-schema1.avsc my-schema2.avsc
The script will then call the docker image with the schema files mounted into the expected directory.
If you would like to use docker run
directly, feel free to do so.
You can either call docker run
and pass your schema files as mounted files:
docker run -v /path/to/my-schema1.avsc:/opt/schemafiles/my-schema1.avsc drtest:latest
Or to pass multiple schema files:
docker run -v /path/to/my-schema1.avsc:/opt/schemafiles/my-schema1.avsc -v /other/path/to/my-schema2.avsc:/opt/schemafiles/my-schema2.avsc drtest:latest
You can also mount an entire local directory. dr-test
will use all files with an .avsc
extension.
The webserver starts on container port 8080 by default. You can overwrite it using docker's -p
flag.
Given your record's name is Foo
, your test samples can be fetched via /foo
or /foo/{amount}
.
curl localhost:8080/foo
curl localhost:8080/foo/100
You can generate a test sample generator from multiple schemas as once.
All you have to do is run go run gen/gen.go gen/avro.go --target-dir=./generated $PATH_TO_SCHEMA
to generate the necessary methods for the webserver.
Starting the webserver go run webserver/cmd/app.go
will expose one endpoint per record name.
- Implemented
Make the randomizer configurable, such that
- Ranges
- Valid values
- Defaults
- etc can be configured to be used for each field name present in the schema.
- Implemented
Either in docker build
or docker run
it should be possible to load multiple avro schemas at once.
Note: see ["Without Docker"](Without Docker)) on how to use multiple schemas during generation, alleviating this problem.
- Implemented
Between two consecutive test sample fetches, data should be consistent given the schema, nor the requested quantity did not change.
- Implemented
Edge cases for the defined entity (nullable fields, empty lists and maps, etc.) should be obtainable by request.
- Implemented
Test samples can also be consumed via kafka, sqs, amq, etc.
- Implemented
Add protobuf, json-schema, etc. to the list of supported schema technologies.