-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(storage): Improve Redis version checking and error handling
- Add IsVersionCompatible static method for version comparison - Add comprehensive version checking documentation - Add test cases for version checking with retries - Add test case for version checking with invalid server - Improve error handling in version checking logic
- Loading branch information
1 parent
9ed32c9
commit 1ce8453
Showing
16 changed files
with
1,263 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: C/C++ CI MSVC | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
env: | ||
OPENMIND_TEST_REDIS_HOST: "127.0.0.1" | ||
OPENMIND_TEST_REDIS_PORT: 6379 | ||
OPENMIND_TEST_REDIS_RETRY_COUNT: 3 | ||
OPENMIND_TEST_REDIS_RETRY_DELAY: 1000 | ||
services: | ||
redis: | ||
image: redis | ||
ports: | ||
- 6379:6379 | ||
options: >- | ||
--health-cmd "redis-cli ping" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
--redis-server-config "maxclients 10000" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up vcpkg | ||
uses: lukka/run-vcpkg@v11 | ||
with: | ||
vcpkgGitCommitId: '3508985146f1b1d248c67ead13f8f54be5b4f5da' | ||
|
||
- name: Create Build Directory | ||
run: cmake -E make_directory ${{github.workspace}}/build | ||
|
||
- name: Verify Redis Service | ||
run: | | ||
choco install redis-64 | ||
$env:PATH = "$env:PATH;C:\Program Files\Redis" | ||
$maxAttempts = 30 | ||
$attempts = 0 | ||
do { | ||
$attempts++ | ||
Write-Host "Attempt $attempts of $maxAttempts: Checking Redis availability..." | ||
try { | ||
Write-Host "1. Checking Redis ping..." | ||
$result = redis-cli -h 127.0.0.1 ping | ||
if ($result -eq 'PONG') { | ||
Write-Host "2. Getting Redis info..." | ||
redis-cli -h 127.0.0.1 info server | ||
Write-Host "3. Checking memory info..." | ||
redis-cli -h 127.0.0.1 info memory | ||
Write-Host "4. Checking client connections..." | ||
redis-cli -h 127.0.0.1 client list | ||
Write-Host "5. Configuring Redis..." | ||
redis-cli -h 127.0.0.1 config set maxclients 10000 | ||
Write-Host "Redis is fully operational!" | ||
break | ||
} | ||
} catch { | ||
Write-Host "Redis check failed: $_" | ||
} | ||
if ($attempts -eq $maxAttempts) { | ||
Write-Error "Redis failed to become available after $maxAttempts attempts" | ||
exit 1 | ||
} | ||
Start-Sleep -Seconds 2 | ||
} while ($true) | ||
- name: Configure CMake | ||
working-directory: ${{github.workspace}}/build | ||
run: | | ||
cmake .. -DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake ` | ||
-DOPENMIND_BUILD_SAMPLES=OFF ` | ||
-DOPENMIND_STORAGE_REDIS=ON | ||
- name: Build | ||
working-directory: ${{github.workspace}}/build | ||
run: cmake --build . --config Release | ||
|
||
- name: Test | ||
working-directory: ${{github.workspace}}/build | ||
env: | ||
OPENMIND_TEST_REDIS_HOST: "127.0.0.1" | ||
OPENMIND_TEST_REDIS_PORT: 6379 | ||
OPENMIND_TEST_REDIS_RETRY_COUNT: 3 | ||
OPENMIND_TEST_REDIS_RETRY_DELAY: 1000 | ||
run: ctest -C Release -E ts --rerun-failed --output-on-failure |
Oops, something went wrong.