Skip to content

Commit f1504ec

Browse files
authored
Adds tests for ArangoDB 3.12 (#499)
* Add tests for ArangoDB 3.12 fix #498 * Update older tests to run against latest minor. * Mark PostTransactionAsync as deprecated since ArangoDB 3.12 * Use enum values for error code assertions in GraphApiClientTest. * Handle ArangoDB 3.12 breaking change for error code assertions in GraphApiClientTest. * Fix test failures for RenameCollectionAsync since ArangoDB 3.12
1 parent b9b9667 commit f1504ec

File tree

3 files changed

+94
-64
lines changed

3 files changed

+94
-64
lines changed

.circleci/config.yml

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ workflows:
2929
- "test-arangodb-3_11":
3030
requires:
3131
- build
32+
- "test-arangodb-3_12":
33+
requires:
34+
- build
3235

3336
jobs:
3437
build:
@@ -55,9 +58,9 @@ jobs:
5558
docker:
5659
- image: mcr.microsoft.com/dotnet/sdk:8.0
5760
environment:
58-
ARANGO_HOST: adb3_4_9
59-
- image: arangodb:3.4.9
60-
name: adb3_4_9
61+
ARANGO_HOST: adb3_4
62+
- image: arangodb:3.4
63+
name: adb3_4
6164
environment:
6265
ARANGO_ROOT_PASSWORD: root
6366
steps:
@@ -74,9 +77,9 @@ jobs:
7477
docker:
7578
- image: mcr.microsoft.com/dotnet/sdk:8.0
7679
environment:
77-
ARANGO_HOST: adb3_5_5
78-
- image: arangodb:3.5.5
79-
name: adb3_5_5
80+
ARANGO_HOST: adb3_5
81+
- image: arangodb:3.5
82+
name: adb3_5
8083
environment:
8184
ARANGO_ROOT_PASSWORD: root
8285
steps:
@@ -93,9 +96,9 @@ jobs:
9396
docker:
9497
- image: mcr.microsoft.com/dotnet/sdk:8.0
9598
environment:
96-
ARANGO_HOST: adb3_6_8
97-
- image: arangodb/arangodb:3.6.8
98-
name: adb3_6_8
99+
ARANGO_HOST: adb3_6
100+
- image: arangodb:3.6
101+
name: adb3_6
99102
environment:
100103
ARANGO_ROOT_PASSWORD: root
101104
steps:
@@ -112,9 +115,9 @@ jobs:
112115
docker:
113116
- image: mcr.microsoft.com/dotnet/sdk:8.0
114117
environment:
115-
ARANGO_HOST: adb3_7_17
116-
- image: arangodb/arangodb:3.7.17
117-
name: adb3_7_17
118+
ARANGO_HOST: adb3_7
119+
- image: arangodb:3.7
120+
name: adb3_7
118121
environment:
119122
ARANGO_ROOT_PASSWORD: root
120123
steps:
@@ -131,9 +134,9 @@ jobs:
131134
docker:
132135
- image: mcr.microsoft.com/dotnet/sdk:8.0
133136
environment:
134-
ARANGO_HOST: adb3_8_6
135-
- image: arangodb/arangodb:3.8.6
136-
name: adb3_8_6
137+
ARANGO_HOST: adb3_8
138+
- image: arangodb:3.8
139+
name: adb3_8
137140
environment:
138141
ARANGO_ROOT_PASSWORD: root
139142
steps:
@@ -150,9 +153,9 @@ jobs:
150153
docker:
151154
- image: mcr.microsoft.com/dotnet/sdk:8.0
152155
environment:
153-
ARANGO_HOST: adb3_9_1
154-
- image: arangodb/arangodb:3.9.1
155-
name: adb3_9_1
156+
ARANGO_HOST: adb3_9
157+
- image: arangodb:3.9
158+
name: adb3_9
156159
environment:
157160
ARANGO_ROOT_PASSWORD: root
158161
steps:
@@ -168,9 +171,9 @@ jobs:
168171
docker:
169172
- image: mcr.microsoft.com/dotnet/sdk:8.0
170173
environment:
171-
ARANGO_HOST: adb3_10_0
174+
ARANGO_HOST: adb3_10
172175
- image: arangodb:3.10
173-
name: adb3_10_0
176+
name: adb3_10
174177
environment:
175178
ARANGO_ROOT_PASSWORD: root
176179
steps:
@@ -186,9 +189,27 @@ jobs:
186189
docker:
187190
- image: mcr.microsoft.com/dotnet/sdk:8.0
188191
environment:
189-
ARANGO_HOST: adb3_11_0
192+
ARANGO_HOST: adb3_11
190193
- image: arangodb:3.11
191-
name: adb3_11_0
194+
name: adb3_11
195+
environment:
196+
ARANGO_ROOT_PASSWORD: root
197+
steps:
198+
- attach_workspace:
199+
# Must be absolute path or relative path from working_directory
200+
at: ~/
201+
- run:
202+
name: Test
203+
command: dotnet test -c Release --filter RunningMode!=Cluster
204+
205+
"test-arangodb-3_12":
206+
working_directory: ~/arangodb-net-standard
207+
docker:
208+
- image: mcr.microsoft.com/dotnet/sdk:8.0
209+
environment:
210+
ARANGO_HOST: adb3_12
211+
- image: arangodb:3.12
212+
name: adb3_12
192213
environment:
193214
ARANGO_ROOT_PASSWORD: root
194215
steps:

arangodb-net-standard.Test/CollectionApi/CollectionApiClientTest.cs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ public async Task PostCollectionAsync_ShouldThrow_WhenCollectionNameInvalid()
206206
{
207207
var request = new PostCollectionBody
208208
{
209-
Name = "My collection name with spaces"
209+
// A collection name that starts with a number is invalid.
210+
Name = "80 invalid collection name"
210211
};
211212
var ex = await Assert.ThrowsAsync<ApiErrorException>(async () =>
212213
{
@@ -377,25 +378,12 @@ public async Task RenameCollectionAsync_ShouldThrow_WhenNameInvalid()
377378
{
378379
await _collectionApi.RenameCollectionAsync(_testCollection, new RenameCollectionBody
379380
{
380-
Name = "Bad Collection Name"
381+
Name = "80 Bad Collection Name"
381382
});
382383
});
383384
Assert.Equal(1208, exception.ApiError.ErrorNum); // Arango Illegal Name
384385
}
385386

386-
[Fact]
387-
public async Task RenameCollectionAsync_ShouldThrow_WhenCollectionInvalid()
388-
{
389-
var exception = await Assert.ThrowsAsync<ApiErrorException>(async () =>
390-
{
391-
await _collectionApi.RenameCollectionAsync("Bad Collection Name", new RenameCollectionBody
392-
{
393-
Name = "testingCollection"
394-
});
395-
});
396-
Assert.Equal(1203, exception.ApiError.ErrorNum); // Arango Data Source Not Found
397-
}
398-
399387
[Fact]
400388
public async Task GetCollectionRevisionAsync_ShouldSucceed()
401389
{

0 commit comments

Comments
 (0)