Automated Tests - matthewcornell/wikitest GitHub Wiki
Currently two types of data validation tests are available, which are run manually via the Makefile as documented in Import-Process:
$ make test-input
and
$ make test-output
These run the corresponding R files in /tests/test_input
and /tests/test_output
, respectively. More specifically:
Input tests
Tests of the delivery_metadata.txt
file:
- Test that all csvs in original_data are mentioned in
dengue_case_metadata.txt
. - Test that
dengue_case_metadata.txt
doesn't have orphan entries. - Test that
delivery_year
is correct for entries in metadata.
Tests for file-specific codes for deliveries:
- Test that all deliveries have file specific codes (does not check for orphan codes).
Output tests
Tests for deliveries:
- Test that unique deliveries are same in all the tables.
Tests of the delivery_metadata
table:
- Test that the
delivery_metadata
table matches data fromdengue_case_metadata.txt
. - Check for date_delivered existing.
Tests for expected tables being created in various steps:
- Check if a given table identifier is present in the database.
- Test that the table
delivery_metadata
is present. - Test that tables are getting created as a result of running
2_create_unique_data.R
.