Skip to content
Merged
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
7 changes: 5 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
################################################################################

set -e # Exit on error
# Keep trap arguments small: passing full $BASH_COMMAND can exceed ARG_MAX after a failed mvn invocation.
trap 'handle_error $? $LINENO' ERR
# Truncate $BASH_COMMAND in the trap (where it correctly reflects the failing
# command) to avoid ARG_MAX limits after a failed mvn invocation.
trap 'handle_error $? $LINENO "${BASH_COMMAND:0:200}"' ERR

# Error handling function
handle_error() {
local exit_code=$1
local line_no=$2
local failed_cmd=$3

cat << "EOF"
_____ ____ ____ ___ ____
Expand All @@ -36,6 +38,7 @@ handle_error() {

EOF
echo "Error occurred in:"
echo " Command: $failed_cmd"
echo " Line: $line_no"
echo " Exit code: $exit_code"
exit $exit_code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@
import org.apache.unomi.lists.UserList;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Objects;

public class GraphQLListIT extends BaseGraphQLIT {

private static final Logger LOGGER = LoggerFactory.getLogger(GraphQLListIT.class);

@Test
public void testCRUD() throws Exception {
Profile persistedProfile = null;
Expand Down Expand Up @@ -77,11 +81,12 @@

refreshPersistence(UserList.class);

final ResponseContext findListsContext = keepTrying("Failed waiting for profile in list query",

Check failure on line 84 in itests/src/test/java/org/apache/unomi/itests/graphql/GraphQLListIT.java

View workflow job for this annotation

GitHub Actions / JUnit Test Report

GraphQLListIT.testCRUD

Index 0 out of bounds for length 0
Raw output
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
	at org.apache.unomi.itests.graphql.GraphQLListIT.lambda$testCRUD$2(GraphQLListIT.java:101)
	at org.apache.unomi.itests.graphql.GraphQLListIT.testCRUD(GraphQLListIT.java:84)
() -> {
try (CloseableHttpResponse response = post("graphql/list/find-lists.json")) {
return ResponseContext.parse(response.getEntity());
} catch (Exception e) {
LOGGER.warn("find-lists poll attempt failed: {}", e.getMessage());
return null;
}
},
Expand Down
7 changes: 5 additions & 2 deletions setenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
# limitations under the License.
#
################################################################################
# Quiet evaluate: avoid capturing Maven download lines into the environment (breaks CI with ARG_MAX).
export UNOMI_VERSION="$(mvn -B -q -DforceStdout help:evaluate -Dexpression=project.version -DinteractiveMode=false 2>/dev/null)"
_mvn_err=$(mktemp)
export UNOMI_VERSION="$(mvn -B -q -DforceStdout help:evaluate -Dexpression=project.version -DinteractiveMode=false 2>"$_mvn_err")"
if [ -z "$UNOMI_VERSION" ]; then
echo "Failed to detect project version from Maven" >&2
cat "$_mvn_err" >&2
rm -f "$_mvn_err"
exit 1
fi
rm -f "$_mvn_err"
echo "Detected project version=$UNOMI_VERSION"
export KARAF_VERSION=4.4.8
# Uncomment the following line if you need Apache Unomi to start automatically at the first start
Expand Down
Loading