Skip to content

Changes to log messages into individual log file for each It class #1765

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

Merged
merged 26 commits into from
Jun 25, 2020

Conversation

vanajamukkara
Copy link
Member

@vanajamukkara vanajamukkara commented Jun 24, 2020

  • log messages into individual log file for each It class, same for sequential or parallel run.
  • fix port conflict issues with nginx when tests run in parallel, made by Xian.

This PR is mainly for logging messages. There are failures when tests ran in parallel which needs to be looked into. There will be a separate PR to make the tests work when run in parallel.

Jenkins Results -- intermittent failures not related to the changes in the PR
https://build.weblogick8s.org:8443/job/weblogic-kubernetes-operator-kind-new/529/
https://build.weblogick8s.org:8443/job/weblogic-kubernetes-operator-model-in-image-tests-1/48/

@vanajamukkara vanajamukkara changed the title Changes to log messages into individual log file for each It Class Changes to log messages into individual log file for each It class Jun 24, 2020
@@ -34,7 +34,9 @@
import oracle.weblogic.kubernetes.annotations.Namespaces;
import oracle.weblogic.kubernetes.annotations.tags.MustNotRunInParallel;
import oracle.weblogic.kubernetes.annotations.tags.Slow;
import oracle.weblogic.kubernetes.extensions.LoggedTest;
//import oracle.weblogic.kubernetes.extensions.LoggedTest;
Copy link
Member

Choose a reason for hiding this comment

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

remove commented out import

@@ -107,6 +109,7 @@
*/
@BeforeAll
public static void initAll(@Namespaces(2) List<String> namespaces) {
logger = ThreadSafeLogger.getLogger();
Copy link
Member

Choose a reason for hiding this comment

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

you can static import ThreadSafeLogger.getLogger then just call getLogger() here like in other It* classes.

@@ -118,6 +120,7 @@
*/
@BeforeAll
public static void initAll(@Namespaces(2) List<String> namespaces) {
logger = ThreadSafeLogger.getLogger();
Copy link
Member

Choose a reason for hiding this comment

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

you can static import ThreadSafeLogger.getLogger then just call getLogger() here like in other It* classes.

@@ -132,6 +135,7 @@
*/
@BeforeAll
public static void initAll(@Namespaces(3) List<String> namespaces) {
logger = ThreadSafeLogger.getLogger();
Copy link
Member

Choose a reason for hiding this comment

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

you can static import ThreadSafeLogger.getLogger then just call getLogger() here like in other It* classes.

@@ -119,7 +122,7 @@
*/
@BeforeAll
public static void initAll(@Namespaces(2) List<String> namespaces) {

logger = ThreadSafeLogger.getLogger();
Copy link
Member

Choose a reason for hiding this comment

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

you can static import ThreadSafeLogger.getLogger then just call getLogger() here like in other It* classes.

@@ -89,7 +91,7 @@
*/
@BeforeAll
public static void initAll(@Namespaces(5) List<String> namespaces) {

logger = ThreadSafeLogger.getLogger();
Copy link
Member

Choose a reason for hiding this comment

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

you can static import ThreadSafeLogger.getLogger then just call getLogger() here like in other It* classes.

@@ -184,7 +187,7 @@
*/
@BeforeAll
public static void initAll(@Namespaces(6) List<String> namespaces) {

logger = ThreadSafeLogger.getLogger();
Copy link
Member

Choose a reason for hiding this comment

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

same here

@@ -129,7 +131,7 @@
*/
@BeforeAll
public static void initAll(@Namespaces(4) List<String> namespaces) {

logger = ThreadSafeLogger.getLogger();
Copy link
Member

Choose a reason for hiding this comment

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

you can static import ThreadSafeLogger.getLogger then just call getLogger() here like in other It* classes.

@@ -80,7 +82,7 @@
*/
@BeforeAll
public static void initAll(@Namespaces(2) List<String> namespaces) {

logger = ThreadSafeLogger.getLogger();
Copy link
Member

Choose a reason for hiding this comment

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

you can static import ThreadSafeLogger.getLogger then just call getLogger() here like in other It* classes.

@@ -100,6 +102,7 @@
*/
@BeforeAll
public static void init(@Namespaces(2) List<String> namespaces) {
logger = ThreadSafeLogger.getLogger();
Copy link
Member

Choose a reason for hiding this comment

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

same here

@@ -61,27 +62,31 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

//import oracle.weblogic.kubernetes.extensions.LoggedTest;
Copy link
Member

Choose a reason for hiding this comment

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

remove commented out import

/**
* Setup for test suite. Creates service account, persistent volume
* and persistent volume claim.
* @param namespaces injected by JUnit extension
*/
@BeforeAll
public void setup(@Namespaces(2) List<String> namespaces) {

logger = ThreadSafeLogger.getLogger();
Copy link
Member

Choose a reason for hiding this comment

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

you can static import ThreadSafeLogger.getLogger then just call getLogger() here like in other It* classes.

@@ -232,7 +237,7 @@ public void testInstallingOperator() {
/**
* Create domain.
*/
@Test
//@Test
Copy link
Member

Choose a reason for hiding this comment

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

either enable the test or delete this test method

@@ -98,7 +100,7 @@
*/
@BeforeAll
public static void initAll(@Namespaces(3) List<String> namespaces) {

logger = ThreadSafeLogger.getLogger();
Copy link
Member

Choose a reason for hiding this comment

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

you can static import ThreadSafeLogger.getLogger then just call getLogger() here like in other It* classes.

import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.extension.ExtensionContext.Namespace.GLOBAL;

//import oracle.weblogic.kubernetes.logging.LoggingFacade;
//import static oracle.weblogic.kubernetes.extensions.LoggedTest.logger;
Copy link
Member

Choose a reason for hiding this comment

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

remove commented out imports


}


Copy link
Member

Choose a reason for hiding this comment

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

remove empty line here

Copy link
Member

@xiancao xiancao left a comment

Choose a reason for hiding this comment

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

LGTM

@rjeberhard rjeberhard merged commit b1a4764 into develop Jun 25, 2020
This was referenced Jun 26, 2020
@rjeberhard rjeberhard deleted the junit5-tests-parallel branch January 5, 2021 21:58
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.

3 participants