Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored E2E test GitHub Actions #2

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: 'Run E2E tests'
on:
workflow_call:
inputs:
python-version:
required: true
description: 'The version of Python to use'
type: string
neo4j-edition:
required: true
description: "The Neo4j edition to use, either 'community' or 'enterprise'"
type: string

jobs:
e2e-tests:
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Docker Prune
run: |
docker system prune -af
docker volume prune -f
- name: Set up Python ${{ python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Set Python version for Poetry
run: poetry env use python${{ python-version }}
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-venv-${{ python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-cache --with dev
- name: Clear Poetry cache
run: poetry cache clear --all .
- name: Show disk usage after Poetry installation
run: |
df -h
- name: Wait for Weaviate to start
shell: bash
run: |
set +e
count=0; until curl -s --fail localhost:8080/v1/.well-known/ready; do ((count++)); [ $count -ge 10 ] && echo "Reached maximum retry limit" && exit 1; sleep 15; done
- name: Run tests
shell: bash
run: |
if [[ "${{ neo4j-edition }}" == "community" ]]; then
poetry run pytest -m 'not enterprise_only' ./tests/e2e
else
poetry run pytest ./tests/e2e
fi
52 changes: 4 additions & 48 deletions .github/workflows/pr-e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ concurrency:

jobs:
e2e-tests:
runs-on: ubuntu-latest
uses: ./.github/workflows/e2e-tests.yaml
strategy:
matrix:
python-version: ['3.8', '3.12']
neo4j-version:
- 5
neo4j-edition:
- enterprise
with:
target: ${{ matrix.python-version }}
python-version: ${{ matrix.neo4j-edition }}
services:
t2v-transformers:
image: cr.weaviate.io/semitechnologies/transformers-inference:sentence-transformers-all-MiniLM-L6-v2-onnx
Expand All @@ -45,50 +48,3 @@ jobs:
ports:
- 7687:7687
- 7474:7474

steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Docker Prune
run: |
docker system prune -af
docker volume prune -f
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Set Python version for Poetry
run: poetry env use python${{ matrix.python-version }}
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-cache --with dev
- name: Clear Poetry cache
run: poetry cache clear --all .
- name: Show disk usage after Poetry installation
run: |
df -h
- name: Wait for Weaviate to start
shell: bash
run: |
set +e
count=0; until curl -s --fail localhost:8080/v1/.well-known/ready; do ((count++)); [ $count -ge 10 ] && echo "Reached maximum retry limit" && exit 1; sleep 15; done
- name: Run tests
shell: bash
run: |
if [[ "${{ matrix.neo4j-edition }}" == "community" ]]; then
poetry run pytest -m 'not enterprise_only' ./tests/e2e
else
poetry run pytest ./tests/e2e
fi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: neo4j_genai PR
name:name: 'Neo4j-GenAI Scheduled Unit Tests'
on: pull_request

jobs:
Expand Down
Loading