Skip to content

Commit af42d4d

Browse files
committed
feat(core): add vcr package
tests: add vcr conf fix(vpc): unittest to pytest and record cassettes chore: add nightly tests: auto path naming cassettes tests: register cassette with auto-naming move file to v2 fix typing and typecheck from unittest to pytest from unittest to pytest add tests to close issues final test and cassettes add dependancies add dependancies record cassettes fix typing issue fix typing issue record cassettes update test command change check on push change check on push fix: issue cassette register test to have api cassette revert change to tests instance tests: manage client and replace value for testing tests: manage client and replace value in request for testing tests: replace uri in cassette tests: replace uri in cassette by_pass validation skip TestTotalCount add region and zone to client test init replace organization_id and project_id uri replace organization_id and project_id uri
1 parent 8e83441 commit af42d4d

35 files changed

+13933
-219
lines changed

.github/workflows/checks.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ jobs:
4141
SCW_DEFAULT_PROJECT_ID: ${{ secrets.SCW_DEFAULT_PROJECT_ID }}
4242
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }}
4343
SCW_DEFAULT_REGION: ${{ secrets.SCW_DEFAULT_REGION }}
44-
run: poetry run python -m unittest discover -s tests -v
44+
CI: true
45+
run: poetry run pytest -v
4546

.github/workflows/nightly.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Nightly Tests
2+
on:
3+
schedule:
4+
- cron: '0 0 * * *'
5+
6+
permissions:
7+
actions: read
8+
9+
jobs:
10+
nightly:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
python: [ '3.10' ,'3.11', '3.12', '3.13' ]
15+
products:
16+
- instance
17+
- k8s
18+
- vpc
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Setup Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
cache: "poetry"
27+
- name: Install dependencies and library
28+
run: poetry install
29+
- name: Run Tests
30+
run: poetry run pytest -v ./internal/namespaces/${{ matrix.products }}/tests/... -timeout=4h
31+
env:
32+
PYTHON_UPDATE_CASSETTES: true
33+
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }}
34+
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }}
35+
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }}
36+
SCW_DEFAULT_PROJECT_ID: ${{ secrets.SCW_DEFAULT_PROJECT_ID }}
37+
- name: Ping on failure
38+
if: ${{ failure() }}
39+
run: |
40+
curl -X POST -H 'Content-type: application/json' \
41+
--data '{
42+
"blocks": [
43+
{
44+
"type": "section",
45+
"text": {
46+
"type": "mrkdwn",
47+
"text": "'"Scaleway SDK Python Nightly workflow failed: <https://github.com/scaleway/scaleway-sdk-python/actions/runs/${GITHUB_RUN_ID}|${FAILED_PRODUCT}>"'"
48+
}
49+
}
50+
]
51+
}' \
52+
${SLACK_WEBHOOK_NIGHTLY};
53+
env:
54+
SLACK_WEBHOOK_NIGHTLY: ${{ secrets.SLACK_WEBHOOK_NIGHTLY }}
55+
FAILED_PRODUCT: ${{ matrix.products }}
56+
57+
58+
59+
60+

scaleway-async/poetry.lock

Lines changed: 114 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scaleway-async/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ ruff = ">=0.5.0,<0.12.9"
3232
mypy = "^1.5.1"
3333
ty = "^0.0.1a15"
3434
pyrefly = ">=0.24.2,<0.27.0"
35+
pytest = "^8.4.1"
3536

3637
[build-system]
3738
requires = ["poetry-core"]

scaleway-core/poetry.lock

Lines changed: 112 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)