varnishcache-friends / libvmod-geoip2

Varnish VMOD to query MaxMind GeoIP2 DB files
BSD 2-Clause "Simplified" License
39 stars 17 forks source link

Create datasets for testing #35

Closed fgsch closed 10 months ago

fgsch commented 5 years ago

Currently we use the files from libmaxminddb.

This means that it is impossible to run make check from a GH created tarball (or zip) since submodules are not packaged.

One alternative is to create our own set of files that live in this repor and the tests could use.

GeertHauwaerts commented 2 years ago

Did you consider using adding a GitHub action to download the test files, or include script to fetch them? This is what I use in our environment (excerpt)

#!/bin/bash
# ...
MAXMINDTESTDB="https://github.com/maxmind/MaxMind-DB/raw/main/test-data"

MAXMINDTESTFILES=(
  'GeoIP2-City-Test'
  'GeoIP2-Connection-Type-Test'
  'GeoIP2-ISP-Test'
  'MaxMind-DB-test-decoder'
)

mkdir -p libmaxminddb/t/maxmind-db/test-data

for i in "${MAXMINDTESTFILES[@]}"; do
  wget -q -P libmaxminddb/t/maxmind-db/test-data/ "${MAXMINDTESTDB}/${i}.mmdb"
done

make check || error_exit 'Failed to make check'
# ...
fgsch commented 10 months ago

@GeertHauwaerts Nop, thanks for the suggestion. I will have a look 👍

fgsch commented 10 months ago

Done.