Git Product home page Git Product logo

dadguide-data's Introduction

dadguide-data

Database setup

sudo apt install mysql-workbench
sudo apt install mysql-server

You can use utils/download_db_from_prod.sh and utils/restore_db_from_prod to download the exported database and install it into your local copy.

Local testing

In prod we're using a Apache webserver with PHP that executes a python script. Kind of gross.

In dev we're using a sanic webserver (requires python 3.6 and sanic_compress). It would be nice to start using this in prod using mod_proxy?

Integration tests

In tests/parser_integration_test.py we've got a test that loads all the raw data and saves the 'cross server' parsed outputs, then compares against a golden copy. Get the raw data using utils/refresh_data first.

If you're making a change, you should run this once, then make your change, then run it again. You can use the diff to confirm your changes.

Google Cloud Build pull-tests

Whenever a PR is opened, a trigger should execute the integration test using GCB. This compares against golden files saved to GCS.

You can test locally or on GCB using the following commands:

PYTHONPATH=etl python3 tests/parser_integration_test.py --input_dir=pad_data/raw --output_dir=pad_data/integration
cloud-build-local --config=pit-cloudbuild.yaml --dryrun=false .
gcloud builds --config=pit-cloudbuild.yaml  .

The GCB-based tests run against a snapshot of the raw and golden data. If you're happy with any local changes, after running the integration tests use the following commands to update the golden set:

gsutil -m cp -r -c pad_data/integration/new gs://dadguide-integration/parser/golden
gsutil -m cp -r -c pad_data/raw gs://dadguide-integration/parser/raw

Future tests

It would be really great to have a version that either did the mysql data load, or a sqlite one, or maybe just dumps the computed SQL to a file. The latter is probably not sufficient, since some steps require index lookups and we would have to fake those.

dadguide-data's People

Contributors

akshay24anil avatar dchang0413 avatar mushymato avatar rheingoldriver avatar tactical-retreat avatar

Watchers

 avatar

Forkers

ssac

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.