Skip to content

Commit

Permalink
Merge branch 'develop' into EPMRPP-89703-lib-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth authored Oct 30, 2024
2 parents c8da2f9 + c760154 commit 098752f
Show file tree
Hide file tree
Showing 17 changed files with 597 additions and 271 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Changelog

## [Unreleased]
### Added
- `rp.client.join.launch.timeout.value` and `rp.client.join.launch.timeout.unit` configuration properties to control SecondaryLaunch start timeout on client join, by @HardNorth
- `rp.bts.project`, `rp.bts.url`, `rp.bts.issue.url`, `rp.bts.issue.fail` configuration properties to control manual issue set by Agents, by @HardNorth
### Changed
- Disable Launch start wait for Secondary Launches if async reporting is enabled, by @HardNorth
- Disable Statistics for Secondary Launches, by @HardNorth

## [5.2.15]
### Changed
- `commons-model` dependency version updated to `5.3.3`, by @HardNorth

## [5.2.14]
### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[![Build with Love](https://img.shields.io/badge/build%20with-❤%EF%B8%8F%E2%80%8D-lightgrey.svg)](http://reportportal.io?style=flat)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

The latest version: 5.2.14. Please use `Maven Central` link above to get the client.
The latest version: 5.2.15. Please use `Maven Central` link above to get the client.

## JVM-based clients configuration

Expand Down
8 changes: 5 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ apply plugin: 'java-library'

apply from: "${project.scripts_url}/${project.scripts_branch}/build-quality.gradle"
apply from: "${project.scripts_url}/${project.scripts_branch}/release-commons.gradle"
apply from: "${project.scripts_url}/${project.scripts_branch}/signing.gradle"
//apply from: "${project.scripts_url}/${project.scripts_branch}/signing.gradle"
apply from: "${project.scripts_url}/${project.scripts_branch}/jacoco.gradle"

project.ext.limits = [
Expand All @@ -36,13 +36,15 @@ compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'

repositories {
mavenLocal()
mavenCentral()
maven { url 'https://jitpack.io' }
}

dependencies {
api ('com.github.reportportal:commons-reporting:24941f3') {
api ('com.epam.reportportal:commons-reporting:5.12.2') {
exclude module: 'jackson-databind'
exclude module: 'guava'
}
api 'com.fasterxml.jackson.core:jackson-databind:2.12.7.1' // Access is needed by HTTP loggers to format JSON
api 'io.reactivex.rxjava2:rxjava:2.2.10'
Expand Down Expand Up @@ -77,7 +79,7 @@ dependencies {
testImplementation 'org.hamcrest:hamcrest-core:2.2'
testImplementation "org.mockito:mockito-core:${project.mockito_version}"
testImplementation "org.mockito:mockito-junit-jupiter:${project.mockito_version}"
testImplementation 'ch.qos.logback:logback-classic:1.3.12'
testImplementation 'ch.qos.logback:logback-classic:1.3.14'
testImplementation('org.awaitility:awaitility:4.0.2') {
exclude group: 'org.hamcrest'
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=5.2.15-SNAPSHOT
version=5.2.16-SNAPSHOT
description=EPAM ReportPortal. Client
retrofit_version=2.9.0
okhttp_version=4.12.0
Expand Down
123 changes: 95 additions & 28 deletions src/main/java/com/epam/reportportal/listeners/ListenerParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ public class ListenerParameters implements Cloneable {
private static final String DEFAULT_CLIENT_JOIN_MODE = "FILE";
private static final String DEFAULT_LOCK_FILE_NAME = "reportportal.lock";
private static final String DEFAULT_SYNC_FILE_NAME = "reportportal.sync";
public static final long DEFAULT_FILE_WAIT_TIMEOUT_MS = TimeUnit.MINUTES.toMillis(1);
private static final int DEFAULT_CLIENT_JOIN_LOCK_PORT = 25464;
public static final long DEFAULT_FILE_WAIT_TIMEOUT = TimeUnit.MINUTES.toMillis(1);
private static final long DEFAULT_CLIENT_JOIN_TIMEOUT = TimeUnit.MINUTES.toMillis(30);
private static final long DEFAULT_CLIENT_JOIN_LAUNCH_TIMEOUT = TimeUnit.MINUTES.toMillis(1);
private static final String DEFAULT_CLIENT_JOIN_TIMEOUT_UNIT = "MILLISECONDS";
private static final String DEFAULT_CLIENT_JOIN_LOCK_TIMEOUT_UNIT = DEFAULT_CLIENT_JOIN_TIMEOUT_UNIT;
private static final int DEFAULT_CLIENT_JOIN_LOCK_PORT = 25464;
private static final String DEFAULT_CLIENT_JOIN_LAUNCH_TIMEOUT_UNIT = DEFAULT_CLIENT_JOIN_TIMEOUT_UNIT;

private static final boolean DEFAULT_TRUNCATE = true;
private static final int DEFAULT_TRUNCATE_ITEM_NAMES_LIMIT = 1024;
Expand All @@ -72,6 +74,8 @@ public class ListenerParameters implements Cloneable {
public static final boolean DEFAULT_LAUNCH_UUID_PRINT = false;
public static final String DEFAULT_LAUNCH_UUID_OUTPUT = "stdout";

public static final boolean DEFAULT_BTS_ISSUE_FAIL = true;

private String description;
private String apiKey;
private String baseUrl;
Expand Down Expand Up @@ -106,9 +110,10 @@ public class ListenerParameters implements Cloneable {
private LaunchIdLockMode clientJoinMode;
private String lockFileName;
private String syncFileName;
private int lockPortNumber;
private long lockWaitTimeout;
private long clientJoinTimeout;
private int lockPortNumber;
private long clientJoinLaunchTimeout;

private int rxBufferSize;

Expand All @@ -120,6 +125,11 @@ public class ListenerParameters implements Cloneable {
private boolean printLaunchUuid;
private PrintStream printLaunchUuidOutput;

private String btsProjectId;
private String btsUrl;
private String btsIssueUrl;
private boolean btsIssueFail;

@Nonnull
private static ChronoUnit toChronoUnit(@Nonnull TimeUnit t) {
switch (t) {
Expand Down Expand Up @@ -175,11 +185,12 @@ public ListenerParameters() {

this.clientJoin = DEFAULT_CLIENT_JOIN;
this.clientJoinMode = LaunchIdLockMode.valueOf(DEFAULT_CLIENT_JOIN_MODE);
this.clientJoinTimeout = DEFAULT_CLIENT_JOIN_TIMEOUT;
this.lockPortNumber = DEFAULT_CLIENT_JOIN_LOCK_PORT;
this.lockFileName = DEFAULT_LOCK_FILE_NAME;
this.syncFileName = DEFAULT_SYNC_FILE_NAME;
this.lockWaitTimeout = DEFAULT_FILE_WAIT_TIMEOUT_MS;
this.lockPortNumber = DEFAULT_CLIENT_JOIN_LOCK_PORT;
this.lockWaitTimeout = DEFAULT_FILE_WAIT_TIMEOUT;
this.clientJoinTimeout = DEFAULT_CLIENT_JOIN_TIMEOUT;
this.clientJoinLaunchTimeout = DEFAULT_CLIENT_JOIN_LAUNCH_TIMEOUT;

this.rxBufferSize = DEFAULT_RX_BUFFER_SIZE;

Expand All @@ -191,6 +202,8 @@ public ListenerParameters() {
this.printLaunchUuid = DEFAULT_LAUNCH_UUID_PRINT;
this.printLaunchUuidOutput =
OutputTypes.valueOf(DEFAULT_LAUNCH_UUID_OUTPUT.toUpperCase(Locale.ROOT)).getOutput();

this.btsIssueFail = DEFAULT_BTS_ISSUE_FAIL;
}

/**
Expand Down Expand Up @@ -243,28 +256,29 @@ public ListenerParameters(PropertiesLoader properties) {

this.ioPoolSize = properties.getPropertyAsInt(IO_POOL_SIZE, DEFAULT_IO_POOL_SIZE);

// client join parameters
clientJoin = properties.getPropertyAsBoolean(CLIENT_JOIN_MODE, DEFAULT_CLIENT_JOIN);
clientJoinMode = LaunchIdLockMode.valueOf(properties.getProperty(CLIENT_JOIN_MODE_VALUE,
DEFAULT_CLIENT_JOIN_MODE
));

clientJoinTimeout = ofNullable(properties.getProperty(CLIENT_JOIN_TIMEOUT_VALUE)).map(t -> TimeUnit.valueOf(
properties.getProperty(CLIENT_JOIN_TIMEOUT_UNIT, DEFAULT_CLIENT_JOIN_TIMEOUT_UNIT))
.toMillis(Long.parseLong(t))).orElse(DEFAULT_CLIENT_JOIN_TIMEOUT);

lockPortNumber = properties.getPropertyAsInt(CLIENT_JOIN_LOCK_PORT, DEFAULT_CLIENT_JOIN_LOCK_PORT);
lockFileName = properties.getProperty(FILE_LOCK_NAME, DEFAULT_LOCK_FILE_NAME);
syncFileName = properties.getProperty(FILE_SYNC_NAME, DEFAULT_SYNC_FILE_NAME);

String waitTimeoutStr = properties.getProperty(CLIENT_JOIN_LOCK_TIMEOUT_VALUE);
if (waitTimeoutStr != null) {
TimeUnit waitTimeUnit = TimeUnit.valueOf(properties.getProperty(CLIENT_JOIN_LOCK_TIMEOUT_UNIT,
DEFAULT_CLIENT_JOIN_LOCK_TIMEOUT_UNIT
));
lockWaitTimeout = waitTimeUnit.toMillis(Long.parseLong(waitTimeoutStr));
} else {
lockWaitTimeout = DEFAULT_FILE_WAIT_TIMEOUT_MS;
}
lockPortNumber = properties.getPropertyAsInt(CLIENT_JOIN_LOCK_PORT, DEFAULT_CLIENT_JOIN_LOCK_PORT);
clientJoinTimeout = ofNullable(properties.getProperty(CLIENT_JOIN_TIMEOUT_VALUE))
.map(t -> TimeUnit.valueOf(properties.getProperty(CLIENT_JOIN_TIMEOUT_UNIT,
DEFAULT_CLIENT_JOIN_TIMEOUT_UNIT
)).toMillis(Long.parseLong(t)))
.orElse(DEFAULT_CLIENT_JOIN_TIMEOUT);
lockWaitTimeout = ofNullable(properties.getProperty(CLIENT_JOIN_LOCK_TIMEOUT_VALUE))
.map(t -> TimeUnit.valueOf(properties.getProperty(CLIENT_JOIN_LOCK_TIMEOUT_UNIT,
DEFAULT_CLIENT_JOIN_LOCK_TIMEOUT_UNIT
)).toMillis(Long.parseLong(t)))
.orElse(DEFAULT_FILE_WAIT_TIMEOUT);
clientJoinLaunchTimeout = ofNullable(properties.getProperty(CLIENT_JOIN_LAUNCH_TIMEOUT_VALUE))
.map(t -> TimeUnit.valueOf(properties.getProperty(CLIENT_JOIN_LAUNCH_TIMEOUT_UNIT,
DEFAULT_CLIENT_JOIN_LAUNCH_TIMEOUT_UNIT
)).toMillis(Long.parseLong(t)))
.orElse(DEFAULT_CLIENT_JOIN_LAUNCH_TIMEOUT);

this.rxBufferSize = properties.getPropertyAsInt(RX_BUFFER_SIZE, DEFAULT_RX_BUFFER_SIZE);

Expand All @@ -282,6 +296,15 @@ public ListenerParameters(PropertiesLoader properties) {
.getProperty(LAUNCH_UUID_PRINT_OUTPUT, DEFAULT_LAUNCH_UUID_OUTPUT)
.toUpperCase(Locale.ROOT)
).getOutput();

this.btsProjectId = properties.getProperty(BTS_PROJECT);
this.btsUrl = properties.getProperty(BTS_URL);
this.btsIssueUrl = properties.getProperty(BTS_ISSUE_URL);
this.btsIssueFail = properties.getPropertyAsBoolean(BTS_ISSUE_FAIL, DEFAULT_BTS_ISSUE_FAIL);
}

Mode parseLaunchMode(String mode) {
return Mode.isExists(mode) ? Mode.valueOf(mode.toUpperCase()) : Mode.DEFAULT;
}

public String getDescription() {
Expand Down Expand Up @@ -510,6 +533,14 @@ public void setClientJoinMode(LaunchIdLockMode clientJoinMode) {
this.clientJoinMode = clientJoinMode;
}

public int getLockPortNumber() {
return lockPortNumber;
}

public void setLockPortNumber(int lockPortNumber) {
this.lockPortNumber = lockPortNumber;
}

public String getLockFileName() {
return lockFileName;
}
Expand Down Expand Up @@ -542,12 +573,12 @@ public void setLockWaitTimeout(long timeout) {
this.lockWaitTimeout = timeout;
}

public int getLockPortNumber() {
return lockPortNumber;
public long getClientJoinLaunchTimeout() {
return clientJoinLaunchTimeout;
}

public void setLockPortNumber(int lockPortNumber) {
this.lockPortNumber = lockPortNumber;
public void setClientJoinLaunchTimeout(long clientJoinLaunchTimeout) {
this.clientJoinLaunchTimeout = clientJoinLaunchTimeout;
}

public boolean isHttpLogging() {
Expand Down Expand Up @@ -636,8 +667,39 @@ public Duration getHttpWriteTimeout() {
return httpWriteTimeout;
}

Mode parseLaunchMode(String mode) {
return Mode.isExists(mode) ? Mode.valueOf(mode.toUpperCase()) : Mode.DEFAULT;
@Nullable
public String getBtsProjectId() {
return btsProjectId;
}

public void setBtsProjectId(@Nullable String btsProjectId) {
this.btsProjectId = btsProjectId;
}

@Nullable
public String getBtsUrl() {
return btsUrl;
}

public void setBtsUrl(@Nullable String btsUrl) {
this.btsUrl = btsUrl;
}

@Nullable
public String getBtsIssueUrl() {
return btsIssueUrl;
}

public void setBtsIssueUrl(@Nullable String btsIssueUrl) {
this.btsIssueUrl = btsIssueUrl;
}

public boolean isBtsIssueFail() {
return btsIssueFail;
}

public void setBtsIssueFail(boolean btsIssueFail) {
this.btsIssueFail = btsIssueFail;
}

@Override
Expand Down Expand Up @@ -700,11 +762,16 @@ public String toString() {
sb.append(", clientJoin=").append(clientJoin);
sb.append(", clientJoinMode=").append(ofNullable(clientJoinMode).map(Enum::name).orElse(null));
sb.append(", clientJoinTimeout=").append(clientJoinTimeout);
sb.append(", clientJoinLaunchTimeout=").append(clientJoinLaunchTimeout);
sb.append(", lockFileName=").append(lockFileName);
sb.append(", syncFileName=").append(syncFileName);
sb.append(", lockWaitTimeout=").append(lockWaitTimeout);
sb.append(", lockPortNumber=").append(lockPortNumber);
sb.append(", rxBufferSize=").append(rxBufferSize);
sb.append(", btsProjectId=").append(btsProjectId);
sb.append(", btsUrl=").append(btsUrl);
sb.append(", btsIssueUrl=").append(btsIssueUrl);
sb.append(", btsIssueFail=").append(btsIssueFail);
sb.append('}');
return sb.toString();
}
Expand Down
35 changes: 1 addition & 34 deletions src/main/java/com/epam/reportportal/service/Launch.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.lang.reflect.Proxy;
import java.util.Set;

import static java.util.Objects.requireNonNull;

Expand Down Expand Up @@ -214,37 +213,5 @@ public Maybe<String> getLaunch() {
/**
* An Issue to remove 'To Investigate' mark from a skipped/failed Test Item
*/
public static final Issue NOT_ISSUE = new Issue() {
public static final String NOT_ISSUE = "NOT_ISSUE";

@Override
public String getIssueType() {
return NOT_ISSUE;
}

@Override
public void setComment(String comment) {
throw new UnsupportedOperationException();
}

@Override
public void setIssueType(String type) {
throw new UnsupportedOperationException();
}

@Override
public void setAutoAnalyzed(boolean autoAnalyzed) {
throw new UnsupportedOperationException();
}

@Override
public void setIgnoreAnalyzer(boolean ignoreAnalyzer) {
throw new UnsupportedOperationException();
}

@Override
public void setExternalSystemIssues(Set<ExternalSystemIssue> externalSystemIssues) {
throw new UnsupportedOperationException();
}
};
public static final Issue NOT_ISSUE = StaticStructuresUtils.NOT_ISSUE;
}
Loading

0 comments on commit 098752f

Please sign in to comment.