Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/main/java/cz/xtf/core/config/OpenShiftConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public static boolean useNamespacePerTestCase() {

/**
* Used only if xtf.openshift.namespace.per.testcase=true
*
*
* @return limit on namespace if it's set by -Dxtf.openshift.namespace.per.testcase.length.limit property
*/
public static int getNamespaceLengthLimitForUniqueNamespacePerTest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
interface HelmBinaryPathResolver {
/**
* Resolves Helm client binary path
*
*
* @return Helm client binary path
*/
String resolve();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
public class NamespaceManager {
/**
* By default (xtf.openshift.namespace.per.testcase=false) all entries in map point to value returned by
*
*
* @see OpenShiftConfig#namespace(). If xtf.openshift.namespace.per.testcase=true then each entry points to namespace
* assigned to each test case by {@see NamespaceManager#getNamespaceForTestClass}
*
Expand Down Expand Up @@ -116,7 +116,7 @@ private static void checkAndWaitIfNamespaceIsTerminating(String namespace) {
* Deletes namespace as returned by @see #getNamespace
*
* @param waitForDeletion whether to wait for deletion (timeout 2 min)
*
*
* @return true if successful, false otherwise
*/
public static boolean deleteProject(boolean waitForDeletion) {
Expand Down Expand Up @@ -178,7 +178,7 @@ private static String getNamespaceForTestClass(TestDescriptor testDescriptor) {
// route suffix is: .apps.eapqe-024-dryf.eapqe.psi.redhat.com
if ((OpenShiftConfig.namespace() + "-"
+ testDescriptor.getParent().get().getDisplayName().toLowerCase())
.length() > OpenShiftConfig.getNamespaceLengthLimitForUniqueNamespacePerTest()) {
.length() > OpenShiftConfig.getNamespaceLengthLimitForUniqueNamespacePerTest()) {

return OpenShiftConfig.namespace() + "-"
+ StringUtils.truncate(DigestUtils.sha256Hex(testDescriptor.getParent().get().getDisplayName()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ boolean isNightly() {

/**
* Detects cluster version from cluster
*
*
* @return version of OpenShift cluster or null
*/
private String detectClusterVersionFromCluster() {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/cz/xtf/core/openshift/OpenShift.java
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public ProjectRequest recreateProject(String name) {

/**
* Creates or recreates project specified by projectRequest instance.
*
*
* @param projectRequest project request instance
* @return ProjectRequest instance
*/
Expand Down Expand Up @@ -1278,7 +1278,7 @@ public Waiter clean() {
try {
customResources(crdContextProvider.getContext(), GenericKubernetesResource.class,
GenericKubernetesResourceList.class)
.inNamespace(getNamespace()).delete();
.inNamespace(getNamespace()).delete();
log.debug("DELETE :: " + crdContextProvider.getContext().getName() + " instances");
} catch (KubernetesClientException kce) {
log.debug(crdContextProvider.getContext().getName() + " might not be installed on the cluster.", kce);
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/cz/xtf/core/openshift/OpenShiftBinary.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void login(String url, String username, String password) {
/**
* Apply configuration file in the specified namespace.
* Delegates to `oc apply --filename='sourcepath' --namespace='namespace'`
*
*
* @param sourcePath path to configration file
* @param namespace namespace
*/
Expand All @@ -44,7 +44,7 @@ public void apply(String namespace, String sourcePath) {

/**
* Apply configuration file. Delegates to `oc apply --filename='sourcepath`
*
*
* @param sourcePath path to configration file
*/
public void apply(String sourcePath) {
Expand All @@ -53,7 +53,7 @@ public void apply(String sourcePath) {

/**
* Apply configuration files in the order they appear in the list
*
*
* @param sourcePaths list of paths to configuration files
*/
public void apply(List<String> sourcePaths) {
Expand All @@ -64,7 +64,7 @@ public void apply(List<String> sourcePaths) {

/**
* Apply configuration files in the order they appear in the list, using supplied namespace.
*
*
* @param namespace namespace in which the configuration files should be applied
* @param sourcePaths list of paths to configuration files
*/
Expand Down
14 changes: 7 additions & 7 deletions core/src/main/java/cz/xtf/core/openshift/OpenShiftWaiters.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ public Waiter hasBuildCompleted(String buildConfigName) {

return new SupplierWaiter<>(supplier, "Complete"::equals, "Failed"::equals, TimeUnit.MILLISECONDS,
WaitingConfig.buildTimeout(), reason)
.logPoint(Waiter.LogPoint.BOTH)
.failFast(failFast)
.interval(5_000);
.logPoint(Waiter.LogPoint.BOTH)
.failFast(failFast)
.interval(5_000);
}

/**
Expand All @@ -85,9 +85,9 @@ public Waiter hasBuildCompleted(Build build) {

return new SupplierWaiter<>(supplier, "Complete"::equals, "Failed"::equals, TimeUnit.MILLISECONDS,
WaitingConfig.buildTimeout(), reason)
.logPoint(Waiter.LogPoint.BOTH)
.failFast(failFast)
.interval(5_000);
.logPoint(Waiter.LogPoint.BOTH)
.failFast(failFast)
.interval(5_000);
}

/**
Expand All @@ -114,7 +114,7 @@ public Waiter isLatestBuildPresent(String buildConfigName) {
public Waiter isProjectReady() {
return new SimpleWaiter(() -> openShift.getProject() != null, TimeUnit.SECONDS, 20,
"Waiting for the project to be created.")
.failFast(failFast);
.failFast(failFast);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private ServiceLogColoredPrintStream(OutputStream out, ServiceLogColor color, St
* If we have e.g.: "AAAA\nBBBB", we would have 3 tokens: "AAAA","\n","BBBB";
* Note that a buffer not containing any new line is considered a single token e.g. buffer "AAAA" is considered as
* the single token "AAAA"
*
*
* @param buf the data.
* @param off the start offset in the data.
* @param len the number of bytes to write.
Expand Down Expand Up @@ -75,7 +75,7 @@ private boolean isNewLine(byte[] token) {
* Prints the line header which usually consists of the name of the container the log comes from, preceded by the
* name of the pod and the name of the namespace where the container is running, with properly colored background
* and foreground
*
*
* @throws IOException in case something goes wrong while writing to the underlying stream
*/
private void printLineHeader() throws IOException {
Expand All @@ -92,7 +92,7 @@ private void printLineHeader() throws IOException {

/**
* Prints a token of the log line with properly colored background and foreground
*
*
* @param buf the data.
* @param off the start offset in the data.
* @param len the number of bytes to write.
Expand All @@ -117,7 +117,7 @@ public void write(int b) {

/**
* Prints the data with properly colored background and foreground; takes care of adding a line header to each line
*
*
* @param buf the data.
* @param off the start offset in the data.
* @param len the number of bytes to write.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class ServiceLogUtils {
/**
* Adds a prefix to the message which is passed in, in order to display that it is part of the logs streaming
* process, i.e. by adding a conventional part to the beginning of the message.
*
*
* @param originalMessage the original message
* @return A string made up by the conventional prefix, followed by the original message
*/
Expand All @@ -21,7 +21,7 @@ public static String getConventionallyPrefixedLogMessage(final String originalMe
/**
* Formats the given prefix into a conventional header for a any streamed log line so that it is clear to the end
* user that it is coming from a service log rather than from the current process one
*
*
* @param prefix The prefix that will be part of the header
* @return A string representing the header for a streamed log line which will be written to the output stream
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public @interface ServiceLogsStreaming {
/**
* Returns the log level filter which is set for services annotated with {@link ServiceLogsStreaming}
*
*
* @return A String identifying the log level filter which is set for services annotated with
* {@link ServiceLogsStreaming}
*/
Expand All @@ -24,7 +24,7 @@
/**
* Defines the base path where log files produced by services annotated with {@link ServiceLogsStreaming} should be
* streamed
*
*
* @return A String representing the base path log files produced by annotated services should be streamed.
*/
String output() default ServiceLogsSettings.UNASSIGNED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public Builder inNamespaces(final List<String> namespaces) {

/**
* Gets a {@link PrintStream} instance that will be passed on and used by the {@link PodLogs} instance
*
*
* @param printStream A {@link PrintStream} instance which will be used for streaming the service logs.
* It is expected that the {@link PrintStream} instance life cycle will be handled
* at the outer scope level, in the context and by the component which created it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected PodLogsWatcher(KubernetesClient client, String namespace, PrintStream

/**
* Handles newly running containers
*
*
* @param pod the Pod where to look for newly running containers
*/
private void handleNewRunningContainers(Pod pod) {
Expand Down Expand Up @@ -128,7 +128,7 @@ private String forgeContainerLogPrefix(Pod pod, ContainerStatus status) {

/**
* Handles newly terminated containers
*
*
* @param pod the Pod where to look for newly terminated containers
*/
private void handleNewTerminatedContainers(Pod pod) {
Expand Down Expand Up @@ -189,7 +189,7 @@ public void eventReceived(Action action, Pod pod) {

/**
* Gets <i>just</i> new containers statuses by filtering the existing ones out.
*
*
* @param before A list of {@link ContainerStatus} instances belonging to already existing containers
* @param now A list of {@link ContainerStatus} instances belonging to new containers
* @return A list of {@link ContainerStatus} instances representing the difference between those belonging to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public EventFailFastCheckBuilder ofMessages(String... messages) {

/**
* If at least one event exist (after filtration), final function returns true.
*
*
* @return this
*/
public FailFastBuilder atLeastOneExists() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* If it returns true, the waiter should throw an exception.
* <p>
* Example of use:
*
*
* <pre>
* FailFastBuilder
* .ofTestAndBuildNamespace()
Expand Down
2 changes: 1 addition & 1 deletion http-client/src/main/java/cz/xtf/client/HttpWaiters.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ public Waiter responseContains(final String... strings) {
};
return new SimpleWaiter(bs,
"Waiting for " + client.getUrl().toExternalForm() + " to contain (" + String.join(",", strings) + ")")
.timeout(WaitingConfig.timeout());
.timeout(WaitingConfig.timeout());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private Map<String, ServiceLogs> serviceLogs(ExtensionContext extensionContext)
/**
* Access the execution context {@link OutputStream} instances that represent the output of existing
* {@link ServiceLogs} instances
*
*
* @param extensionContext The current test execution context
* @return A list of {@link OutputStream} instances that represent the output of existing {@link ServiceLogs}
* instances
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ public void testPlanExecutionStarted(TestPlan testPlan) {
Waiter runningBuildsBelowCapacity = new SimpleWaiter(() -> buildManagerOpenShift.getBuilds().stream()
.filter(build -> build.getStatus() != null && "Running".equals(build.getStatus().getPhase()))
.count() < BuildManagerConfig.maxRunningBuilds())
.timeout(TimeUnit.MILLISECONDS, WaitingConfig.timeout())
.reason("Waiting for a free capacity for running builds in " + BuildManagerConfig.namespace()
+ " namespace.");
.timeout(TimeUnit.MILLISECONDS, WaitingConfig.timeout())
.reason("Waiting for a free capacity for running builds in " + BuildManagerConfig.namespace()
+ " namespace.");

for (final BuildDefinition buildDefinition : buildsToBeBuilt) {
// lazy creation, so that we don't attempt to create a buildmanager namespace when no builds defined (e.g. OSO tests)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private static DockerImageMetadata getMetadata(OpenShift openShift, Image image)
Waiter metadataWaiter = new SimpleWaiter(
() -> DockerImageMetadata.areMetadataForImageReady(openShift.getImageStreamTag(tempName, image.getMajorTag())),
"Giving OpenShift instance time to download image metadata.")
.failFast(new ImageStreamFailFastCheck(openShift, tempName, image));
.failFast(new ImageStreamFailFastCheck(openShift, tempName, image));
boolean metadataOK = metadataWaiter.waitFor();

// delete unique image stream and return metadata
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.11.0</version>
<version>2.22.0</version>
<configuration>
<configFile>${maven.multiModuleProjectDirectory}/ide-config/eclipse-format.xml</configFile>
</configuration>
Expand Down