Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more unit tests #437

Merged
merged 62 commits into from
Aug 31, 2021
Merged

Add more unit tests #437

merged 62 commits into from
Aug 31, 2021

Conversation

ablack3
Copy link
Collaborator

@ablack3 ablack3 commented Aug 20, 2021

This PR adds testing for all supported CDM DDL versions against postgresql, redshift, oracle, and sql server. It also tests that the output of buildRelease matches the contents of the ddl folder. I had to move the ddl folder to inst/ddl so that it was accessible during testing. To test buildRelease I also had to allow the user can specify the outputfolder location.

I changed outputpath to outputfolder throughout the package just so there is a consistent name for the same argument across functions. Either one is fine.

Adam Black and others added 22 commits August 19, 2021 23:05
* Add github actions workflow to build package and run tests.

* update Description file

* rename .Rproj file.

* Consolidate 'create' functions into one file.

* Add tests for create functions.

* update description

* removed spaces in file and folder names. Regenerated ddl output. Tried to fix Field_Level.csv file.

* consolidate write functions into one file. Add execute function.

* update docs

* add tests for write and execute functions

* update documentation

* Add windows and linux runners in github actions.

* update github actions

* download drivers before running tests

* fix small error in setup test file.

* debug github actions

* debug github actions

* debug github actions

* debug github actions

* fix tiny bug

* comment out execute ddl test

* fix bug in test

* Add execute test back in

* revert accidental change in description

* add print statement for debugging schema error on github actions.

* Fix schema environment variable name

* Add comment to github actions workflow file.

* remove placeholder text in function documentation.

* Rename createdDdl.R to createDdl.R

* Hack-a-thon updates

Closes #81, #387, #239, #412, #391, #330, #408, #365, #306, #264

* Changed bigint to integer for consistency

* Updated DDLs

* Add tests for redshift. Clean up test setup file.

* Foreign key fixes

* Add imports and update docs.

* Fix bug in setup test script.

* update setup file

* Add tests for oracle and sql server. Move setup.R file.

* fix bug in setup

* debug tests on github

* debug github actions

* debug actions.

* debug actions

* debug actions.

* Add missing secrets to yaml!!

* debug actions

* test connection on all platforms

* add ddl execution

* add windows and linux runners

Co-authored-by: Adam Black <adam.black@odysseusinc.com>
Co-authored-by: Clair Blacketer <mblacke@its.jnj.com>
* Add github actions workflow to build package and run tests.

* update Description file

* rename .Rproj file.

* Consolidate 'create' functions into one file.

* Add tests for create functions.

* update description

* removed spaces in file and folder names. Regenerated ddl output. Tried to fix Field_Level.csv file.

* consolidate write functions into one file. Add execute function.

* update docs

* add tests for write and execute functions

* update documentation

* Add windows and linux runners in github actions.

* update github actions

* download drivers before running tests

* fix small error in setup test file.

* debug github actions

* debug github actions

* debug github actions

* debug github actions

* fix tiny bug

* comment out execute ddl test

* fix bug in test

* Add execute test back in

* revert accidental change in description

* add print statement for debugging schema error on github actions.

* Fix schema environment variable name

* Add comment to github actions workflow file.

* remove placeholder text in function documentation.

* Rename createdDdl.R to createDdl.R

* Hack-a-thon updates

Closes #81, #387, #239, #412, #391, #330, #408, #365, #306, #264

* Changed bigint to integer for consistency

* Updated DDLs

* Add tests for redshift. Clean up test setup file.

* Foreign key fixes

* Add imports and update docs.

* Fix bug in setup test script.

* update setup file

* Add tests for oracle and sql server. Move setup.R file.

* fix bug in setup

* debug tests on github

* debug github actions

* debug actions.

* debug actions

* debug actions.

* Add missing secrets to yaml!!

* debug actions

* test connection on all platforms

* add ddl execution

* add windows and linux runners

* Allow user to specify output location in buildRelease

* replace outputpath with outputfolder for consitent argument names in the package.

* Add test for buildRelease.

* replace outputpath with outputfolder for consistency. update documentation.

* move ddl folder to inst so it is accessible from tests

* update documentation

Co-authored-by: Adam Black <adam.black@odysseusinc.com>
Co-authored-by: Clair Blacketer <mblacke@its.jnj.com>
* Add github actions workflow to build package and run tests.

* update Description file

* rename .Rproj file.

* Consolidate 'create' functions into one file.

* Add tests for create functions.

* update description

* removed spaces in file and folder names. Regenerated ddl output. Tried to fix Field_Level.csv file.

* consolidate write functions into one file. Add execute function.

* update docs

* add tests for write and execute functions

* update documentation

* Add windows and linux runners in github actions.

* update github actions

* download drivers before running tests

* fix small error in setup test file.

* debug github actions

* debug github actions

* debug github actions

* debug github actions

* fix tiny bug

* comment out execute ddl test

* fix bug in test

* Add execute test back in

* revert accidental change in description

* add print statement for debugging schema error on github actions.

* Fix schema environment variable name

* Add comment to github actions workflow file.

* remove placeholder text in function documentation.

* Rename createdDdl.R to createDdl.R

* Hack-a-thon updates

Closes #81, #387, #239, #412, #391, #330, #408, #365, #306, #264

* Changed bigint to integer for consistency

* Updated DDLs

* Add tests for redshift. Clean up test setup file.

* Foreign key fixes

* Add imports and update docs.

* Fix bug in setup test script.

* update setup file

* Add tests for oracle and sql server. Move setup.R file.

* fix bug in setup

* debug tests on github

* debug github actions

* debug actions.

* debug actions

* debug actions.

* Add missing secrets to yaml!!

* debug actions

* test connection on all platforms

* add ddl execution

* add windows and linux runners

* Resolving conflicts

* Removing unnecessary file

* Trying again to remove .DS_Store, adding to gitignore

* Allow user to specify output location in buildRelease

* replace outputpath with outputfolder for consitent argument names in the package.

* Add test for buildRelease.

* replace outputpath with outputfolder for consistency. update documentation.

* move ddl folder to inst so it is accessible from tests

* update documentation

* Add OMOP header genearator function

Co-authored-by: Adam Black <adam.black@odysseusinc.com>
Co-authored-by: Clair Blacketer <mblacke@its.jnj.com>
Co-authored-by: clairblacketer <clairblacketer@users.noreply.github.com>
* Add github actions workflow to build package and run tests.

* update Description file

* rename .Rproj file.

* Consolidate 'create' functions into one file.

* Add tests for create functions.

* update description

* removed spaces in file and folder names. Regenerated ddl output. Tried to fix Field_Level.csv file.

* consolidate write functions into one file. Add execute function.

* update docs

* add tests for write and execute functions

* update documentation

* Add windows and linux runners in github actions.

* update github actions

* download drivers before running tests

* fix small error in setup test file.

* debug github actions

* debug github actions

* debug github actions

* debug github actions

* fix tiny bug

* comment out execute ddl test

* fix bug in test

* Add execute test back in

* revert accidental change in description

* add print statement for debugging schema error on github actions.

* Fix schema environment variable name

* Add comment to github actions workflow file.

* remove placeholder text in function documentation.

* Rename createdDdl.R to createDdl.R

* Hack-a-thon updates

Closes #81, #387, #239, #412, #391, #330, #408, #365, #306, #264

* Changed bigint to integer for consistency

* Updated DDLs

* Add tests for redshift. Clean up test setup file.

* Foreign key fixes

* Add imports and update docs.

* Fix bug in setup test script.

* update setup file

* Add tests for oracle and sql server. Move setup.R file.

* fix bug in setup

* debug tests on github

* debug github actions

* debug actions.

* debug actions

* debug actions.

* Add missing secrets to yaml!!

* debug actions

* test connection on all platforms

* add ddl execution

* add windows and linux runners

* Resolving conflicts

* Removing unnecessary file

* Trying again to remove .DS_Store, adding to gitignore

* Allow user to specify output location in buildRelease

* replace outputpath with outputfolder for consitent argument names in the package.

* Add test for buildRelease.

* replace outputpath with outputfolder for consistency. update documentation.

* move ddl folder to inst so it is accessible from tests

* update documentation

* Add OMOP header genearator function

Co-authored-by: Adam Black <adam.black@odysseusinc.com>
Co-authored-by: Clair Blacketer <mblacke@its.jnj.com>
Co-authored-by: clairblacketer <clairblacketer@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Aug 20, 2021

Codecov Report

Merging #437 (3949b9e) into v5.4 (5a27d02) will increase coverage by 2.30%.
The diff coverage is 40.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##             v5.4     #437      +/-   ##
==========================================
+ Coverage   57.06%   59.37%   +2.30%     
==========================================
  Files           7        7              
  Lines         191      224      +33     
==========================================
+ Hits          109      133      +24     
- Misses         82       91       +9     
Impacted Files Coverage Δ
R/WikiParser.R 0.00% <ø> (ø)
R/createDdl.R 66.66% <0.00%> (-33.34%) ⬇️
R/downloadCurrentDdl.R 0.00% <ø> (ø)
R/listSupportedVersions.R 100.00% <ø> (+50.00%) ⬆️
R/writeDDL.R 85.71% <56.25%> (+2.04%) ⬆️
R/executeDdl.R 73.91% <71.42%> (+21.73%) ⬆️
R/buildRelease.R 55.17% <85.71%> (+55.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a27d02...3949b9e. Read the comment docs.

@ablack3
Copy link
Collaborator Author

ablack3 commented Aug 31, 2021

Hi @clairblacketer, will you take a look at this PR and let me know if there are any issues? If it looks good then let's merge it into v5.4

@clairblacketer
Copy link
Contributor

@ablack3 sorry for the delay! Everything looks great, I am happy to merge it in.

@clairblacketer clairblacketer merged commit 9779c07 into v5.4 Aug 31, 2021
@clairblacketer clairblacketer deleted the v5.4_unittest branch September 22, 2021 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants