User Tools

Site Tools


documentation:software:whiterabbit:test_framework

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
documentation:software:whiterabbit:test_framework [2017/12/13 08:20]
schuemie
documentation:software:whiterabbit:test_framework [2020/02/18 14:13] (current)
maximmoinat
Line 1: Line 1:
 ====== Rabbit-In-a-Hat testing framework ====== ====== Rabbit-In-a-Hat testing framework ======
 +
 +**NOTICE FEB 2020:** the current documentation can be found on Github
 +http://​ohdsi.github.io/​WhiteRabbit/​riah_test_framework.html
 +
  
 Rabbit-In-a-Hat can generate a framework for creating a set of [[https://​en.wikipedia.org/​wiki/​Unit_testing|unit tests]]. The framework consists of a set of R functions tailored to the source and target schema in your ETL. These functions can then be used to define the unit tests. ​ Rabbit-In-a-Hat can generate a framework for creating a set of [[https://​en.wikipedia.org/​wiki/​Unit_testing|unit tests]]. The framework consists of a set of R functions tailored to the source and target schema in your ETL. These functions can then be used to define the unit tests. ​
Line 76: Line 80:
 <​code>​ <​code>​
 insertSql <- generateInsertSql(databaseSchema = "​nativeTestSchema"​) insertSql <- generateInsertSql(databaseSchema = "​nativeTestSchema"​)
-testSql<​- generateTestSql(databaseSchema = "​cdmTestSchema"​)+testSql <- generateTestSql(databaseSchema = "​cdmTestSchema"​)
 </​code>​ </​code>​
-to generate the SQL for inserting the test data in the database (insertSql),​ and for running the tests on the ETL-ed data (testSql). The insertion SQL assumes that the data schema already exists, and will first remove any records that might be in the tables. We can execute the SQL in any SQL client, or we can use OHDSI'​s [[https://​github.com/​OHDSI/​DatabaseConnector|DatabaseConnector package]]. For example:+to generate the SQL for inserting the test data in the database (insertSql),​ and for running the tests on the ETL-ed data (testSql). The insertion SQL assumes that the data schema already exists ​in ''​nativeTestSchema''​, and will first remove any records that might be in the tables. We can execute the SQL in any SQL client, or we can use OHDSI'​s [[https://​github.com/​OHDSI/​DatabaseConnector|DatabaseConnector package]]. For example:
  
 <​code>​ <​code>​
Line 93: Line 97:
 ==== Run your ETL on the test data ==== ==== Run your ETL on the test data ====
  
-Now that the test source data is populated. You can run the ETL process you would like to test.+Now that the test source data is populated. You can run the ETL process you would like to test. The ETL should transform the data in ''​nativeTestSchema''​ to CDM data in ''​cdmTestSchema''​.
  
 ==== Test whether the CDM data meets expectations ==== ==== Test whether the CDM data meets expectations ====
  
-The test SQL will create a table called ''​%%test_results%%''​ in your CDM schema, and populate it with the results of the tests. (If the table already exists it will first be dropped). Again, we could use any SQL client to run this SQL, or we could use DatabaseConnector:​+The test SQL will create a table called ''​%%test_results%%''​ in ''​cdmTestSchema''​, and populate it with the results of the tests. (If the table already exists it will first be dropped). Again, we could use any SQL client to run this SQL, or we could use DatabaseConnector:​
  
 <​code>​ <​code>​
documentation/software/whiterabbit/test_framework.1513153236.txt.gz ยท Last modified: 2017/12/13 08:20 by schuemie