Link tests to testcase issues even if there's no 1:1 relationship
The changes for https://gitlab.com/gitlab-org/quality/team-tasks/-/issues/504 allowed tests defined in spec files to be linked to testcase issues via the testcase tag.
However, that relied on a 1:1 relationship between the line of code defining an example and a testcase issue. The problem is that some tests don't have such a 1:1 relationship. For example parallelized or templated tests define multiple tests from a single line.
The result is that we sometimes see 500 Internal Server Error in Slack when reporting those tests that can't have a testcase tag, because of a DB timeout that occurs when searching via https://gitlab.com/api/v4/projects/gitlab%2Dorg%2Fquality%2Ftestcases/issues
Proposal
Add a testcases tag that allows multiple tests to be linked to a single line of code. For example:
shared_examples 'retrieving configuration about Geo nodes' do
it 'GET /geo_nodes', testcases: [
{
issue: `https://gitlab.com/gitlab-org/quality/testcases/-/issues/682`,
context: 'Geo Nodes API on primary node'
},
{
issue: `https://gitlab.com/gitlab-org/quality/testcases/-/issues/684`,
context: 'Geo Nodes API on secondary node'
}
]
...
The current tag is testcase, but instead of renaming it we could allow both and make the reporter able to handle either, whether its value is an array or not. That way test authors don't have to worry about whether they use testcase or testcases.