Skip to content

Fix integration tests to display extra test information

Luke Duncalfe requested to merge ld-fix-integration-test-failure-message into master

What does this MR do and why?

When checking the configuration details of an integration in the integrations UI, people can click a Test settings button.

As well as a test success boolean, some integrations return back an extra message about the test results.

Each model that returns this extra test message returns it through the :result key (see the #test method of certain models in models/integrations/).

Projects::Settings::IntegrationsController previously retrieved the message through the :message key which means it currently does not return this extra test message.

This change will unblock !105598 (merged) which will display a list of channels the GitLab for Slack app integration cannot post notifications to.

This merge request also:

  • Adds a space between the comma-separated validation error messages returned.
  • Refactor the tests, as the existing tests were coupled to mocked Jira API responses and were difficult to test this change. They now mock the response of the service class that executes the integration tests.

How to set up and validate locally

  1. Choose a project, and go Settings > Integrations.
  2. Choose Packagist.
  3. For Username* and Token, both enter aaa.
  4. Click Test settings. You should see the below.

(Note many integrations have a lousy-looking message returned like below, but not all). Improvements are captured in &5033.

image

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Luke Duncalfe

Merge request reports