Skip to content

Commit

Permalink
prepare CI workflow and bump to 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hemidactylus committed Apr 11, 2024
1 parent 0c8fd79 commit e4ae59c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 47 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/idiomatic_tests.yaml

This file was deleted.

21 changes: 17 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,24 @@ on:
jobs:
test:
env:
ASTRA_DB_API_ENDPOINT: ${{ secrets.ASTRA_DB_API_ENDPOINT }}
# basic secrets
ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.ASTRA_DB_APPLICATION_TOKEN }}
ASTRA_DB_ID: ${{ secrets.ASTRA_DB_ID }}
TEST_SKIP_COLLECTION_DELETE: ${{ secrets.TEST_SKIP_COLLECTION_DELETE }}
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 }}
# special setting to not drop any collection
TEST_SKIP_COLLECTION_DELETE: ${{ secrets.TEST_SKIP_COLLECTION_DELETE }}
# 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 }}
# for "core" ops testing
ASTRA_DB_ID: ${{ secrets.ASTRA_DB_ID }}
ASTRA_DB_OPS_APPLICATION_TOKEN: ${{ secrets.ASTRA_DB_OPS_APPLICATION_TOKEN }}
runs-on: ubuntu-latest

steps:
Expand All @@ -35,4 +48,4 @@ jobs:
- name: Run pytest
run: |
poetry run pytest tests/core
poetry run pytest tests/idiomatic
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ naming convention and module structure).

### Running tests

Full testing requires environment variables:
"Full regular" testing requires environment variables:

```bash
export ASTRA_DB_APPLICATION_TOKEN="AstraCS:..."
Expand All @@ -213,20 +213,31 @@ export ASTRA_DB_SECONDARY_KEYSPACE="..."
Tests can be started in various ways:

```bash
# test the core modules
poetry run pytest tests/core
# test the "idiomatic" layer
poetry run pytest tests/idiomatic
poetry run pytest tests/idiomatic/unit
poetry run pytest tests/idiomatic/integration

# remove logging noise:
poetry run pytest [...] -o log_cli=0
```

The above runs the regular testing (i.e. non-Admin, non-core).
The (idiomatic) Admin part is tested manually by you, on Astra accounts with room
for up to 3 new databases, possibly both on prod and dev, and uses specific env vars,
as can be seen on `tests/idiomatic/integration/test_admin.py`.

Should you be interested in testing the "core" modules, moreover,
this is also something for you to run manually (do that if you touch "core"):

```bash
# test the core modules
poetry run pytest tests/core

# do not drop collections:
TEST_SKIP_COLLECTION_DELETE=1 poetry run pytest [...]

# include astrapy.core.ops testing (must cleanup after that):
# include astrapy.core.ops testing (tester must clean up after that):
TEST_ASTRADBOPS=1 poetry run pytest [...]
```

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "astrapy"
version = "1.0.0rc1"
version = "1.0.0"
description = "AstraPy is a Pythonic SDK for DataStax Astra and its Data API"
authors = [
"Stefano Lottini <[email protected]>",
Expand Down

0 comments on commit e4ae59c

Please sign in to comment.