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

Enable/disable default test reporters via env var settings #976

Closed
christophd opened this issue Sep 8, 2023 · 2 comments · Fixed by #987
Closed

Enable/disable default test reporters via env var settings #976

christophd opened this issue Sep 8, 2023 · 2 comments · Fixed by #987

Comments

@christophd
Copy link
Member

christophd commented Sep 8, 2023

User story
We should allow default test reporters to be enabled/disabled by env var settings. Once disabled the reporter should not even get initialized and log events should not be set to disabled reporters.

Additional context
Enable/disable the reporter via env var settings like HTMLReporter is doing (see HtmlReporter)

Find a way to completely remove the reporter from the list of reporters once disabled. So we do not even initialize the reporter and send log events to it once disabled.

Reporters are initialized in DefaultTestReporters. So we should make this configurable and enable/disable reporters here in order to not even initialize the disabled ones.

For Spring configuration we can use

@ConditionalOnProperty(
  value="citrus.default.logging.enabled", 
  havingValue = "true", 
  matchIfMissing = true)

on the reporter bean to not even initialize the bean based on the env var settings.

@christophd christophd changed the title Enable/disable test reporters via env var settings Enable/disable default test reporters via env var settings Sep 8, 2023
@tschlat
Copy link
Collaborator

tschlat commented Sep 8, 2023

Note that the dependency to

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
        </dependency>

Needs to be added to the project setup in order to accomplish this.
Ok with this?

@christophd
Copy link
Member Author

good point. I would try to avoid adding the dependency. Maybe there is another way to do this without adding Spring Boot

@tschlat tschlat self-assigned this Sep 13, 2023
@bbortt bbortt linked a pull request Sep 17, 2023 that will close this issue
bbortt added a commit that referenced this issue Sep 18, 2023
…t_reporters

feat(#976): Disable/Override standard Citrus reporters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants