Skip to content

Commit 0619462

Browse files
authoredJun 27, 2024··
[DE-825] CI: CircleCI (#562)
1 parent 5d65950 commit 0619462

26 files changed

+618
-694
lines changed
 

‎.circleci/config.yml

+554
Large diffs are not rendered by default.

‎.circleci/maven-release-settings.xml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
3+
4+
<profiles>
5+
<profile>
6+
<id>ossrh</id>
7+
<activation>
8+
<activeByDefault>true</activeByDefault>
9+
</activation>
10+
<properties>
11+
<gpg.keyname>${env.GPG_KEYNAME}</gpg.keyname>
12+
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
13+
</properties>
14+
</profile>
15+
</profiles>
16+
17+
<servers>
18+
<server>
19+
<id>ossrh</id>
20+
<username>${env.OSSRH_USERNAME}</username>
21+
<password>${env.OSSRH_PASSWORD}</password>
22+
</server>
23+
</servers>
24+
25+
</settings>

‎.github/workflows/codeql.yml

-88
This file was deleted.

‎.github/workflows/maven-deploy.yml

-34
This file was deleted.

‎.github/workflows/maven-release.yml

-40
This file was deleted.

‎.github/workflows/native.yml

-95
This file was deleted.

‎.github/workflows/resilience.yml

-61
This file was deleted.

‎.github/workflows/test.yml

-310
This file was deleted.

‎.github/workflows/tutorial.yml

-32
This file was deleted.

‎.gitignore

-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ target
66
*.iml
77
.directory
88

9-
/docker/jwtHeader
10-
/docker/jwtSecret
11-
/docker/data
12-
139
test-results-native
1410
.flattened-pom.xml
1511
/resilience-tests/bin/toxiproxy-server-linux-amd64

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# ArangoDB Java Driver
44

55
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.arangodb/arangodb-java-driver/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.arangodb/arangodb-java-driver)
6-
[![Actions Status](https://github.com/arangodb/arangodb-java-driver/workflows/Java%20CI/badge.svg)](https://github.com/arangodb/arangodb-java-driver/actions)
6+
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/arangodb/arangodb-java-driver/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/arangodb/arangodb-java-driver/tree/main)
77

88
The official [ArangoDB](https://www.arangodb.com/) Java Driver.
99

‎docker/jwtHeader

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhcmFuZ29kYiIsInNlcnZlcl9pZCI6ImZvbyJ9.QmuhPHkmRPJuHGxsEqggHGRyVXikV44tb5YU_yWEvEM

‎docker/jwtSecret

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Averysecretword

‎docker/start_db.sh

+7-13
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ docker pull $STARTER_DOCKER_IMAGE
2626
docker pull $DOCKER_IMAGE
2727

2828
LOCATION=$(pwd)/$(dirname "$0")
29-
30-
echo "Averysecretword" > "$LOCATION"/jwtSecret
31-
docker run --rm -v "$LOCATION"/jwtSecret:/jwtSecret "$STARTER_DOCKER_IMAGE" auth header --auth.jwt-secret /jwtSecret > "$LOCATION"/jwtHeader
3229
AUTHORIZATION_HEADER=$(cat "$LOCATION"/jwtHeader)
3330

3431
STARTER_ARGS=
@@ -41,7 +38,7 @@ if [ "$STARTER_MODE" == "single" ]; then
4138
fi
4239

4340
if [ "$SSL" == "true" ]; then
44-
STARTER_ARGS="$STARTER_ARGS --ssl.keyfile=server.pem"
41+
STARTER_ARGS="$STARTER_ARGS --ssl.keyfile=/data/server.pem"
4542
SCHEME=https
4643
ARANGOSH_SCHEME=http+ssl
4744
fi
@@ -50,25 +47,22 @@ if [ "$COMPRESSION" == "true" ]; then
5047
STARTER_ARGS="${STARTER_ARGS} --all.http.compress-response-threshold=1"
5148
fi
5249

53-
if [ "$USE_MOUNTED_DATA" == "true" ]; then
54-
STARTER_ARGS="${STARTER_ARGS} --starter.data-dir=/data"
55-
MOUNT_DATA="-v $LOCATION/data:/data"
56-
echo $MOUNT_DATA
57-
fi
50+
# data volume
51+
docker create -v /data --name arangodb-data alpine:3 /bin/true
52+
docker cp "$LOCATION"/jwtSecret arangodb-data:/data
53+
docker cp "$LOCATION"/server.pem arangodb-data:/data
5854

5955
docker run -d \
6056
--name=adb \
6157
-p 8528:8528 \
62-
-v "$LOCATION"/server.pem:/server.pem \
63-
-v "$LOCATION"/jwtSecret:/jwtSecret \
64-
$MOUNT_DATA \
58+
--volumes-from arangodb-data \
6559
-v /var/run/docker.sock:/var/run/docker.sock \
6660
-e ARANGO_LICENSE_KEY="$ARANGO_LICENSE_KEY" \
6761
$STARTER_DOCKER_IMAGE \
6862
$STARTER_ARGS \
6963
--docker.net-mode=default \
7064
--docker.container=adb \
71-
--auth.jwt-secret=/jwtSecret \
65+
--auth.jwt-secret=/data/jwtSecret \
7266
--starter.address="${GW}" \
7367
--docker.image="${DOCKER_IMAGE}" \
7468
--starter.local --starter.mode=${STARTER_MODE} --all.log.level=debug --all.log.output=+ --log.verbose \

‎driver/src/test/java/com/arangodb/ArangoCollectionAsyncTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,7 @@ void getDocumentsWithCustomShardingKey(ArangoCollectionAsync c) throws Execution
755755
@ParameterizedTest
756756
@MethodSource("asyncCols")
757757
void getDocumentsDirtyRead(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException {
758+
assumeTrue(isCluster()); // skip activefailover
758759
final Collection<BaseDocument> values = new ArrayList<>();
759760
values.add(new BaseDocument("1"));
760761
values.add(new BaseDocument("2"));

‎driver/src/test/java/com/arangodb/ArangoCollectionTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,7 @@ void getDocumentsWithCustomShardingKey(ArangoCollection c) {
780780
@ParameterizedTest
781781
@MethodSource("cols")
782782
void getDocumentsDirtyRead(ArangoCollection collection) {
783+
assumeTrue(isCluster()); // skip activefailover
783784
final Collection<BaseDocument> values = new ArrayList<>();
784785
values.add(new BaseDocument("1"));
785786
values.add(new BaseDocument("2"));

‎driver/src/test/java/com/arangodb/ArangoDBAsyncTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ void arangoDBException(ArangoDBAsync arangoDB) {
609609
void fallbackHost() throws ExecutionException, InterruptedException {
610610
final ArangoDBAsync arangoDB = new ArangoDB.Builder()
611611
.loadProperties(config)
612-
.host("not-accessible", 8529).host("127.0.0.1", 8529)
612+
.host("not-accessible", 8529).host("172.28.0.1", 8529)
613613
.build()
614614
.async();
615615
final ArangoDBVersion version = arangoDB.getVersion().get();

‎driver/src/test/java/com/arangodb/ArangoDBTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ void arangoDBException(ArangoDB arangoDB) {
621621
void fallbackHost() {
622622
final ArangoDB arangoDB = new ArangoDB.Builder()
623623
.loadProperties(config)
624-
.host("not-accessible", 8529).host("127.0.0.1", 8529).build();
624+
.host("not-accessible", 8529).host("172.28.0.1", 8529).build();
625625
final ArangoDBVersion version = arangoDB.getVersion();
626626
assertThat(version).isNotNull();
627627
}

‎driver/src/test/java/com/arangodb/ArangoSslTest.java

+10-3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
import static org.assertj.core.api.Assertions.assertThat;
3737
import static org.assertj.core.api.Assertions.catchThrowable;
38+
import static org.junit.jupiter.api.Assumptions.assumeTrue;
3839

3940

4041
/**
@@ -60,6 +61,8 @@ class ArangoSslTest {
6061
@ParameterizedTest
6162
@EnumSource(Protocol.class)
6263
void connect(Protocol protocol) throws Exception {
64+
assumeTrue(protocol != Protocol.VST);
65+
6366
final KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
6467
ks.load(this.getClass().getResourceAsStream(SSL_TRUSTSTORE), SSL_TRUSTSTORE_PASSWORD.toCharArray());
6568

@@ -74,20 +77,24 @@ void connect(Protocol protocol) throws Exception {
7477

7578
final ArangoDB arangoDB = new ArangoDB.Builder()
7679
.protocol(protocol)
77-
.host("localhost", 8529)
80+
.host("172.28.0.1", 8529)
7881
.password("test")
7982
.useSsl(true)
80-
.sslContext(sc).build();
83+
.sslContext(sc)
84+
.verifyHost(false)
85+
.build();
8186
final ArangoDBVersion version = arangoDB.getVersion();
8287
assertThat(version).isNotNull();
8388
}
8489

8590
@ParameterizedTest
8691
@EnumSource(Protocol.class)
8792
void connectWithoutValidSslContext(Protocol protocol) {
93+
assumeTrue(protocol != Protocol.VST);
94+
8895
final ArangoDB arangoDB = new ArangoDB.Builder()
8996
.protocol(protocol)
90-
.host("localhost", 8529)
97+
.host("172.28.0.1", 8529)
9198
.useSsl(true)
9299
.build();
93100
Throwable thrown = catchThrowable(arangoDB::getVersion);

‎driver/src/test/java/com/arangodb/example/ssl/SslExampleTest.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import com.arangodb.entity.ArangoDBVersion;
2828
import com.arangodb.util.TestUtils;
2929
import org.junit.jupiter.api.BeforeAll;
30+
import org.junit.jupiter.api.Disabled;
3031
import org.junit.jupiter.api.Tag;
3132
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
3233
import org.junit.jupiter.params.ParameterizedTest;
@@ -67,15 +68,17 @@ class SslExampleTest {
6768
@BeforeAll
6869
static void fetchVersion() throws Exception {
6970
ArangoDB adb = new ArangoDB.Builder()
70-
.host("localhost", 8529)
71+
.host("172.28.0.1", 8529)
7172
.password("test")
7273
.useSsl(true)
7374
.sslContext(createSslContext())
75+
.verifyHost(false)
7476
.build();
7577
version = adb.getVersion();
7678
adb.shutdown();
7779
}
7880

81+
@Disabled("Only local execution, in CircleCI port 8529 exposed to localhost")
7982
@ParameterizedTest
8083
@EnumSource(Protocol.class)
8184
void connect(Protocol protocol) throws Exception {
@@ -96,7 +99,7 @@ void connect(Protocol protocol) throws Exception {
9699
void noopHostnameVerifier(Protocol protocol) throws Exception {
97100
assumeTrue(!protocol.equals(Protocol.VST) || TestUtils.isLessThanVersion(version.getVersion(), 3, 12, 0));
98101
final ArangoDB arangoDB = new ArangoDB.Builder()
99-
.host("127.0.0.1", 8529)
102+
.host("172.28.0.1", 8529)
100103
.password("test")
101104
.useSsl(true)
102105
.sslContext(createSslContext())
@@ -112,7 +115,7 @@ void noopHostnameVerifier(Protocol protocol) throws Exception {
112115
void hostnameVerifierFailure(Protocol protocol) throws Exception {
113116
assumeTrue(protocol != Protocol.VST, "VST does not support hostname verification");
114117
final ArangoDB arangoDB = new ArangoDB.Builder()
115-
.host("127.0.0.1", 8529)
118+
.host("172.28.0.1", 8529)
116119
.password("test")
117120
.useSsl(true)
118121
.sslContext(createSslContext())

‎driver/src/test/java/com/arangodb/internal/HostHandlerTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void close() {
5959
}
6060
};
6161

62-
private static final Host HOST_0 = new HostImpl(mockCP, new HostDescription("127.0.0.1", 8529));
62+
private static final Host HOST_0 = new HostImpl(mockCP, new HostDescription("172.28.0.1", 8529));
6363
private static final HostResolver SINGLE_HOST = () -> {
6464
HostSet set = new HostSet(Collections.emptyList());
6565
set.addHost(HOST_0);
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
arangodb.hosts=127.0.0.1:8529,127.0.0.1:fail
1+
arangodb.hosts=172.28.0.1:8529,172.28.0.1:fail

‎resilience-tests/bin/startProxy.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
wget -O bin/toxiproxy-server-linux-amd64 https://github.com/Shopify/toxiproxy/releases/download/${TOXIPROXY_VERSION}/toxiproxy-server-linux-amd64
44
chmod a+x bin/toxiproxy-server-linux-amd64
5-
bin/toxiproxy-server-linux-amd64 &
5+
./bin/toxiproxy-server-linux-amd64

‎resilience-tests/src/test/java/resilience/connection/AcquireHostListTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class AcquireHostListTest extends ClusterTest {
2121
@MethodSource("protocolProvider")
2222
void acquireHostList(Protocol protocol) {
2323
ArangoDB adb = new ArangoDB.Builder()
24-
.host("127.0.0.1", 8529)
24+
.host("172.28.0.1", 8529)
2525
.password("test")
2626
.acquireHostList(true)
2727
.protocol(protocol)
@@ -44,7 +44,7 @@ void acquireHostList(Protocol protocol) {
4444
@EnumSource(LoadBalancingStrategy.class)
4545
void acquireHostListWithLoadBalancingStrategy(LoadBalancingStrategy lb) {
4646
ArangoDB adb = new ArangoDB.Builder()
47-
.host("127.0.0.1", 8529)
47+
.host("172.28.0.1", 8529)
4848
.password("test")
4949
.acquireHostList(true)
5050
.loadBalancingStrategy(lb)

‎resilience-tests/src/test/java/resilience/protocol/ProtocolTest.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static Stream<Arguments> args() {
4848
void shouldUseConfiguredProtocol(Protocol p, String expectedLog) {
4949
assumeTrue(!p.equals(Protocol.VST) || isLessThanVersion(3, 12));
5050
ArangoDB adb = new ArangoDB.Builder()
51-
.host("localhost", 8529)
51+
.host("172.28.0.1", 8529)
5252
.password("test")
5353
.protocol(p)
5454
.build();
@@ -64,11 +64,12 @@ void shouldUseConfiguredProtocol(Protocol p, String expectedLog) {
6464
void shouldUseConfiguredProtocolWithTLS(Protocol p, String expectedLog) throws Exception {
6565
assumeTrue(!p.equals(Protocol.VST) || isLessThanVersion(3, 12));
6666
ArangoDB adb = new ArangoDB.Builder()
67-
.host("localhost", 8529)
67+
.host("172.28.0.1", 8529)
6868
.password("test")
6969
.protocol(p)
7070
.useSsl(true)
7171
.sslContext(sslContext())
72+
.verifyHost(false)
7273
.build();
7374
adb.getVersion();
7475
assertThat(logs.getLogs()).anyMatch(it -> it.getLoggerName().contains(expectedLog));

‎tutorial/maven/src/main/java/FirstProject.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
public class FirstProject {
1111
private static final ArangoDB arangoDB = new ArangoDB.Builder()
12-
.host("localhost", 8529)
12+
.host("172.28.0.1", 8529)
1313
.password("test")
1414
.build();
1515

0 commit comments

Comments
 (0)
Please sign in to comment.