Skip to content

Commit 2959c67

Browse files
committed
final test and cassettes
1 parent aa79297 commit 2959c67

20 files changed

+62880
-43
lines changed

.github/workflows/nightly.yml

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,9 @@ jobs:
1313
matrix:
1414
python: [ '3.10' ,'3.11', '3.12', '3.13' ]
1515
products:
16-
- account
17-
- applesilicon
18-
- baremetal
19-
- billing
20-
- block
21-
- cockpit
22-
- container
23-
- dedibox
24-
- domain
25-
- edge_services
26-
- flexibleip
27-
- function
28-
- iam
29-
- inference
30-
- init
3116
- instance
32-
- iot
33-
- ipam
34-
- jobs
3517
- k8s
36-
- key_manager
37-
- lb
38-
- login
39-
- marketplace
40-
- mnq
41-
- mongodb
42-
- object
43-
- rdb
44-
- redis
45-
- registry
46-
- serverless_sqldb
47-
- secret
48-
- tem
4918
- vpc
50-
- vpcgw
51-
- webhosting
5219
runs-on: ubuntu-latest
5320
steps:
5421
- uses: actions/checkout@v4
@@ -60,13 +27,34 @@ jobs:
6027
- name: Install dependencies and library
6128
run: poetry install
6229
- name: Run Tests
63-
run: poetry run pytest -v ./internal/namespaces/${{ matrix.products }}/... -timeout=4h
30+
run: poetry run pytest -v ./internal/namespaces/${{ matrix.products }}/tests/... -timeout=4h
6431
env:
6532
PYTHON_UPDATE_CASSETTES: true
6633
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }}
6734
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }}
6835
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }}
6936
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+
7058

7159

7260

scaleway/scaleway/instance/v1/custom_api.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,18 @@ def set_all_server_user_data(
130130

131131
return None
132132

133-
def wait_test_instance_server(self, server_id, zone):
134-
int = interval
133+
def wait_instance_server(self, server_id: str, zone: ScwZone):
134+
wait_interval = interval
135135
for i in range(1, max_retry):
136-
int *= i
137-
s = InstanceUtilsV1API.get_server(self, zone=zone, server_id=server_id)
136+
wait_interval *= i
137+
s = self.get_server(zone=zone, server_id=server_id)
138138

139139
if s.server.state == "running" or s.server.state == "stopped":
140140
return s
141141

142-
time.sleep(int)
142+
time.sleep(wait_interval)
143143

144-
return self._throw_on_error()
144+
raise TimeoutError(
145+
f"Server {server_id} in zone {zone} did not reach a stable state "
146+
f"after {max_retry} retries."
147+
)

0 commit comments

Comments
 (0)