Skip to content

Commit 3f85f79

Browse files
committed
fix cassandra tests
1 parent d9a5640 commit 3f85f79

9 files changed

+127
-96
lines changed

pom.xml

+9
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,15 @@
330330
<version>${maven-surefire-plugin.version}</version>
331331
<configuration>
332332
<argLine>${surefireArgLine}</argLine>
333+
334+
<useFile>false</useFile>
335+
<trimStackTrace>false</trimStackTrace>
336+
337+
<!-- Show test timing information -->
338+
<reportFormat>plain</reportFormat>
339+
340+
<!-- Output test execution times in the logs -->
341+
<redirectTestOutputToFile>false</redirectTestOutputToFile>
333342
</configuration>
334343
</plugin>
335344
<plugin>

run-integration-tests.sh

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
3+
# Store the root directory (where mvnw is located)
4+
ROOT_DIR="$(pwd)"
5+
6+
# Check if we're in the correct directory
7+
if [ ! -f "./mvnw" ]; then
8+
echo "Error: Must be run from directory containing mvnw"
9+
exit 1
10+
fi
11+
12+
# Check if vector-store directory exists
13+
if [ ! -d "./vector-stores" ]; then
14+
echo "Error: vector-stores directory not found"
15+
exit 1
16+
fi
17+
18+
# Function to log with timestamp
19+
log() {
20+
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1"
21+
}
22+
23+
# Get list of directories
24+
log "Finding directories under ./vector-store"
25+
directories=$(find ./vector-stores -type d -mindepth 1)
26+
27+
if [ -z "$directories" ]; then
28+
log "No directories found under ./vector-stores"
29+
exit 1
30+
fi
31+
32+
# Print found directories
33+
log "Found directories:"
34+
echo "$directories" | sed 's/^/ /'
35+
36+
# Process each directory
37+
while IFS= read -r dir; do
38+
log "Processing directory: $dir"
39+
cd "$dir" || continue
40+
41+
log "Running Maven integration tests for $dir"
42+
# Use the mvnw from the root directory
43+
"$ROOT_DIR/mvnw" package -Pintegration-tests
44+
45+
build_status=$?
46+
if [ $build_status -eq 0 ]; then
47+
log "Maven build completed successfully for $dir"
48+
else
49+
log "Maven build failed for $dir"
50+
# Return to root directory before exiting
51+
cd "$ROOT_DIR"
52+
exit 1
53+
fi
54+
55+
# Return to root directory for next iteration
56+
cd "$ROOT_DIR"
57+
done <<< "$directories"
58+
59+
log "All directories processed successfully"

run-integration-tests.sh~

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
3+
# Store the root directory (where mvnw is located)
4+
ROOT_DIR="$(pwd)"
5+
6+
# Check if we're in the correct directory
7+
if [ ! -f "./mvnw" ]; then
8+
echo "Error: Must be run from directory containing mvnw"
9+
exit 1
10+
fi
11+
12+
# Check if vector-store directory exists
13+
if [ ! -d "./vector-store" ]; then
14+
echo "Error: vector-store directory not found"
15+
exit 1
16+
fi
17+
18+
# Function to log with timestamp
19+
log() {
20+
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1"
21+
}
22+
23+
# Get list of directories
24+
log "Finding directories under ./vector-store"
25+
directories=$(find ./vector-store -type d -mindepth 1)
26+
27+
if [ -z "$directories" ]; then
28+
log "No directories found under ./vector-store"
29+
exit 1
30+
fi
31+
32+
# Print found directories
33+
log "Found directories:"
34+
echo "$directories" | sed 's/^/ /'
35+
36+
# Process each directory
37+
while IFS= read -r dir; do
38+
log "Processing directory: $dir"
39+
cd "$dir" || continue
40+
41+
log "Running Maven integration tests for $dir"
42+
# Use the mvnw from the root directory
43+
"$ROOT_DIR/mvnw" package -Pintegration-tests
44+
45+
build_status=$?
46+
if [ $build_status -eq 0 ]; then
47+
log "Maven build completed successfully for $dir"
48+
else
49+
log "Maven build failed for $dir"
50+
# Return to root directory before exiting
51+
cd "$ROOT_DIR"
52+
exit 1
53+
fi
54+
55+
# Return to root directory for next iteration
56+
cd "$ROOT_DIR"
57+
done <<< "$directories"
58+
59+
log "All directories processed successfully"

vector-stores/spring-ai-cassandra-store/src/test/resources/test_wiki_full_schema.cql

-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/*
2-
* Copyright 2023-2024 the original author or authors.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
171
CREATE KEYSPACE IF NOT EXISTS test_wikidata WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
182

193
CREATE TABLE IF NOT EXISTS test_wikidata.articles (
Original file line numberDiff line numberDiff line change
@@ -1,17 +1 @@
1-
/*
2-
* Copyright 2023-2024 the original author or authors.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
171
CREATE KEYSPACE IF NOT EXISTS test_wikidata WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};

vector-stores/spring-ai-cassandra-store/src/test/resources/test_wiki_partial_1_schema.cql

-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/*
2-
* Copyright 2023-2024 the original author or authors.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
171
CREATE KEYSPACE IF NOT EXISTS test_wikidata WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
182

193
CREATE TABLE IF NOT EXISTS test_wikidata.articles (

vector-stores/spring-ai-cassandra-store/src/test/resources/test_wiki_partial_2_schema.cql

-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/*
2-
* Copyright 2023-2024 the original author or authors.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
171
CREATE KEYSPACE IF NOT EXISTS test_wikidata WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
182

193
CREATE TABLE IF NOT EXISTS test_wikidata.articles (

vector-stores/spring-ai-cassandra-store/src/test/resources/test_wiki_partial_3_schema.cql

-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/*
2-
* Copyright 2023-2024 the original author or authors.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
171
CREATE KEYSPACE IF NOT EXISTS test_wikidata WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
182

193
CREATE TABLE IF NOT EXISTS test_wikidata.articles (

vector-stores/spring-ai-cassandra-store/src/test/resources/test_wiki_partial_4_schema.cql

-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/*
2-
* Copyright 2023-2024 the original author or authors.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
171
CREATE KEYSPACE IF NOT EXISTS test_wikidata WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
182

193
CREATE TABLE IF NOT EXISTS test_wikidata.articles (

0 commit comments

Comments
 (0)