Tests - Drop OLD committed bx-derby; install bx-derby upon build - #360
Tests - Drop OLD committed bx-derby; install bx-derby upon build#360michaelborn wants to merge 24 commits into
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes the JDBC testing infrastructure by removing an outdated committed version of the bx-derby module and implementing automatic installation during build time. The change ensures JDBC tests always use the latest version of the Derby database driver rather than a stale committed version.
Key changes:
- Automatic installation of
bx-derbymodule during test compilation via Gradle - Dynamic module loading functionality in test base class
- Complete removal of old committed
bx-derbymodule files
Reviewed Changes
Copilot reviewed 8 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/test/java/tools/JDBCTestUtils.java |
Adds utility method to check for Derby module presence |
src/test/java/ortus/boxlang/runtime/bifs/global/jdbc/BaseJDBCTest.java |
Implements dynamic Derby module loading with fallback error handling |
modules/bx-derby/* |
Removes all old committed Derby module files |
gradle.properties |
Adds Derby module version configuration |
CONTRIBUTING.md |
Updates documentation to include Derby module installation |
|
Feedback left in Slack. Also, please resolve any co-pilot comments above which are no longer relevant. |
|
The dump failure can be resolved by rebasing with dev. There are still other failures, however. |
fd213bd to
885e3b1
Compare
|
I rebased against |
|
@michaelborn status on this? |
8db85fd to
a7fb428
Compare
|
Ok, I'm stuck now on the setUp() and teardown methods in BaseJDBCTest. Both these methods expect a derby database to be available: Needs some thought on a path forward. |
|
Ready for review and merge, as long as this CI run passes with bx-derby installed. |
|
Stuck on these test failures: |
e02aed1 to
65a7fab
Compare
If the config properties mutate, this datasoure will fail to be found in the datasource manager/service. It's quite possible we need to prevent the datasource properties from mutating as well, but that's another conversation to have.
65a7fab to
c75e5b2
Compare
1. Try to avoid case-sensitive database, table or column name matches as these are flakey and change from vendor to vendor. 2. Properly set up and tear down the database tables on test run init and teardown.
This continues to fail in windows CI environments.
| // Setup Scheduler Properties | ||
| scheduler.setSchedulerName( "My-Scheduler" ) | ||
| scheduler.setTimezone( "UTC" ) | ||
|
|
There was a problem hiding this comment.
@lmajano @michaelborn Why the removals in this file? Is this related to Derby?
There was a problem hiding this comment.
Not related to Derby, just related to the fact that the scheduler completely filled the CI log to where you couldn't find any useful test output from the junit tests.
I did get approval from Luis before doing this, see here: https://ortussolutions.slack.com/archives/C04UF3E09MH/p1762800683473899
| 1. MSSQL: `box install id=bx-mssql directory=~/.boxlang/modules` | ||
| 2. MySQL: `box install id=bx-mysql directory=~/.boxlang/modules` | ||
| 3. Oracle: `box install id=bx-oracle directory=~/.boxlang/modules` | ||
| 1. MSSQL: `box install id=bx-mssql directory=~/.boxlang/modules --nosave` |
There was a problem hiding this comment.
Is there a reason not to save these?
There was a problem hiding this comment.
What would they save them to? We don't have a box.json file in the boxlang repo root.
There's not a strong reason to include the --nosave command, but also not a great reason to create a box.json file that we haven't yet needed, IMO.
Description
The BoxLang Core repo relies on the
bx-derbymodule to provide a packaged version of Apache Derby for most JDBC tests. This bx-derby version has previously been committed to the repository, but this causes numerous issues:Hence, this PR updates the gradle build to install
bx-derbyduring test compilation. The bx-derby module is then loaded into the boxlang runtime via a custom function inBaseJDBCTest.java.Note we have special treatment here for bx-derby as it is the only DB driver required to run JDBC tests. The MySQL tests, MSSQL tests, etc. all use
@EnableIf()to auto-disable if the module is present; whereas the vast majority JDBC tests rely on apache derby and do not use@EnableIf().Checklist