|
| 1 | +name: Test Basic Functionality - Redis RediSearch |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths: |
| 6 | + - 'run.py' |
| 7 | + - 'engine/**' |
| 8 | + - 'benchmark/**' |
| 9 | + - 'datasets/datasets.json' |
| 10 | + - 'experiments/configurations/**' |
| 11 | + - 'pyproject.toml' |
| 12 | + - '.github/workflows/test-basic-functionality.yml' |
| 13 | + pull_request: |
| 14 | + paths: |
| 15 | + - 'run.py' |
| 16 | + - 'engine/**' |
| 17 | + - 'benchmark/**' |
| 18 | + - 'datasets/datasets.json' |
| 19 | + - 'experiments/configurations/**' |
| 20 | + - 'pyproject.toml' |
| 21 | + - '.github/workflows/test-basic-functionality.yml' |
| 22 | + |
| 23 | +jobs: |
| 24 | + test-basic-functionality: |
| 25 | + runs-on: ubuntu-latest |
| 26 | + strategy: |
| 27 | + matrix: |
| 28 | + python-version: ['3.10', '3.11', '3.12'] |
| 29 | + |
| 30 | + services: |
| 31 | + redis: |
| 32 | + image: redis:8.2-rc1-bookworm |
| 33 | + ports: |
| 34 | + - 6379:6379 |
| 35 | + options: >- |
| 36 | + --health-cmd "redis-cli ping" |
| 37 | + --health-interval 10s |
| 38 | + --health-timeout 5s |
| 39 | + --health-retries 5 |
| 40 | +
|
| 41 | + steps: |
| 42 | + - name: Checkout code |
| 43 | + uses: actions/checkout@v4 |
| 44 | + |
| 45 | + - name: Set up Python ${{ matrix.python-version }} |
| 46 | + uses: actions/setup-python@v4 |
| 47 | + with: |
| 48 | + python-version: ${{ matrix.python-version }} |
| 49 | + |
| 50 | + - name: Install Poetry |
| 51 | + uses: snok/install-poetry@v1 |
| 52 | + with: |
| 53 | + version: latest |
| 54 | + virtualenvs-create: true |
| 55 | + virtualenvs-in-project: true |
| 56 | + |
| 57 | + - name: Install dependencies |
| 58 | + run: | |
| 59 | + poetry install --no-root |
| 60 | + |
| 61 | + - name: Wait for Redis to be ready |
| 62 | + run: | |
| 63 | + echo "Waiting for Redis to be ready..." |
| 64 | + timeout 30 bash -c 'until redis-cli -h localhost -p 6379 ping; do sleep 1; done' |
| 65 | + echo "Redis is ready!" |
| 66 | + |
| 67 | + - name: Test describe functionality |
| 68 | + run: | |
| 69 | + echo "Testing --describe commands..." |
| 70 | + poetry run python run.py --describe datasets | head -10 |
| 71 | + poetry run python run.py --describe engines | head -10 |
| 72 | + echo "✅ Describe functionality works" |
| 73 | + |
| 74 | + - name: Test basic benchmark functionality |
| 75 | + run: | |
| 76 | + echo "Testing basic benchmark with Redis..." |
| 77 | + echo "Running: python run.py --host localhost --engines redis-default-simple --datasets glove-25-angular --queries 10" |
| 78 | + |
| 79 | + # Run with limited queries for faster testing |
| 80 | + poetry run python run.py \ |
| 81 | + --host localhost \ |
| 82 | + --engines redis-default-simple \ |
| 83 | + --datasets glove-25-angular \ |
| 84 | + --queries 10 \ |
| 85 | + --timeout 300 |
| 86 | + |
| 87 | + - name: Verify results were generated |
| 88 | + run: | |
| 89 | + echo "Checking if results were generated..." |
| 90 | + if [ -d "results" ] && [ "$(ls -A results)" ]; then |
| 91 | + echo "✅ Results directory contains files:" |
| 92 | + ls -la results/ |
| 93 | + |
| 94 | + # Check for summary file |
| 95 | + if ls results/*summary.json 1> /dev/null 2>&1; then |
| 96 | + echo "✅ Summary file found" |
| 97 | + echo "Sample summary content:" |
| 98 | + head -20 results/*summary.json |
| 99 | + else |
| 100 | + echo "⚠️ No summary file found" |
| 101 | + fi |
| 102 | + |
| 103 | + # Check for experiment files |
| 104 | + if ls results/*redis-default-simple*.json 1> /dev/null 2>&1; then |
| 105 | + echo "✅ Experiment result files found" |
| 106 | + else |
| 107 | + echo "⚠️ No experiment result files found" |
| 108 | + fi |
| 109 | + else |
| 110 | + echo "❌ No results generated" |
| 111 | + exit 1 |
| 112 | + fi |
| 113 | + |
| 114 | + - name: Test with skip options |
| 115 | + run: | |
| 116 | + echo "Testing with --skip-upload (search only)..." |
| 117 | + poetry run python run.py \ |
| 118 | + --host localhost \ |
| 119 | + --engines redis-default-simple \ |
| 120 | + --datasets glove-25-angular \ |
| 121 | + --queries 5 \ |
| 122 | + --skip-upload \ |
| 123 | + --timeout 180 |
| 124 | + |
| 125 | + echo "✅ Skip upload test completed" |
| 126 | + |
| 127 | + - name: Cleanup |
| 128 | + run: | |
| 129 | + echo "Cleaning up test files..." |
| 130 | + rm -rf datasets/glove-25-angular/ |
| 131 | + rm -rf results/ |
| 132 | + echo "✅ Cleanup completed" |
0 commit comments