Enable instance-level and group-level testing feature
Problem
Instance and group-level integrations cannot have their settings tested when configuring them, only project-level integrations can.
Click to read engineering reasons for this.
Integration#testable?
returns false
for group and instance level integrations. We have one service class that executes tests and it's coupled to projects.
Proposal
Add the integration settings test feature for instance and group-level integrations.
For some integrations, the settings are identical across all levels, and so the test would be identical.
For others, some settings only apply to certain levels and not others, and so only relevant settings should be tested at project, group, or instance-level. (For example, Jira project-level settings test #292243 would not execute at group or instance-level).
The architecture for enabling the instance-level and group-level testing feature will need to factor this in.
Engineering solution proposal
There's a code concept example in #381890 (comment 1200753654).
We should architect this in a way that does not add a lot of logic to the integration models. Currently, models define tests in a #test
method, but this logic should be service-level rather than a model-level. As we add the ability to select relevant tests per-level (see Proposal description above) we want to avoid adding more service-level logic in models to achieve this.
This feature issue is an opportunity to re-architecture the testing feature to take logic out of the model.
- Have a service that collects a common test (if implemented) and a level-specific test (if implemented) for the integration and execute them.
- Tests are optional, and if no test services for the integration have been written then the integration won't be testable (and the
Test
button won't appear in the integration form). - Developers just implement a test class to make it automatically testable.
- The level-specific test is also optional, developers just implement one to make it testable in a level-specific way if necessary.