'How to add @AllureId annotation to tests in source code using cli?

Our application is spring boot based project written with kotlin. There is great plugin for JetBrains IntelliJ IDEA for Allure support. The plugin provide a possibility to generate test reports, upload them to Allure TestOps and link tests from source code to test launch (tree of all tests) in Allure TestOps. Linking is achieved through adding @AllureId annotation to tests in source code.

My goal is automate this process inside build pipelines. Allure has allurectl tool which allows to upload test reports to Allure TestOps. But as far as I concerned it doesn't have a feature to assign @AllureId annotations.

Is there any option to assign @AllureId to tests from source code using command line?



Solution 1:[1]

You are generally right - allurectl does not have this feature. It is supported in the Allure IDEA plugin only.

The reason is that automated test-case linking feature in the plugin is implemented via the IntelliJ engine, so we'd have to write our own engine for the allurectl to make it work.

Solution 2:[2]

I've find out that adding a label's node with name "as_id" to generated json report works as a way to set allureId. Tested with upload to Allure TestOps, it works.

Some details are here and in related PR:https://github.com/Tinkoff/Allure.XUnit/issues/25

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ruslan Akhmetzianov
Solution 2 Danila Polevshchikov