Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
64 changes: 51 additions & 13 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,14 @@ jobs:
env:
LINODE_TOKEN: ${{ env.LINODE_TOKEN }}

- name: Upload test results
- name: Upload Test Report as Artifact
if: always()
run: |
filename=$(ls | grep -E '^[0-9]{12}_sdk_test_report\.xml$')
python3 e2e_scripts/tod_scripts/xml_to_obj_storage/scripts/add_gha_info_to_xml.py \
--branch_name "${GITHUB_REF#refs/*/}" \
--gha_run_id "$GITHUB_RUN_ID" \
--gha_run_number "$GITHUB_RUN_NUMBER" \
--xmlfile "${filename}"
sync
python3 e2e_scripts/tod_scripts/xml_to_obj_storage/scripts/xml_to_obj.py "${filename}"
env:
LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }}
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}
uses: actions/upload-artifact@v4
with:
name: test-report-file
if-no-files-found: ignore
path: '*.xml'
retention-days: 1

apply-calico-rules:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -156,6 +150,50 @@ jobs:
env:
LINODE_CLI_TOKEN: ${{ env.LINODE_TOKEN }}

process-upload-report:
runs-on: ubuntu-latest
needs: [integration-tests]
if: always() && github.repository == 'linode/linode_api4-python' # Run even if integration tests fail and only on main repository

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'recursive'

- name: Download test report
uses: actions/download-artifact@v4
with:
name: test-report-file

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install Python dependencies
run: pip3 install requests wheel boto3==1.35.99

- name: Set release version env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV


- name: Add variables and upload test results
if: always()
run: |
filename=$(ls | grep -E '^[0-9]{12}_sdk_test_report\.xml$')
python3 e2e_scripts/tod_scripts/xml_to_obj_storage/scripts/add_gha_info_to_xml.py \
--branch_name "${GITHUB_REF#refs/*/}" \
--gha_run_id "$GITHUB_RUN_ID" \
--gha_run_number "$GITHUB_RUN_NUMBER" \
--xmlfile "${filename}"
sync
python3 e2e_scripts/tod_scripts/xml_to_obj_storage/scripts/xml_to_obj.py "${filename}"
env:
LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }}
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}

notify-slack:
runs-on: ubuntu-latest
needs: [integration-tests]
Expand Down
9 changes: 7 additions & 2 deletions test/unit/objects/database_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
from test.unit.base import ClientBaseCase

from linode_api4 import PostgreSQLDatabase
Expand Down Expand Up @@ -106,6 +107,8 @@ def test_create(self):
Test that MySQL databases can be created
"""

logger = logging.getLogger(__name__)

with self.mock_post("/databases/mysql/instances") as m:
# We don't care about errors here; we just want to
# validate the request.
Expand All @@ -117,8 +120,10 @@ def test_create(self):
"g6-standard-1",
cluster_size=3,
)
except Exception:
pass
except Exception as e:
logger.warning(
"An error occurred while validating the request: %s", e
)

self.assertEqual(m.method, "post")
self.assertEqual(m.call_url, "/databases/mysql/instances")
Expand Down
2 changes: 1 addition & 1 deletion test/unit/objects/vpc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def test_list_ips(self):

ip = result[0]
assert ip.address == "10.0.0.2"
assert ip.address_range == None
assert ip.address_range is None
assert ip.vpc_id == 123
assert ip.subnet_id == 456
assert ip.region == "us-mia"
Expand Down
Loading