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
Fix Oracle SSL tests #15260
Fix Oracle SSL tests #15260
Conversation
Builds on top of #15172. |
Codecov Report
@@ Coverage Diff @@
## master #15260 +/- ##
==========================================
- Coverage 84.39% 84.37% -0.02%
==========================================
Files 398 398
Lines 31056 31056
Branches 2240 2239 -1
==========================================
- Hits 26209 26204 -5
- Misses 2607 2613 +6
+ Partials 2240 2239 -1
Continue to review full report at Codecov.
|
c55659f
to
43cd184
Compare
couple things about your macro (tu/with-env-keys-whatever {:mb-mysql-test :mb-mysql-ssl-test}
(is (= ....)) Or you could take an arbitrary function (tu/with-env-keys-whatever #(set/rename-keys % {:mb-mysql-test :mb-mysql-ssl-test})
(is (= ...))) That would allow more manipulation (if desired) than just renaming keys. You could duplicate, swap, what have you. But the api to take in every key as a string and return a new string seems a bit off. Also, perhaps assert that the new env is different than the incoming environment? I imagine if you get this wrong and it doesn't update anything and your test fails for some weird reason it might be confusing. Or perhaps even worse, you get the key name wrong and your test still passes. EDIT: |
Yeah, the intent was to have a convention that a certain prefix is renamed, in bulk, to cover things like variants of the same env (like SSL, or not, possibly other auth mechanisms or tweaks in the future). That's why I wanted to avoid having to individually enumerate the keys. However, the "by function" semantic is definitely compelling, as it is more generic (which is on brand for a test util macro). Will have to give it a bit more thought. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You should alias namespaces you require and use those aliases, so it's clear at a glance that you're not using things without requiring them and causing namespace loading race conditions
- New test util functions should be "imported" by Potemkin in
metabase.test
, and people using them should use them viamt/
. Don't usetu/
or other stuff in new tests -- we don't want to be back in the place where people had to use 6 different test util namespaces to get anything done - Your macro should include some testing context to make debugging failing tests a little easier. Maybe you accidentally renamed all the env vars; you shouldn't need to debug the test util to figure that out -- it should tell you
Define new test for Oracle SSL connectivity, in oracle_test.clj, similar to how things work in mysql_test.clj Add new test util macro, with-env-keys-renamed-by, to support running tests with environ keys temporarily renamed Using new test macro from both MySQL and Oracle SSL connectivity tests Removing now unneeded be-tests-oracle-ssl-ee CircleCI job Removing now unneeded test-selector parameter for test-driver orbv in CircleCI config.yml Updating JVM_OPTS to use a trust store that starts with cacerts and adds the RDS root CA, rather than one only containing the RDS root CA
Move bulk of logic from with-env-keys-renamed-by to new do-with-env-keys-renamed-by fn instead, calling that from macro Change logic of do-with-env-keys-renamed-by to first build the map of renames, then call set/rename-keys with that (for easier capturing of the testing context information) Switch to u/format-color in tests Reference new test macro via metabase.test (which imports it) Use namespace prefixes for the delegated test calls
cdde655
to
b5995d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool LGTM
Define new test for Oracle SSL connectivity, in oracle_test.clj, similar to how things work in mysql_test.clj
Add new test util macro, with-env-keys-renamed-by, to support running tests with environ keys temporarily renamed
Using new test macro from both MySQL and Oracle SSL connectivity tests
Removing now unneeded be-tests-oracle-ssl-ee CircleCI job
Removing now unneeded test-selector parameter for test-driver orbv in CircleCI config.yml