irods / irods_auth_plugin_pam_interactive

BSD 3-Clause "New" or "Revised" License
2 stars 5 forks source link

Hard-coded path to `/var/lib/irods` in test hook #48

Closed alanking closed 2 months ago

alanking commented 2 months ago

https://github.com/irods/irods_auth_plugin_pam_interactive/blob/b05360545d6dbb16e0eadf2745e39d3d0b5438d8/irods_consortium_continuous_integration_test_hook.py#L40-L41

Let's see if there's a better way to get at that path.

alanking commented 2 months ago

This is pretty standard across plugins:

https://github.com/irods/irods_rule_engine_plugin_audit_amqp/blob/8d7354f4a2d7743ae8a76c1646e9ba905c902f88/irods_consortium_continuous_integration_test_hook.py#L141-L142

https://github.com/irods/irods_microservice_plugins_curl/blob/ea4e8df9143e7f26f3498cc8aac83368348821a5/irods_consortium_continuous_integration_test_hook.py#L45-L46

https://github.com/irods/irods_capability_indexing/blob/6ea172ce0f33c310831d108d251aafa71906c75b/irods_consortium_continuous_integration_test_hook.py#L195-L196

https://github.com/irods/irods_rule_engine_plugin_logical_quotas/blob/c7e9dd756d43b8bbcdd2c6a669620d2cb2442f62/irods_consortium_continuous_integration_test_hook.py#L41-L42

https://github.com/irods/irods_rule_engine_plugin_metadata_guard/blob/de01a5054123e3e2dc0425e9e2de8ad0c4e534b2/irods_consortium_continuous_integration_test_hook.py#L46-L47

https://github.com/irods/irods_resource_plugin_s3/blob/0304827fea9a4a8acfc6c68b18c69ae165a9dedd/irods_consortium_continuous_integration_test_hook.py#L67

https://github.com/irods/irods_resource_plugin_s3/blob/0304827fea9a4a8acfc6c68b18c69ae165a9dedd/irods_consortium_continuous_integration_test_hook.py#L159-L160

https://github.com/irods/irods_capability_storage_tiering/blob/8d0872f3b1734c36b27256a30539af493d80c431/irods_consortium_continuous_integration_test_hook.py#L32

https://github.com/irods/irods_capability_storage_tiering/blob/8d0872f3b1734c36b27256a30539af493d80c431/irods_consortium_continuous_integration_test_hook.py#L40-L41

The preferred method would probably be to use the paths module from the scripts in the iRODS server package: https://github.com/irods/irods/blob/main/scripts/irods/paths.py This would require that the test hooks be placed in /var/lib/irods/scripts or a python package so that our test hooks can use it, though.

Another possibility would be to create a function in the irods_python_ci_utilities module which could abstract this a little bit: https://github.com/irods/irods_python_ci_utilities

alanking commented 2 months ago

I think this issue goes beyond the scope of this plugin. I created this issue for discussion about how we should address this across all of our plugins: https://github.com/irods/irods_testing_environment/issues/229

For this issue, let's just make some local functions to abstract this and we can solve the larger problem for all the plugins in the other issue.

korydraughn commented 2 months ago

Agreed.