Skip to content
Merged
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
26 changes: 0 additions & 26 deletions .github/resources/core/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions .github/resources/core/config.json

This file was deleted.

17 changes: 0 additions & 17 deletions .github/resources/core/default.conf

This file was deleted.

28 changes: 0 additions & 28 deletions .github/resources/core/docker-compose.yml

This file was deleted.

97 changes: 10 additions & 87 deletions .github/workflows/integration-tests-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,21 @@ on:
secrets:
SLACK_BOT_TOKEN:
required: false
env:
DEFAULT_IMAGE_TAG: ${{ vars.DEFAULT_CORE_IMAGE_TAG }}
jobs:
run-core-integration-tests:
runs-on: ${{ inputs.os_name }}
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
with:
repository: 'firebolt-db/firebolt-python-sdk'

- name: Setup Firebolt Core
id: setup-core
uses: firebolt-db/action-setup-core@main
with:
tag_version: ${{ inputs.tag_version || vars.DEFAULT_CORE_IMAGE_TAG }}

- name: Set up Python
uses: actions/setup-python@v5
with:
Expand All @@ -68,76 +66,6 @@ jobs:
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: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

- name: Write certificate and certificate key to file
run: |
mkdir "${{ github.workspace }}/.github/resources/core/certs"
pip install trustme
# Generate a self-signed certificate for localhost
python3 -m trustme -d "${{ github.workspace }}/.github/resources/core/certs/"

- name: Install certs to keystore
run: |
sudo cp ${GITHUB_WORKSPACE}/.github/resources/core/certs/client.pem /usr/local/share/ca-certificates/client.crt
sudo update-ca-certificates

# if no image tag was passed in, then use the image tag from the defaults
- name: Set image tag
id: set-tag
run: |
IMAGE_TAG="${{ inputs.tag_version }}"
if [ -z "$IMAGE_TAG" ]; then
IMAGE_TAG="$DEFAULT_IMAGE_TAG"
fi
echo "tag=$IMAGE_TAG" >> $GITHUB_OUTPUT

- name: Prepare docker-compose.yml
run: |
if [ ! -f "$DOCKER_COMPOSE_FILE" ]; then
echo "Error: Docker compose file not found at $DOCKER_COMPOSE_FILE"
exit 1
fi
sed -i "s|\${IMAGE_TAG}|${{ steps.set-tag.outputs.tag }}|g" "$DOCKER_COMPOSE_FILE"
sed -i "s|\${BASE_DIR}|${{ github.workspace }}|g" "$DOCKER_COMPOSE_FILE"
echo "Docker compose file prepared:"
cat "$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 integration tests HTTP
env:
SERVICE_ID: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
Expand All @@ -147,7 +75,7 @@ jobs:
STOPPED_ENGINE_NAME: ""
API_ENDPOINT: ""
ACCOUNT_NAME: ""
CORE_URL: "http://localhost:3473"
CORE_URL: ${{ steps.setup-core.outputs.service_url }}
run: |
pytest -o log_cli=true -o log_cli_level=WARNING tests/integration -k "core" --alluredir=allure-results/

Expand All @@ -160,15 +88,10 @@ jobs:
STOPPED_ENGINE_NAME: ""
API_ENDPOINT: ""
ACCOUNT_NAME: ""
CORE_URL: "https://localhost:443"
CORE_URL: ${{ steps.setup-core.outputs.service_https_url }}
run: |
pytest -o log_cli=true -o log_cli_level=WARNING tests/integration -k "core" --alluredir=allure-results-https/

- 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
Expand All @@ -184,7 +107,7 @@ jobs:
continue-on-error: true
with:
github-key: ${{ secrets.GITHUB_TOKEN }}
test-type: integration
test-type: core
allure-dir: allure-results
pages-branch: gh-pages
repository-name: python-sdk
Expand All @@ -195,7 +118,7 @@ jobs:
continue-on-error: true
with:
github-key: ${{ secrets.GITHUB_TOKEN }}
test-type: integration_https
test-type: core_https
allure-dir: allure-results-https
pages-branch: gh-pages
repository-name: python-sdk
Loading