Skip to content

Core integration tests #2

Core integration tests

Core integration tests #2

name: Core integration tests
on:
workflow_dispatch:
inputs:
tag_version:
description: 'The docker image tag for the firebolt core'
required: false
type: string
default: 'preview-rc'
python_version:
description: 'Python version'
required: false
type: string
default: '3.9'
workflow_call:
inputs:
tag_version:
description: 'The docker image tag for the firebolt core'
required: false
type: string
default: 'preview-rc'
python_version:
description: 'Python version'
required: false
type: string
default: '3.9'
jobs:
run-core-integration-tests:
runs-on: ubuntu-latest
env:
DOCKER_COMPOSE_FILE: ${{ github.workspace }}/.github/resources/core/docker-compose.yml
SERVICE_PORT: 3473
SERVICE_URL: http://localhost:3473
MAX_RETRIES: 30
RETRY_INTERVAL: 2
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[dev]"
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare docker-compose.yml
run: |
sed -i "s|\${IMAGE_TAG}|${{ inputs.tag_version }}|g" "$DOCKER_COMPOSE_FILE"
sed -i "s|\${BASE_DIR}|${{ github.workspace }}|g" "$DOCKER_COMPOSE_FILE"
- name: Start service container
run: |
docker compose -f "$DOCKER_COMPOSE_FILE" up -d
docker compose -f "$DOCKER_COMPOSE_FILE" ps
- name: Wait for service to be ready
run: |
for i in $(seq 1 $MAX_RETRIES); do
if curl --silent --fail "$SERVICE_URL" --data-binary "SELECT 1" | grep -q "1"; then
echo "Service is up and responding!"
exit 0
fi
echo "Waiting for service... ($i/$MAX_RETRIES)"
sleep $RETRY_INTERVAL
done
echo "Error: Service failed to start within timeout"
docker compose -f "$DOCKER_COMPOSE_FILE" logs
exit 1
- name: Run Core integration tests
env:
CORE_URL: "http://localhost:3473"
run: |
pytest -o log_cli=true -o log_cli_level=INFO tests/integration -k "core" --alluredir=allure-results
- name: Stop container
if: always()
run: |
docker compose -f "$DOCKER_COMPOSE_FILE" down
# Need to pull the pages branch in order to fetch the previous runs
- name: Get Allure history
uses: actions/checkout@v4
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
- name: Allure Report
uses: firebolt-db/action-allure-report@v1
if: always()
with:
github-key: ${{ secrets.GITHUB_TOKEN }}
test-type: integration
allure-dir: allure-results
pages-branch: gh-pages
repository-name: firebolt-sqlalchemy