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

Add a config to disable all logging appenders #3208

Merged
merged 5 commits into from
Jul 20, 2023
Merged

Conversation

heyams
Copy link
Contributor

@heyams heyams commented Jul 19, 2023

No description provided.

import org.junit.jupiter.api.extension.RegisterExtension;

@UseAgent("disabled_applicationinsights.json")
abstract class JavaUtilLoggingDisabledTest {
Copy link
Member

@trask trask Jul 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and then can remove all the subclasses (similar to the other disabled tests, no need to run these tests against envs)

Suggested change
abstract class JavaUtilLoggingDisabledTest {
@Environment(TOMCAT_8_JAVA_8)
class JavaUtilLoggingDisabledTest {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the purpose of doing subclass is to test all java versions.. this will cover one case?
our repo has this setup everywhere though
i can make the change but i think it needs to be consistent

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the other *DisabledTest smoke tests, they also only test one case

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +13 to +21
@WebServlet("/testDisabled")
public class JavaUtilLoggingDisabledServlet extends HttpServlet {

private static final Logger logger = Logger.getLogger("smoketestapp");

protected void doGet(HttpServletRequest request, HttpServletResponse response) {
logger.log(Level.WARNING, "this message will get suppressed.");
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need a separate Servlet for these tests, can just hit the same servlet that the normal test does (this is how other *DisabledTest smoke tests work)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i followed the existing setup.. one test per servlet. i think we can clean up later for all

Copy link
Contributor Author

@heyams heyams Jul 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i noticed those are spring boot apps. not servlet. we can chat about it in tomorrow's standup

@heyams heyams enabled auto-merge (squash) July 20, 2023 00:28
@heyams heyams merged commit 2dc22f4 into main Jul 20, 2023
84 checks passed
@heyams heyams deleted the heya/fix-log-duplicate branch July 20, 2023 01:07
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

Successfully merging this pull request may close these issues.

2 participants