I'm writing tests for a program that accesses an Oracle database. When I run the tests directly or using prove, the tests work wonderfully. When I build the distribution (using Dist::Zilla) and run tests from the generated makefile, they fail:
Could not connect to ... : install_driver(Oracle) failed: Can't load ... Library not loaded: @rpath/libclntsh.dylib.12.1
It must be an environment issue (I'm running OS X), but I have not been able to crack it via the usual endless googling. I think there may be some way to get the appropriate variables set via Dist::Zilla using the D::Z::P::MakeMaker::Awesome, but I shelved that effort in favor of hacking something that works at all to begin with.
I tried setting the Oracle %ENV variables (dumped from my local environment where it works) within the problematic test using a BEGIN block, but still no luck...
I also tried unsetting the environment variables from within the test that works when I run it directly:
The test still works!!!!
I'm only able to make the test crash during the "make test" phase. This is curious...