Skip to content

Add a config to disable all logging appenders#3208

Merged
heyams merged 5 commits into
mainfrom
heya/fix-log-duplicate
Jul 20, 2023
Merged

Add a config to disable all logging appenders#3208
heyams merged 5 commits into
mainfrom
heya/fix-log-duplicate

Conversation

@heyams

@heyams heyams commented Jul 19, 2023

Copy link
Copy Markdown
Contributor

No description provided.

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

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

@trask trask Jul 19, 2023

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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

@trask trask left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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

@heyams heyams Jul 20, 2023

Copy link
Copy Markdown
Contributor Author

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
@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