allure-framework / allure-framework/allure-csharp

Incorrect display of tests structure when use common test project in multiple solutions

Open
#394 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
125
Forks
76
Avg merge
1d 2h
Merged PRs (30d)
18

Description

Hi team!

I have several solution like:
Solution.One
*****Project.One
*****TestProject.One

Solution.Two
*****Project.Two
*****TestProject.Two

Also I have common solution like
Solution.Common
*****CommonProject
*****CommonProject.Tests

CommonProject.Tests added to TestProject.One and TestProject.Two via project reference

TestProject.One project has 1 test
TestProject.Two project has 1 test
CommonProject.Tests project has 1 test

Once the tests are done I collect all allure files from allure-results directories of test projects into one common allure-results directory. And I generate and open report then.

I noticed that the actual number of tests is not equal to what is expected in allure report.
I expect to see the number of tests equal to 4.
But number of tests equal to 3.

I found out that tests structure is incorrect on package tab of report:
Expected like this:
TestProject
*****One
**********Tests 1
**********CommonProject.Tests 1
*****Two
**********Tests 1
**********CommonProject.Tests 1
![image](https://github.com/allure-framework/allure-csharp/assets/68021046/b891a0c7-bb0f-453b-b6a9-76d6bd73a789)

Actual:
CommonProjects.Tests 1
TestProject
*****One.Tests 1
*****Two.Tests 1
![image](https://github.com/allure-framework/allure-csharp/assets/68021046/9e397630-35c9-484b-b9a3-f29a20cb5edf)

Workaround:
In order to fix this issue I parse "*-result.json" files and add solution name to start of value of following properties:
historyId
fullName
labels["name": "package"] value

And then I collect files to generate report.

I have prepared a sample in archive to demonstrate this troble. Also i added json files of allure report there
[sample.zip](https://github.com/allure-framework/allure-csharp/files/12877305/sample.zip)

Contributor guide

Open the contributing guide

Research direction

Reproduce the report using sample.zip and the collected allure-results from the three test projects. Compare the *-result.json files, focusing on historyId, fullName, and the package label, then verify that the generated report counts four tests and preserves the expected solution/project hierarchy.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.