-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into zhiwei/pep621
- Loading branch information
Showing
76 changed files
with
3,468 additions
and
663 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,8 @@ jobs: | |
runs-on: ubuntu-latest | ||
if: | ||
github.event_name == 'workflow_dispatch' && inputs.sha != '' | ||
env: | ||
EXIT_STATUS: 0 | ||
|
||
steps: | ||
- uses: actions-ecosystem/action-regex-match@v2 | ||
|
@@ -33,6 +35,8 @@ jobs: | |
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.sha }} | ||
fetch-depth: 0 | ||
submodules: 'recursive' | ||
|
||
- name: Get the hash value of the latest commit from the PR branch | ||
uses: octokit/[email protected] | ||
|
@@ -83,28 +87,25 @@ jobs: | |
timestamp=$(date +'%Y%m%d%H%M') | ||
report_filename="${timestamp}_sdk_test_report.xml" | ||
status=0 | ||
if ! python3 -m pytest test/integration/${INTEGRATION_TEST_PATH} --junitxml="${report_filename}"; then | ||
echo "Tests failed, but attempting to upload results anyway" | ||
if ! python3 -m pytest test/integration/${INTEGRATION_TEST_PATH} --disable-warnings --junitxml="${report_filename}"; then | ||
echo "EXIT_STATUS=1" >> $GITHUB_ENV | ||
fi | ||
env: | ||
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }} | ||
|
||
- name: Set release version env | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
- name: Add additional information to XML report | ||
run: | | ||
filename=$(ls | grep -E '^[0-9]{12}_sdk_test_report\.xml$') | ||
python test/script/add_to_xml_test_report.py \ | ||
--branch_name "${{ env.RELEASE_VERSION }}" \ | ||
python tod_scripts/add_to_xml_test_report.py \ | ||
--branch_name "${GITHUB_REF#refs/*/}" \ | ||
--gha_run_id "$GITHUB_RUN_ID" \ | ||
--gha_run_number "$GITHUB_RUN_NUMBER" \ | ||
--xmlfile "${filename}" | ||
- name: Upload test results | ||
run: | | ||
report_filename=$(ls | grep -E '^[0-9]{12}_sdk_test_report\.xml$') | ||
python3 test/script/test_report_upload_script.py "${report_filename}" | ||
python3 tod_scripts/test_report_upload_script.py "${report_filename}" | ||
env: | ||
LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }} | ||
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }} | ||
|
@@ -135,4 +136,13 @@ jobs: | |
status: 'completed', | ||
conclusion: process.env.conclusion | ||
}); | ||
return result; | ||
return result; | ||
- name: Test Execution Status Handler | ||
run: | | ||
if [[ "$EXIT_STATUS" != 0 ]]; then | ||
echo "Test execution contains failure(s)" | ||
exit $EXIT_STATUS | ||
else | ||
echo "Tests passed!" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "tod_scripts"] | ||
path = tod_scripts | ||
url = https://github.com/linode/TOD-test-report-uploader.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ | |
from .support import * | ||
from .tag import * | ||
from .volume import * | ||
from .vpc import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
from typing import Any, Dict, List, Optional, Union | ||
|
||
from linode_api4 import VPCSubnet | ||
from linode_api4.errors import UnexpectedResponseError | ||
from linode_api4.groups import Group | ||
from linode_api4.objects import VPC, Base, Region | ||
from linode_api4.paginated_list import PaginatedList | ||
|
||
|
||
class VPCGroup(Group): | ||
def __call__(self, *filters) -> PaginatedList: | ||
""" | ||
Retrieves all of the VPCs the acting user has access to. | ||
This is intended to be called off of the :any:`LinodeClient` | ||
class, like this:: | ||
vpcs = client.vpcs() | ||
API Documentation: TODO | ||
:param filters: Any number of filters to apply to this query. | ||
See :doc:`Filtering Collections</linode_api4/objects/filtering>` | ||
for more details on filtering. | ||
:returns: A list of VPC the acting user can access. | ||
:rtype: PaginatedList of VPC | ||
""" | ||
return self.client._get_and_filter(VPC, *filters) | ||
|
||
def create( | ||
self, | ||
label: str, | ||
region: Union[Region, str], | ||
description: Optional[str] = None, | ||
subnets: Optional[List[Dict[str, Any]]] = None, | ||
**kwargs, | ||
) -> VPC: | ||
""" | ||
Creates a new VPC under your Linode account. | ||
API Documentation: TODO | ||
:param label: The label of the newly created VPC. | ||
:type label: str | ||
:param region: The region of the newly created VPC. | ||
:type region: Union[Region, str] | ||
:param description: The user-defined description of this VPC. | ||
:type description: Optional[str] | ||
:param subnets: A list of subnets to create under this VPC. | ||
:type subnets: List[Dict[str, Any]] | ||
:returns: The new VPC object. | ||
:rtype: VPC | ||
""" | ||
params = { | ||
"label": label, | ||
"region": region.id if isinstance(region, Region) else region, | ||
} | ||
|
||
if description is not None: | ||
params["description"] = description | ||
|
||
if subnets is not None and len(subnets) > 0: | ||
for subnet in subnets: | ||
if not isinstance(subnet, dict): | ||
raise ValueError( | ||
f"Unsupported type for subnet: {type(subnet)}" | ||
) | ||
|
||
params["subnets"] = subnets | ||
|
||
params.update(kwargs) | ||
|
||
result = self.client.post("/vpcs", data=params) | ||
|
||
if not "id" in result: | ||
raise UnexpectedResponseError( | ||
"Unexpected response when creating VPC", json=result | ||
) | ||
|
||
d = VPC(self.client, result["id"], result) | ||
return d |
Oops, something went wrong.