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

Rearrange CI (tables+collections covered; version matrix for unit tests) #330

Merged
merged 6 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
7 changes: 3 additions & 4 deletions .github/workflows/hcd.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run idiomatic pytest on HCD
name: Run base integration tests on HCD

on:
push:
Expand All @@ -11,8 +11,7 @@ on:
jobs:
test:
env:
# for admin-related testing if enabled
DO_IDIOMATIC_ADMIN_TESTS: ${{ secrets.DO_IDIOMATIC_ADMIN_TESTS }}
HEADER_EMBEDDING_API_KEY_OPENAI: ${{ secrets.HEADER_EMBEDDING_API_KEY_OPENAI }}
# hardcoding the target DB
DOCKER_COMPOSE_LOCAL_DATA_API: "yes"
runs-on: ubuntu-latest
Expand All @@ -34,4 +33,4 @@ jobs:

- name: Run pytest
run: |
poetry run pytest tests/idiomatic
poetry run pytest tests/base/integration
13 changes: 3 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run idiomatic pytest on Astra DB
name: Run base integration tests on Astra DB

on:
push:
Expand All @@ -16,14 +16,7 @@ jobs:
ASTRA_DB_API_ENDPOINT: ${{ secrets.ASTRA_DB_API_ENDPOINT }}
ASTRA_DB_KEYSPACE: ${{ secrets.ASTRA_DB_KEYSPACE }}
ASTRA_DB_SECONDARY_KEYSPACE: ${{ secrets.ASTRA_DB_SECONDARY_KEYSPACE }}
# for admin-related testing if enabled
DO_IDIOMATIC_ADMIN_TESTS: ${{ secrets.DO_IDIOMATIC_ADMIN_TESTS }}
PROD_ADMIN_TEST_ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.PROD_ADMIN_TEST_ASTRA_DB_APPLICATION_TOKEN }}
PROD_ADMIN_TEST_ASTRA_DB_PROVIDER: ${{ secrets.PROD_ADMIN_TEST_ASTRA_DB_PROVIDER }}
PROD_ADMIN_TEST_ASTRA_DB_REGION: ${{ secrets.PROD_ADMIN_TEST_ASTRA_DB_REGION }}
DEV_ADMIN_TEST_ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.DEV_ADMIN_TEST_ASTRA_DB_APPLICATION_TOKEN }}
DEV_ADMIN_TEST_ASTRA_DB_PROVIDER: ${{ secrets.DEV_ADMIN_TEST_ASTRA_DB_PROVIDER }}
DEV_ADMIN_TEST_ASTRA_DB_REGION: ${{ secrets.DEV_ADMIN_TEST_ASTRA_DB_REGION }}
HEADER_EMBEDDING_API_KEY_OPENAI: ${{ secrets.HEADER_EMBEDDING_API_KEY_OPENAI }}
runs-on: ubuntu-latest

steps:
Expand All @@ -43,4 +36,4 @@ jobs:

- name: Run pytest
run: |
poetry run pytest tests/idiomatic
poetry run pytest tests/base/integration
46 changes: 46 additions & 0 deletions .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Run unit tests

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
env:
# basic secrets
ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN }}
ASTRA_DB_API_ENDPOINT: ${{ secrets.ASTRA_DB_API_ENDPOINT }}
ASTRA_DB_KEYSPACE: ${{ secrets.ASTRA_DB_KEYSPACE }}
ASTRA_DB_SECONDARY_KEYSPACE: ${{ secrets.ASTRA_DB_SECONDARY_KEYSPACE }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
name: "unit test on #${{ matrix.python-version }}"
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install

- name: Run pytest
run: |
poetry run pytest tests/base/unit
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
main
====
restore support for Python 3.8, 3.9
(reinstated some Data API functionalities being tested after the API got patched re: sorting on PK and pagination with that sorting)
maintenance: full restructuring of tests and CI (tables+collections on same footing+other)

v 2.0.0-preview
===============
Expand Down
23 changes: 7 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SHELL := /bin/bash

.PHONY: all format format-fix format-tests format-src test-idiomatic test-idiomatic-unit test-idiomatic-integration build help
.PHONY: all format format-fix format-tests format-src test-integration test build help

all: help

Expand All @@ -26,23 +26,14 @@ format-fix-src: format-src
format-fix-tests: FMT_FLAGS=
format-fix-tests: format-tests

test-idiomatic:
poetry run pytest tests/idiomatic -vv
test-integration:
poetry run pytest tests/base -vv

test-idiomatic-unit:
poetry run pytest tests/idiomatic/unit -vv
test:
poetry run pytest tests/base/unit -vv

test-idiomatic-integration:
poetry run pytest tests/idiomatic/integration -vv

docker-test-idiomatic:
DOCKER_COMPOSE_LOCAL_DATA_API="yes" poetry run pytest tests/idiomatic -vv

docker-test-idiomatic-unit:
DOCKER_COMPOSE_LOCAL_DATA_API="yes" poetry run pytest tests/idiomatic/unit -vv

docker-test-idiomatic-integration:
DOCKER_COMPOSE_LOCAL_DATA_API="yes" poetry run pytest tests/idiomatic/integration -vv
docker-test-integration:
DOCKER_COMPOSE_LOCAL_DATA_API="yes" poetry run pytest tests/base -vv

build:
rm -f dist/astrapy*
Expand Down
Loading
Loading