Skip to content

Commit 69020aa

Browse files
Rearrange CI (tables+collections covered; version matrix for unit tests) (#330)
* WIP restructure test and CI * tests and CI rework * adjust for vectorize coverage in workflows * fix silly mistake in bringing env vars to flows * Update README.md Co-authored-by: Christophe Bornet <[email protected]> * ruff exemption rule in test_imports.py made module-level --------- Co-authored-by: Christophe Bornet <[email protected]>
1 parent aed8c63 commit 69020aa

File tree

104 files changed

+938
-1026
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+938
-1026
lines changed

.github/workflows/hcd.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run idiomatic pytest on HCD
1+
name: Run base integration tests on HCD
22

33
on:
44
push:
@@ -11,8 +11,7 @@ on:
1111
jobs:
1212
test:
1313
env:
14-
# for admin-related testing if enabled
15-
DO_IDIOMATIC_ADMIN_TESTS: ${{ secrets.DO_IDIOMATIC_ADMIN_TESTS }}
14+
HEADER_EMBEDDING_API_KEY_OPENAI: ${{ secrets.HEADER_EMBEDDING_API_KEY_OPENAI }}
1615
# hardcoding the target DB
1716
DOCKER_COMPOSE_LOCAL_DATA_API: "yes"
1817
runs-on: ubuntu-latest
@@ -34,4 +33,4 @@ jobs:
3433
3534
- name: Run pytest
3635
run: |
37-
poetry run pytest tests/idiomatic
36+
poetry run pytest tests/base/integration

.github/workflows/main.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run idiomatic pytest on Astra DB
1+
name: Run base integration tests on Astra DB
22

33
on:
44
push:
@@ -16,14 +16,7 @@ jobs:
1616
ASTRA_DB_API_ENDPOINT: ${{ secrets.ASTRA_DB_API_ENDPOINT }}
1717
ASTRA_DB_KEYSPACE: ${{ secrets.ASTRA_DB_KEYSPACE }}
1818
ASTRA_DB_SECONDARY_KEYSPACE: ${{ secrets.ASTRA_DB_SECONDARY_KEYSPACE }}
19-
# for admin-related testing if enabled
20-
DO_IDIOMATIC_ADMIN_TESTS: ${{ secrets.DO_IDIOMATIC_ADMIN_TESTS }}
21-
PROD_ADMIN_TEST_ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.PROD_ADMIN_TEST_ASTRA_DB_APPLICATION_TOKEN }}
22-
PROD_ADMIN_TEST_ASTRA_DB_PROVIDER: ${{ secrets.PROD_ADMIN_TEST_ASTRA_DB_PROVIDER }}
23-
PROD_ADMIN_TEST_ASTRA_DB_REGION: ${{ secrets.PROD_ADMIN_TEST_ASTRA_DB_REGION }}
24-
DEV_ADMIN_TEST_ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.DEV_ADMIN_TEST_ASTRA_DB_APPLICATION_TOKEN }}
25-
DEV_ADMIN_TEST_ASTRA_DB_PROVIDER: ${{ secrets.DEV_ADMIN_TEST_ASTRA_DB_PROVIDER }}
26-
DEV_ADMIN_TEST_ASTRA_DB_REGION: ${{ secrets.DEV_ADMIN_TEST_ASTRA_DB_REGION }}
19+
HEADER_EMBEDDING_API_KEY_OPENAI: ${{ secrets.HEADER_EMBEDDING_API_KEY_OPENAI }}
2720
runs-on: ubuntu-latest
2821

2922
steps:
@@ -43,4 +36,4 @@ jobs:
4336
4437
- name: Run pytest
4538
run: |
46-
poetry run pytest tests/idiomatic
39+
poetry run pytest tests/base/integration

.github/workflows/unit.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Run unit tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
env:
14+
# basic secrets
15+
ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN }}
16+
ASTRA_DB_API_ENDPOINT: ${{ secrets.ASTRA_DB_API_ENDPOINT }}
17+
ASTRA_DB_KEYSPACE: ${{ secrets.ASTRA_DB_KEYSPACE }}
18+
ASTRA_DB_SECONDARY_KEYSPACE: ${{ secrets.ASTRA_DB_SECONDARY_KEYSPACE }}
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
python-version:
23+
- "3.8"
24+
- "3.9"
25+
- "3.10"
26+
- "3.11"
27+
- "3.12"
28+
name: "unit test on #${{ matrix.python-version }}"
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v2
32+
33+
- name: Set up Python
34+
uses: actions/setup-python@v2
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
38+
- name: Install dependencies
39+
run: |
40+
python -m pip install --upgrade pip
41+
pip install poetry
42+
poetry install
43+
44+
- name: Run pytest
45+
run: |
46+
poetry run pytest tests/base/unit

CHANGES

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
main
22
====
33
restore support for Python 3.8, 3.9
4-
(reinstated some Data API functionalities being tested after the API got patched re: sorting on PK and pagination with that sorting)
4+
maintenance: full restructuring of tests and CI (tables+collections on same footing+other)
55

66
v 2.0.0-preview
77
===============

Makefile

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SHELL := /bin/bash
22

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

55
all: help
66

@@ -26,23 +26,14 @@ format-fix-src: format-src
2626
format-fix-tests: FMT_FLAGS=
2727
format-fix-tests: format-tests
2828

29-
test-idiomatic:
30-
poetry run pytest tests/idiomatic -vv
29+
test-integration:
30+
poetry run pytest tests/base -vv
3131

32-
test-idiomatic-unit:
33-
poetry run pytest tests/idiomatic/unit -vv
32+
test:
33+
poetry run pytest tests/base/unit -vv
3434

35-
test-idiomatic-integration:
36-
poetry run pytest tests/idiomatic/integration -vv
37-
38-
docker-test-idiomatic:
39-
DOCKER_COMPOSE_LOCAL_DATA_API="yes" poetry run pytest tests/idiomatic -vv
40-
41-
docker-test-idiomatic-unit:
42-
DOCKER_COMPOSE_LOCAL_DATA_API="yes" poetry run pytest tests/idiomatic/unit -vv
43-
44-
docker-test-idiomatic-integration:
45-
DOCKER_COMPOSE_LOCAL_DATA_API="yes" poetry run pytest tests/idiomatic/integration -vv
35+
docker-test-integration:
36+
DOCKER_COMPOSE_LOCAL_DATA_API="yes" poetry run pytest tests/base -vv
4637

4738
build:
4839
rm -f dist/astrapy*

0 commit comments

Comments
 (0)