diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 4a2360d50..142b2ff84 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -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 @@ -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] diff --git a/test/unit/objects/database_test.py b/test/unit/objects/database_test.py index d5b84cebb..26250b7b2 100644 --- a/test/unit/objects/database_test.py +++ b/test/unit/objects/database_test.py @@ -1,3 +1,4 @@ +import logging from test.unit.base import ClientBaseCase from linode_api4 import PostgreSQLDatabase @@ -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. @@ -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") diff --git a/test/unit/objects/vpc_test.py b/test/unit/objects/vpc_test.py index 4d80716d4..20d36139b 100644 --- a/test/unit/objects/vpc_test.py +++ b/test/unit/objects/vpc_test.py @@ -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"