Skip to content

Commit b6accf8

Browse files
committed
New statements to investigate GH actions failures
1 parent 038d336 commit b6accf8

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

core/idm/logic/src/main/java/org/apache/syncope/core/logic/ReconciliationLogic.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,8 @@ public List<ProvisioningReport> push(
399399
} catch (JobExecutionException e) {
400400
LOG.error("Could not perform single push", e);
401401
sce.getElements().add(e.getMessage());
402+
403+
ExceptionUtils.getStackTrace(e).lines().forEach(line -> sce.getElements().add(line));
402404
}
403405

404406
if (!sce.isEmpty()) {

fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import static org.awaitility.Awaitility.await;
2222
import static org.junit.jupiter.api.Assertions.assertEquals;
2323
import static org.junit.jupiter.api.Assertions.assertNotNull;
24+
import static org.junit.jupiter.api.Assertions.fail;
2425

2526
import com.nimbusds.jose.JWSAlgorithm;
2627
import com.unboundid.ldap.sdk.AddRequest;
@@ -92,6 +93,7 @@
9293
import org.apache.syncope.common.lib.to.AuditEventTO;
9394
import org.apache.syncope.common.lib.to.ClientAppTO;
9495
import org.apache.syncope.common.lib.to.ConnInstanceTO;
96+
import org.apache.syncope.common.lib.to.EntityTO;
9597
import org.apache.syncope.common.lib.to.ExecTO;
9698
import org.apache.syncope.common.lib.to.GroupTO;
9799
import org.apache.syncope.common.lib.to.ImplementationTO;
@@ -791,6 +793,17 @@ protected static List<BatchResponseItem> parseBatchResponse(final Response respo
791793
(InputStream) response.getEntity(), response.getMediaType(), new BatchResponseItem());
792794
}
793795

796+
protected static <E extends EntityTO> E getEntity(final ProvisioningResult<E> result) {
797+
List<String> failures = result.getPropagationStatuses().stream().
798+
filter(status -> status.getStatus() != ExecStatus.SUCCESS).
799+
map(status -> "Propagation to " + status.getResource()
800+
+ " was not successful: " + status.getFailureReason()).toList();
801+
if (!failures.isEmpty()) {
802+
fail(String.join("\n", failures));
803+
}
804+
return result.getEntity();
805+
}
806+
794807
private static <T> T execOnLDAP(
795808
final String bindDn,
796809
final String bindPassword,

fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,9 @@ public void reconcileFromLDAP() {
420420
ExecTO execution = execSchedTask(TASK_SERVICE, TaskType.PULL, LDAP_PULL_TASK, MAX_WAIT_SECONDS, false);
421421

422422
// 1. verify execution status
423+
if (!ExecStatus.SUCCESS.equals(ExecStatus.valueOf(execution.getStatus()))) {
424+
fail("LDAP PullTask failed:\n" + execution.getMessage());
425+
}
423426
assertEquals(ExecStatus.SUCCESS, ExecStatus.valueOf(execution.getStatus()));
424427

425428
// SYNCOPE-898
@@ -1269,7 +1272,7 @@ public void issueSYNCOPE313LDAP() throws Exception {
12691272
UserCR userCR = UserITCase.getUniqueSample("[email protected]");
12701273
userCR.setPassword(oldCleanPassword);
12711274
userCR.getResources().add(RESOURCE_NAME_LDAP);
1272-
user = createUser(userCR).getEntity();
1275+
user = getEntity(createUser(userCR));
12731276
assertNotNull(user);
12741277
assertFalse(user.getResources().isEmpty());
12751278

@@ -1278,7 +1281,7 @@ public void issueSYNCOPE313LDAP() throws Exception {
12781281
UserUR userUR = new UserUR();
12791282
userUR.setKey(user.getKey());
12801283
userUR.setPassword(new PasswordPatch.Builder().value(newCleanPassword).build());
1281-
user = updateUser(userUR).getEntity();
1284+
user = getEntity(updateUser(userUR));
12821285

12831286
// 3. Check that the Syncope user now has the changed password
12841287
SyncopeClient.Self self = CLIENT_FACTORY.create(user.getUsername(), newCleanPassword).self();

fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,12 @@ public void pushMatchingUnmatchingGroups() {
126126
assertFalse(GROUP_SERVICE.read("29f96485-729e-4d31-88a1-6fc60e4677f3").
127127
getResources().contains(RESOURCE_NAME_LDAP));
128128

129-
execSchedTask(
129+
ExecTO execution = execSchedTask(
130130
TASK_SERVICE, TaskType.PUSH, "fd905ba5-9d56-4f51-83e2-859096a67b75", MAX_WAIT_SECONDS, false);
131+
if (!ExecStatus.SUCCESS.equals(ExecStatus.valueOf(execution.getStatus()))) {
132+
fail("LDAP PushTask failed:\n" + execution.getMessage());
133+
}
134+
assertEquals(ExecStatus.SUCCESS, ExecStatus.valueOf(execution.getStatus()));
131135

132136
assertNotNull(RESOURCE_SERVICE.readConnObject(
133137
RESOURCE_NAME_LDAP, AnyTypeKind.GROUP.name(), "29f96485-729e-4d31-88a1-6fc60e4677f3"));

0 commit comments

Comments
 (0)