Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞: Allure step annotation causes all method parameter values are being added to the allure result json file. #1055

Closed
1 task done
tbarabanov opened this issue Jun 20, 2024 · 1 comment

Comments

@tbarabanov
Copy link

tbarabanov commented Jun 20, 2024

What happened?

allure @Step annotation causes all method args are being added to the allure result json file

consider a case

public class DaTests {

    @Test
    public void doTest() {
        doTestStep(List.of("a", "b", "c"));
    }

    @Step("some description here")
    void doTestStep(List<String> values) {
    }

}

allure result contains all Step method args

"steps": [
    {
      "name": "some description here",
      "status": "passed",
      "stage": "finished",
      "steps": [],
      "attachments": [],
      "parameters": [
        {
          "name": "values",
          "value": "[a, b, c]"
        }
      ],
      "start": 1718895390012,
      "stop": 1718895390013
    }
  ]

I believe this should't happen. Described behaviour causes huge allure result files in our ci runner.

What Allure Integration are you using?

allure-java-commons, allure-junit5

What version of Allure Integration you are using?

2.22.3

What version of Allure Report you are using?

2.22.3

Code of Conduct

  • I agree to follow this project's Code of Conduct
@tbarabanov tbarabanov added triage type:bug Something isn't working labels Jun 20, 2024
@baev
Copy link
Member

baev commented Jun 20, 2024

You can use LifecycleListener to post-process test results and remove unnecessary data. The other option is to wrap step parameters into a POJO and override the toString() method.

@baev baev removed type:bug Something isn't working triage labels Jun 20, 2024
@baev baev closed this as completed Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants