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

Restore RedShift unit tests #109

Merged
merged 9 commits into from
Dec 19, 2023
Merged

Restore RedShift unit tests #109

merged 9 commits into from
Dec 19, 2023

Conversation

anthonysena
Copy link
Collaborator

Unit tests for RedShift were failing while evaluating changes made in #107. Upon review, I found that there is a difference in behavior when using the latest version of DatabaseConnector (v6.3.2) which is what is used when Strategus is installed for GHA testing vs the version of DatabaseConnector (v6.2.3) that was used in the test module included with Strategus. In the new version of DatabaseConnector, the RedShift driver is downloaded from https://s3.amazonaws.com/redshift-downloads/drivers/jdbc/2.1.0.20/redshift-jdbc42-2.1.0.20.zip. Attempts to connect to RedShift with this driver using DatabaseConnector (v6.3.2) are successful. However, when the module attempted to connect to RedShift using this driver, the following error is raised:

Error in `findPathToJar()`:
! No drivers matching pattern '^RedshiftJDBC.*\.jar$'found in folder '/home/runner/jdbcDrivers'. 
Please download the JDBC drivers for your database to the folder. See `?jdbcDrivers` for instructions on downloading the drivers.
Backtrace:1. └─global execute(jobContext)
 2.   └─DatabaseConnector::connect(jobContext$moduleExecutionSettings$connectionDetails)
 3.     └─DatabaseConnector:::connectUsingJdbc(connectionDetails)
 4.       └─DatabaseConnector:::connectRedShift(connectionDetails)
 5.         └─DatabaseConnector:::findPathToJar("^RedshiftJDBC.*\\.jar$", connectionDetails$pathToDriver)
 6.           └─rlang::abort(...)

The difference here is related in the search used to find the relevant driver:

DatabaseConnector v6.2.3: jarPath <- findPathToJar("^RedshiftJDBC.*\\.jar$", connectionDetails$pathToDriver)
DatabaseConnector v6.3.2: jarPath <- findPathToJar("^[Rr]edshift.*\\.jar$", connectionDetails$pathToDriver)

Not sure what we can do to detect/prevent this in the future but wanted to document it and potentially think through ways to prevent these types of errors in the future in a new issue.

Copy link

codecov bot commented Dec 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (28bacf4) 67.73% compared to head (481e9f5) 68.04%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #109      +/-   ##
===========================================
+ Coverage    67.73%   68.04%   +0.30%     
===========================================
  Files            8        8              
  Lines          902      898       -4     
===========================================
  Hits           611      611              
+ Misses         291      287       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@anthonysena anthonysena merged commit db8c2ce into develop Dec 19, 2023
16 checks passed
@anthonysena anthonysena deleted the debug-rs-test branch December 19, 2023 23:48
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.

1 participant