-
Notifications
You must be signed in to change notification settings - Fork 216
Nginx mii new it #1614
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
Nginx mii new it #1614
Conversation
…es-operator into nginx-mii-new-it
…es-operator into nginx-mii-new-it
…-kubernetes-operator into nginx-mii-new-it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few small things to fix, overall very nice, thank you
private final int replicaCount = 2; | ||
|
||
/** | ||
* Install operator and Nginx. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NGINX - spelling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
.and().with().pollInterval(10, SECONDS) | ||
.atMost(5, MINUTES).await(); | ||
|
||
// get a new unique operator namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment and log message don't match what you are doing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
assertNotNull(namespaces.get(1), "Namespace list is null"); | ||
domainNamespace = namespaces.get(1); | ||
|
||
// get a new unique Nginx namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spelling - NGINX - will not comment on any more, but this applies to all of them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
// create image with model files | ||
String miiImage = createImageAndVerify(); | ||
|
||
// push the image to OCIR to make the test work in multi node cluster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OCIR -> registry
you don't know it will be OCIR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
logger.info("Check managed server service {0} is created in namespace {1}", | ||
managedServerPrefix + i, domainNamespace); | ||
checkServiceCreated(managedServerPrefix + i); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice test! thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you!
} else { | ||
try { | ||
// sometimes the pod is not ready even the condition check is ready, sleep a little bit | ||
Thread.sleep(100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try {
Thread.sleep(100);
} catch (InterruptedException ignore) {
// ignored intentionally
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
} | ||
}); | ||
} catch (Exception e) { | ||
logger.info("Got exceptions while running command: " + curlCmd); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
singular
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
} | ||
} | ||
|
||
// after the max iterations, check if any managedserver value is false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
managed server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
}); | ||
|
||
// final check if any managed server value is false | ||
return !managedServers.containsValue(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feels odd to do the same calculation over and over
why not do it once and store the result in a var
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
*/ | ||
public static int getNextFreePort(int from, int to) { | ||
int port; | ||
for (port = from; port < to; port++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either fix your javadoc, or use <=
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
This is so far the best test result from Jenkins: |
In this run, https://build.weblogick8s.org:8443/job/weblogic-kubernetes-operator-model-in-image-tests-10/, ItMiiDomain passed. However ItSimpleNginxValidation did not run since NGINX pod stuck in the pending state and BeforeAll failed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good.
} | ||
|
||
// check that NGINX can access the sample apps from all managed servers in the domain | ||
String curlCmd = String.format("curl --silent --noproxy '*' -H 'host: %s' http://%s:%s/sample-war/index.jsp", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using --silent here, when curl fails I think you can't see the error message why its failing by using --silent..use --silent along with --showerror and can you make the curl fail and see if you get the actual error message printed to debug..
/** | ||
* Install WebLogic operator and wait until the operator pod is ready. | ||
*/ | ||
private static void installAndVerifyOperator() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify, I am not working on re-organizing the common methods..I will be creating a basic domain image for MII in extension class which can be used by It classes.
} | ||
}); | ||
} catch (Exception e) { | ||
logger.info("Got exception while running command: " + curlCmd); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log error message as well..result.stderr and result.stdout
This PR is to add Nginx ingress controller functionality in new integration test and use Nginx to access the sample apps in the model-in-image domain.