From 20698e780be7f575b34591461c2c28dccefdd38c Mon Sep 17 00:00:00 2001 From: vshanthe Date: Wed, 20 Dec 2023 10:52:34 +0530 Subject: [PATCH 1/7] added test for linode_type and account_transfer --- .../account/test_account_transfer.py | 24 +++++++++++++++++ tests/integration/linodes/test_types.py | 27 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 tests/integration/account/test_account_transfer.py create mode 100644 tests/integration/linodes/test_types.py diff --git a/tests/integration/account/test_account_transfer.py b/tests/integration/account/test_account_transfer.py new file mode 100644 index 000000000..7afc1fe84 --- /dev/null +++ b/tests/integration/account/test_account_transfer.py @@ -0,0 +1,24 @@ +import os +import subprocess +from typing import List + +env = os.environ.copy() +env["COLUMNS"] = "200" + + +def exec_test_command(args: List[str]): + process = subprocess.run( + args, + stdout=subprocess.PIPE, + env=env, + ) + return process + + +def test_account_transfer(): + process = exec_test_command(["linode-cli", "account", "transfer"]) + output = process.stdout.decode() + print(output) + assert "billable" in output + assert "quota" in output + assert "used" in output diff --git a/tests/integration/linodes/test_types.py b/tests/integration/linodes/test_types.py new file mode 100644 index 000000000..32d0ecf1d --- /dev/null +++ b/tests/integration/linodes/test_types.py @@ -0,0 +1,27 @@ +import os +import subprocess +from typing import List + +env = os.environ.copy() +env["COLUMNS"] = "200" + + +def exec_test_command(args: List[str]): + process = subprocess.run( + args, + stdout=subprocess.PIPE, + env=env, + ) + return process + + +# verifying the DC pricing changes along with types +def test_linode_type(): + process = exec_test_command(["linode-cli", "linodes", "types"]) + output = process.stdout.decode() + print(output) + assert " price.hourly " in output + assert " price.monthly " in output + assert " region_prices " in output + assert " hourly " in output + assert " monthly " in output From 5063f19cd4e01b627b5a8a983c40f219a1a6e652 Mon Sep 17 00:00:00 2001 From: vshanthe Date: Wed, 3 Jan 2024 10:46:58 +0530 Subject: [PATCH 2/7] remove print statment --- tests/integration/account/test_account_transfer.py | 1 - tests/integration/linodes/test_types.py | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/integration/account/test_account_transfer.py b/tests/integration/account/test_account_transfer.py index 7afc1fe84..10b610ca9 100644 --- a/tests/integration/account/test_account_transfer.py +++ b/tests/integration/account/test_account_transfer.py @@ -18,7 +18,6 @@ def exec_test_command(args: List[str]): def test_account_transfer(): process = exec_test_command(["linode-cli", "account", "transfer"]) output = process.stdout.decode() - print(output) assert "billable" in output assert "quota" in output assert "used" in output diff --git a/tests/integration/linodes/test_types.py b/tests/integration/linodes/test_types.py index 32d0ecf1d..79f117730 100644 --- a/tests/integration/linodes/test_types.py +++ b/tests/integration/linodes/test_types.py @@ -19,7 +19,6 @@ def exec_test_command(args: List[str]): def test_linode_type(): process = exec_test_command(["linode-cli", "linodes", "types"]) output = process.stdout.decode() - print(output) assert " price.hourly " in output assert " price.monthly " in output assert " region_prices " in output From 5235119d3969583eb401cb85935182085f1ab718 Mon Sep 17 00:00:00 2001 From: vshanthe Date: Wed, 13 Nov 2024 11:52:13 +0530 Subject: [PATCH 3/7] spec changes --- .github/workflows/e2e-suite.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-suite.yml b/.github/workflows/e2e-suite.yml index 8187c71f5..ba25371ec 100644 --- a/.github/workflows/e2e-suite.yml +++ b/.github/workflows/e2e-suite.yml @@ -17,6 +17,10 @@ on: pull_request_number: description: 'The number of the PR. Ensure sha value is provided' required: false + openapi_spec_url: + description: 'URL of the OpenAPI spec to use for the tests' + required: false + default: '' push: branches: - main @@ -82,8 +86,14 @@ jobs: pip install certifi -U && \ pip install .[obj,dev] + - name: Set OpenAPI Spec URL + if: ${{ inputs.openapi_spec_url != '' }} + run: | + echo "Using OpenAPI Spec URL: ${{ inputs.openapi_spec_url }}" + echo "OPENAPI_SPEC_URL=${{ inputs.openapi_spec_url }}" >> $GITHUB_ENV + - name: Install Package - run: make install + run: make install SPEC="${{ env.OPENAPI_SPEC_URL }}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -95,7 +105,14 @@ jobs: run: | timestamp=$(date +'%Y%m%d%H%M') report_filename="${timestamp}_cli_test_report.xml" - make testint TEST_ARGS="--junitxml=${report_filename}" MODULE="${{ inputs.module }}" + echo "Running tests, report: ${report_filename}" + if [ -n "$OPENAPI_SPEC_URL" ]; then + echo "Running tests with OpenAPI spec from: $OPENAPI_SPEC_URL" + make testint TEST_ARGS="--junitxml=${report_filename}" + else + echo "Running tests with default OpenAPI spec" + make testint TEST_ARGS="--junitxml=${report_filename}" + fi env: LINODE_CLI_TOKEN: ${{ env.LINODE_CLI_TOKEN }} From ea4a9e0a34d188a10b6fd9f70937a0f296ac6757 Mon Sep 17 00:00:00 2001 From: Vinay <143587840+vshanthe@users.noreply.github.com> Date: Mon, 18 Nov 2024 10:23:32 +0530 Subject: [PATCH 4/7] Update e2e-suite.yml --- .github/workflows/e2e-suite.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/e2e-suite.yml b/.github/workflows/e2e-suite.yml index ba25371ec..f27cd6b7d 100644 --- a/.github/workflows/e2e-suite.yml +++ b/.github/workflows/e2e-suite.yml @@ -86,14 +86,8 @@ jobs: pip install certifi -U && \ pip install .[obj,dev] - - name: Set OpenAPI Spec URL - if: ${{ inputs.openapi_spec_url != '' }} - run: | - echo "Using OpenAPI Spec URL: ${{ inputs.openapi_spec_url }}" - echo "OPENAPI_SPEC_URL=${{ inputs.openapi_spec_url }}" >> $GITHUB_ENV - - name: Install Package - run: make install SPEC="${{ env.OPENAPI_SPEC_URL }}" + run: make install SPEC="${{ inputs.OPENAPI_SPEC_URL }}" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -108,7 +102,7 @@ jobs: echo "Running tests, report: ${report_filename}" if [ -n "$OPENAPI_SPEC_URL" ]; then echo "Running tests with OpenAPI spec from: $OPENAPI_SPEC_URL" - make testint TEST_ARGS="--junitxml=${report_filename}" + make testint TEST_ARGS="--junitxml=${report_filename}" MODULE="${{ inputs.module }}" else echo "Running tests with default OpenAPI spec" make testint TEST_ARGS="--junitxml=${report_filename}" @@ -289,4 +283,4 @@ jobs: ] } env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} \ No newline at end of file + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} From 972e5c224ec49478a1055c80f47ae6bd909521d2 Mon Sep 17 00:00:00 2001 From: Vinay <143587840+vshanthe@users.noreply.github.com> Date: Wed, 20 Nov 2024 10:40:10 +0530 Subject: [PATCH 5/7] Update e2e-suite.yml --- .github/workflows/e2e-suite.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/e2e-suite.yml b/.github/workflows/e2e-suite.yml index 447e3ee6f..47ddc3a0d 100644 --- a/.github/workflows/e2e-suite.yml +++ b/.github/workflows/e2e-suite.yml @@ -118,11 +118,9 @@ jobs: report_filename="${timestamp}_cli_test_report.xml" echo "Running tests, report: ${report_filename}" if [ -n "$OPENAPI_SPEC_URL" ]; then - echo "Running tests with OpenAPI spec from: $OPENAPI_SPEC_URL" make testint TEST_ARGS="--junitxml=${report_filename}" MODULE="${{ inputs.module }}" else - echo "Running tests with default OpenAPI spec" - make testint TEST_ARGS="--junitxml=${report_filename}" + make testint TEST_ARGS="--junitxml=${report_filename}"MODULE="${{ inputs.module }}" fi env: LINODE_CLI_TOKEN: ${{ env.LINODE_CLI_TOKEN }} From 706169461bc6d57f12f39464e0ecb5f5d7238289 Mon Sep 17 00:00:00 2001 From: Vinay <143587840+vshanthe@users.noreply.github.com> Date: Wed, 20 Nov 2024 10:52:00 +0530 Subject: [PATCH 6/7] Update e2e-suite.yml --- .github/workflows/e2e-suite.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-suite.yml b/.github/workflows/e2e-suite.yml index 8965508ab..f46eed773 100644 --- a/.github/workflows/e2e-suite.yml +++ b/.github/workflows/e2e-suite.yml @@ -123,7 +123,7 @@ jobs: - name: Run the integration test suite run: | timestamp=$(date +'%Y%m%d%H%M') - report_filename="${timestamp}_cli_test_report.xml + report_filename="${timestamp}_cli_test_report.xml" echo "Running tests, report: ${report_filename}" if [ -n "$OPENAPI_SPEC_URL" ]; then make testint TEST_ARGS="--junitxml=${report_filename}" MODULE="${{ inputs.module }}" From 8d42926fb19812259ca30a02fce28af855bd7cc3 Mon Sep 17 00:00:00 2001 From: ykim-1 Date: Wed, 20 Nov 2024 10:26:03 -0800 Subject: [PATCH 7/7] integration test step clean up --- .github/workflows/e2e-suite.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/e2e-suite.yml b/.github/workflows/e2e-suite.yml index f46eed773..5f16dfb9b 100644 --- a/.github/workflows/e2e-suite.yml +++ b/.github/workflows/e2e-suite.yml @@ -124,12 +124,6 @@ jobs: run: | timestamp=$(date +'%Y%m%d%H%M') report_filename="${timestamp}_cli_test_report.xml" - echo "Running tests, report: ${report_filename}" - if [ -n "$OPENAPI_SPEC_URL" ]; then - make testint TEST_ARGS="--junitxml=${report_filename}" MODULE="${{ inputs.module }}" - else - make testint TEST_ARGS="--junitxml=${report_filename}"MODULE="${{ inputs.module }}" - fi make testint TEST_ARGS="--junitxml=${report_filename}" MODULE="${{ inputs.module }}" RUN_LONG_TESTS="${{ inputs.run_long_tests }}" env: LINODE_CLI_TOKEN: ${{ env.LINODE_CLI_TOKEN }}