From 79dd9689efca7e13de99fdc4245ce142ba97ac66 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 08:58:55 -0800 Subject: [PATCH 1/8] build(deps): bump slackapi/slack-github-action from 1.27.0 to 2.0.0 (#623) Bumps [slackapi/slack-github-action](https://github.com/slackapi/slack-github-action) from 1.27.0 to 2.0.0. - [Release notes](https://github.com/slackapi/slack-github-action/releases) - [Commits](https://github.com/slackapi/slack-github-action/compare/v1.27.0...v2.0.0) --- updated-dependencies: - dependency-name: slackapi/slack-github-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/integration-tests.yml | 2 +- .github/workflows/release-notify-slack.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 986d9746..3fb63354 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -194,7 +194,7 @@ jobs: steps: - name: Notify Slack - uses: slackapi/slack-github-action@v1.27.0 + uses: slackapi/slack-github-action@v2.0.0 with: channel-id: ${{ secrets.SLACK_CHANNEL_ID }} payload: | diff --git a/.github/workflows/release-notify-slack.yml b/.github/workflows/release-notify-slack.yml index 59a1f252..99b669c2 100644 --- a/.github/workflows/release-notify-slack.yml +++ b/.github/workflows/release-notify-slack.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Notify Slack - Main Message id: main_message - uses: slackapi/slack-github-action@v1.27.0 + uses: slackapi/slack-github-action@v2.0.0 with: channel-id: ${{ secrets.DEV_DX_SLACK_CHANNEL_ID }} payload: | @@ -30,7 +30,7 @@ jobs: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - name: Notify Slack - Threaded Release Notes - uses: slackapi/slack-github-action@v1.27.0 + uses: slackapi/slack-github-action@v2.0.0 with: channel-id: ${{ secrets.DEV_DX_SLACK_CHANNEL_ID }} payload: | From e3d2cd85d88ecb8955be16acb679f95c4c9c1b0d Mon Sep 17 00:00:00 2001 From: Youjung Kim <126618609+ykim-akamai@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:07:52 -0800 Subject: [PATCH 2/8] ci: update slack release message (#622) * clean up slack payload * update slack payload for v2.0.0 * update slack payload for v2.0.0 --- .github/workflows/integration-tests.yml | 81 +++++++--------------- .github/workflows/release-notify-slack.yml | 34 +++------ 2 files changed, 34 insertions(+), 81 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 3fb63354..49fbfb0b 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -196,59 +196,30 @@ jobs: - name: Notify Slack uses: slackapi/slack-github-action@v2.0.0 with: - channel-id: ${{ secrets.SLACK_CHANNEL_ID }} + method: chat.postMessage + token: ${{ secrets.SLACK_BOT_TOKEN }} payload: | - { - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:" - } - }, - { - "type": "divider" - }, - { - "type": "section", - "fields": [ - { - "type": "mrkdwn", - "text": "*Build Result:*\n${{ needs.integration-tests.result == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}" - }, - { - "type": "mrkdwn", - "text": "*Branch:*\n`${{ github.ref_name }}`" - } - ] - }, - { - "type": "section", - "fields": [ - { - "type": "mrkdwn", - "text": "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>" - }, - { - "type": "mrkdwn", - "text": "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>" - } - ] - }, - { - "type": "divider" - }, - { - "type": "context", - "elements": [ - { - "type": "mrkdwn", - "text": "Triggered by: :bust_in_silhouette: `${{ github.actor }}`" - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} \ No newline at end of file + channel: ${{ secrets.SLACK_CHANNEL_ID }} + blocks: + - type: section + text: + type: mrkdwn + text: ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:" + - type: divider + - type: section + fields: + - type: mrkdwn + text: "*Build Result:*\n${{ needs.integration-tests.result == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}" + - type: mrkdwn + text: "*Branch:*\n`${{ github.ref_name }}`" + - type: section + fields: + - type: mrkdwn + text: "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>" + - type: mrkdwn + text: "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>" + - type: divider + - type: context + elements: + - type: mrkdwn + text: "Triggered by: :bust_in_silhouette: `${{ github.actor }}`" \ No newline at end of file diff --git a/.github/workflows/release-notify-slack.yml b/.github/workflows/release-notify-slack.yml index 99b669c2..d3f53cd0 100644 --- a/.github/workflows/release-notify-slack.yml +++ b/.github/workflows/release-notify-slack.yml @@ -13,30 +13,12 @@ jobs: id: main_message uses: slackapi/slack-github-action@v2.0.0 with: - channel-id: ${{ secrets.DEV_DX_SLACK_CHANNEL_ID }} + method: chat.postMessage + token: ${{ secrets.SLACK_BOT_TOKEN }} payload: | - { - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*New Release Published: _ansible_linode_ - ${{ github.event.release.tag_name }} is now live!* :tada:" - } - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - - - name: Notify Slack - Threaded Release Notes - uses: slackapi/slack-github-action@v2.0.0 - with: - channel-id: ${{ secrets.DEV_DX_SLACK_CHANNEL_ID }} - payload: | - { - "thread_ts": "${{ steps.main_message.outputs.ts }}", - "text": "*<${{ github.event.release.html_url }}| ${{ github.event.release.tag_name }} Release notes>*" - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + channel: ${{ secrets.DEV_DX_SLACK_CHANNEL_ID }} + blocks: + - type: section + text: + type: mrkdwn + text: "*New Release Published: _ansible_linode_ <${{ github.event.release.html_url }}|${{ github.event.release.tag_name }}> is now live!* :tada:" From f26d3a571bbeda2e82a5c29edae58f4810802984 Mon Sep 17 00:00:00 2001 From: Lena Garber <114949949+lgarber-akamai@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:34:34 -0500 Subject: [PATCH 3/8] Use linode_api4 API error handling logic; remove format_api_error(...) helper (#624) * Use linode_api4 API error handling logic; remove format_api_error(...) helper * Pin docs Python version --- .github/workflows/docs.yml | 2 +- Makefile | 2 +- plugins/module_utils/linode_common.py | 3 +-- plugins/module_utils/linode_helper.py | 7 ------ requirements.txt | 2 +- .../targets/api_error/tasks/main.yaml | 24 +++++++++++++++++++ 6 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 tests/integration/targets/api_error/tasks/main.yaml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f99fc390..9f264800 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -66,7 +66,7 @@ jobs: - name: setup python 3 uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: '3.10' - name: install dependencies run: make deps diff --git a/Makefile b/Makefile index a5d6dcf2..60e3a4c3 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ install: build ansible-galaxy collection install *.tar.gz --force -p $(COLLECTIONS_PATH) deps: - pip install -r requirements.txt -r requirements-dev.txt --upgrade + pip install -r requirements.txt -r requirements-dev.txt --force lint: pylint plugins diff --git a/plugins/module_utils/linode_common.py b/plugins/module_utils/linode_common.py index b05dfc95..d5f35f3a 100644 --- a/plugins/module_utils/linode_common.py +++ b/plugins/module_utils/linode_common.py @@ -7,7 +7,6 @@ import polling from ansible_collections.linode.cloud.plugins.module_utils.linode_helper import ( - format_api_error, format_generic_error, ) @@ -159,7 +158,7 @@ def __init__( res = self.exec_module(**self.module.params) except ApiError as err: # We don't want to return a stack trace for an API error - self.fail(msg=format_api_error(err)) + self.fail(msg=f"Error from Linode API: {str(err)}") except polling.TimeoutException as err: self.fail( msg="failed to wait for condition: timeout period expired" diff --git a/plugins/module_utils/linode_helper.py b/plugins/module_utils/linode_helper.py index f2d69ed4..0429881b 100644 --- a/plugins/module_utils/linode_helper.py +++ b/plugins/module_utils/linode_helper.py @@ -5,7 +5,6 @@ import linode_api4 import polling from linode_api4 import ( - ApiError, LinodeClient, LKENodePool, LKENodePoolNode, @@ -329,12 +328,6 @@ def get_all_paginated( return result -def format_api_error(err: ApiError) -> str: - """Formats an API error into a readable string""" - - return f"Error from Linode API: [{err.status}] {';'.join(err.errors)}" - - def format_generic_error(err: Exception) -> str: """Formats a generic error into a readable string""" diff --git a/requirements.txt b/requirements.txt index d1030e00..3490bb5b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -linode-api4>=5.22.0 +linode-api4>=5.24.0 polling==0.3.2 ansible-specdoc>=0.0.15 diff --git a/tests/integration/targets/api_error/tasks/main.yaml b/tests/integration/targets/api_error/tasks/main.yaml new file mode 100644 index 00000000..afeb74b7 --- /dev/null +++ b/tests/integration/targets/api_error/tasks/main.yaml @@ -0,0 +1,24 @@ +- name: api_error + block: + - name: Attempt to create an instance with validation errors + linode.cloud.instance: + region: fake-region + type: g6-fake-plan + state: present + register: failing_request + failed_when: '"msg" not in failing_request' + + - name: Ensure the error message is formatted as expected + assert: + that: + - failing_request.changed == False + - 'failing_request.msg.startswith("Error from Linode API: POST /v4beta/linode/instances: [400]")' + - '"type: A valid plan type by that ID was not found" in failing_request.msg' + - '"region: region is not valid" in failing_request.msg' + + environment: + LINODE_UA_PREFIX: '{{ ua_prefix }}' + LINODE_API_TOKEN: '{{ api_token }}' + LINODE_API_URL: '{{ api_url }}' + LINODE_API_VERSION: '{{ api_version }}' + LINODE_CA: '{{ ca_file or "" }}' From 3b07f45e98fcb19cbd565595018512f4b5016466 Mon Sep 17 00:00:00 2001 From: Lena Garber <114949949+lgarber-akamai@users.noreply.github.com> Date: Mon, 25 Nov 2024 13:54:20 -0500 Subject: [PATCH 4/8] Pin Python version in docs YAML (#625) --- .github/workflows/docs.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9f264800..754d0506 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,6 +2,9 @@ name: Run Documentation Validation on: pull_request +env: + DEFAULT_PYTHON_VERSION: "3.10" + jobs: test-templated-docs: runs-on: ubuntu-latest @@ -66,7 +69,7 @@ jobs: - name: setup python 3 uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: ${{ env.DEFAULT_PYTHON_VERSION }} - name: install dependencies run: make deps From 101c394cfc62733fcb9777c362c4d338f1623ef4 Mon Sep 17 00:00:00 2001 From: Erik Zilber Date: Wed, 4 Dec 2024 16:04:41 -0500 Subject: [PATCH 5/8] Added support for the authorized users field on the instance module (#627) --- docs/modules/instance.md | 1 + plugins/modules/instance.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/docs/modules/instance.md b/docs/modules/instance.md index 2ba7737b..0630b91f 100644 --- a/docs/modules/instance.md +++ b/docs/modules/instance.md @@ -127,6 +127,7 @@ Manage Linode Instances, Configs, and Disks. | `region` |
`str`
|
Optional
| The location to deploy the instance in. See the [Linode API documentation](https://api.linode.com/v4/regions). | | `image` |
`str`
|
Optional
| The image ID to deploy the instance disk from. **(Conflicts With: `disks`,`configs`)** | | `authorized_keys` |
`list`
|
Optional
| A list of SSH public key parts to deploy for the root user. | +| `authorized_users` |
`list`
|
Optional
| A list of usernames. | | `root_pass` |
`str`
|
Optional
| The password for the root user. If not specified, one will be generated. This generated password will be available in the task success JSON. | | `stackscript_id` |
`int`
|
Optional
| The ID of the StackScript to use when creating the instance. See the [Linode API documentation](https://techdocs.akamai.com/linode-api/reference/get-stack-scripts). | | `stackscript_data` |
`dict`
|
Optional
| An object containing arguments to any User Defined Fields present in the StackScript used when creating the instance. Only valid when a stackscript_id is provided. See the [Linode API documentation](https://techdocs.akamai.com/linode-api/reference/get-stack-scripts). | diff --git a/plugins/modules/instance.py b/plugins/modules/instance.py index 3a7d5cda..da097020 100644 --- a/plugins/modules/instance.py +++ b/plugins/modules/instance.py @@ -351,6 +351,11 @@ "A list of SSH public key parts to deploy for the root user." ], ), + "authorized_users": SpecField( + type=FieldType.list, + element_type=FieldType.string, + description=["A list of usernames."], + ), "root_pass": SpecField( type=FieldType.string, no_log=True, From 4fca8a65a72803e39aa10c794d571db67553b344 Mon Sep 17 00:00:00 2001 From: Ye Chen <127243817+yec-akamai@users.noreply.github.com> Date: Fri, 6 Dec 2024 13:02:16 -0500 Subject: [PATCH 6/8] doc: Remove Image Services Gen2 LA notice (#626) * rm la * gendocs * docs --- docs/inventory/instance.rst | 16 ++++++++-------- docs/modules/image.md | 2 +- plugins/modules/image.py | 3 +-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/docs/inventory/instance.rst b/docs/inventory/instance.rst index 18445b50..c4f28a31 100644 --- a/docs/inventory/instance.rst +++ b/docs/inventory/instance.rst @@ -76,19 +76,19 @@ Parameters **parent_group (type=str):** - \• parent group for keyed group + \• parent group for keyed group. **prefix (type=str):** - \• A keyed group name will start with this prefix + \• A keyed group name will start with this prefix. **separator (type=str, default=_):** - \• separator used to build the keyed group name + \• separator used to build the keyed group name. **key (type=str):** - \• The key from input dictionary used to generate groups + \• The key from input dictionary used to generate groups. **default_value (type=str):** @@ -98,7 +98,7 @@ Parameters **trailing_separator (type=bool, default=True):** - \• Set this option to :literal:`False` to omit the :literal:`keyed\_groups[].separator` after the host variable when the value is an empty string. + \• Set this option to :literal:`false` to omit the :literal:`keyed\_groups[].separator` after the host variable when the value is an empty string. \• This option is mutually exclusive with :literal:`keyed\_groups[].default\_value`. @@ -109,13 +109,13 @@ Parameters **leading_separator (type=boolean, default=True):** - \• Use in conjunction with keyed\_groups. + \• Use in conjunction with :literal:`keyed\_groups`. \• By default, a keyed group that does not have a prefix or a separator provided will have a name that starts with an underscore. - \• This is because the default prefix is "" and the default separator is "\_". + \• This is because the default prefix is :literal:`""` and the default separator is :literal:`"\_"`. - \• Set this option to False to omit the leading underscore (or other separator) if no prefix is given. + \• Set this option to :literal:`false` to omit the leading underscore (or other separator) if no prefix is given. \• If the group name is derived from a mapping the separator is still used to concatenate the items. diff --git a/docs/modules/image.md b/docs/modules/image.md index 9b13dc08..d16b3835 100644 --- a/docs/modules/image.md +++ b/docs/modules/image.md @@ -73,7 +73,7 @@ Manage a Linode Image. | `wait` |
`bool`
|
Optional
| Wait for the image to have status `available` before returning. **(Default: `True`)** | | `wait_timeout` |
`int`
|
Optional
| The amount of time, in seconds, to wait for an image to have status `available`. **(Default: `600`)** | | `tags` |
`list`
|
Optional
| A list of customized tags of this new Image. **(Updatable)** | -| `replica_regions` |
`list`
|
Optional
| A list of regions that customer wants to replicate this image in. At least one available region must be provided and only core regions allowed. Existing images in the regions not passed will be removed. NOTE: Image replication may not currently be available to all users. **(Updatable)** | +| `replica_regions` |
`list`
|
Optional
| A list of regions that customer wants to replicate this image in. At least one available region must be provided and only core regions allowed. Existing images in the regions not passed will be removed. **(Updatable)** | | `wait_for_replications` |
`bool`
|
Optional
| Wait for the all the replications `available` before returning. **(Default: `False`)** | ## Return Values diff --git a/plugins/modules/image.py b/plugins/modules/image.py index 7a34c7c5..147cd251 100644 --- a/plugins/modules/image.py +++ b/plugins/modules/image.py @@ -103,8 +103,7 @@ description=[ "A list of regions that customer wants to replicate this image in. " "At least one available region must be provided and only core regions allowed. " - "Existing images in the regions not passed will be removed. " - "NOTE: Image replication may not currently be available to all users.", + "Existing images in the regions not passed will be removed. ", ], ), "wait_for_replications": SpecField( From 6adb83fbab381c5ab16f28f8317138cebb8ffaac Mon Sep 17 00:00:00 2001 From: Youjung Kim <126618609+ykim-akamai@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:14:39 -0800 Subject: [PATCH 7/8] test: Add smoke test suite and GHA workflow (#629) * gha test * gha test 2 * gha test 3 * gha test 4 * gha test 4 * add smoke test suite * add smoke test suite --------- Co-authored-by: Ye Chen <127243817+yec-akamai@users.noreply.github.com> --- .github/workflows/nightly-smoke-tests.yml | 88 +++++++++++++++++++++++ Makefile | 5 +- scripts/test_basic_smoke.sh | 29 ++++++++ 3 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/nightly-smoke-tests.yml create mode 100755 scripts/test_basic_smoke.sh diff --git a/.github/workflows/nightly-smoke-tests.yml b/.github/workflows/nightly-smoke-tests.yml new file mode 100644 index 00000000..da150285 --- /dev/null +++ b/.github/workflows/nightly-smoke-tests.yml @@ -0,0 +1,88 @@ +name: Nightly Smoke Tests + +on: + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + inputs: + sha: + description: 'Commit SHA to test' + required: false + default: '' + type: string + +jobs: + smoke_tests: + if: github.repository == 'linode/ansible_linode' || github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + env: + EXIT_STATUS: 0 + defaults: + run: + working-directory: .ansible/collections/ansible_collections/linode/cloud + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + path: .ansible/collections/ansible_collections/linode/cloud + fetch-depth: 0 + submodules: 'recursive' + + - name: Update packages + run: sudo apt-get update -y + + - name: Setup Python 3 + uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.run-eol-python-version == 'true' && env.EOL_PYTHON_VERSION || inputs.python-version || env.DEFAULT_PYTHON_VERSION }} + + - name: Install dependencies + run: make deps + + - name: Install ansible dependencies + run: ansible-galaxy collection install amazon.aws:==6.0.1 + + - name: Install Collection + run: make install + + - name: Replace Existing Keys + run: rm -rf ~/.ansible/test && mkdir -p ~/.ansible/test && ssh-keygen -m PEM -q -t rsa -N '' -f ~/.ansible/test/id_rsa + + - name: Run smoke tests + id: smoke_tests + run: | + make smoketest + env: + LINODE_API_TOKEN: ${{ secrets.DX_LINODE_TOKEN }} + + - name: Notify Slack + if: (success() || failure()) && github.repository == 'linode/ansible_linode' + uses: slackapi/slack-github-action@v2.0.0 + with: + method: chat.postMessage + token: ${{ secrets.SLACK_BOT_TOKEN }} + payload: | + channel: ${{ secrets.SLACK_CHANNEL_ID }} + blocks: + - type: section + text: + type: mrkdwn + text: ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:" + - type: divider + - type: section + fields: + - type: mrkdwn + text: "*Build Result:*\n${{ steps.smoke_tests.outcome == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}" + - type: mrkdwn + text: "*Branch:*\n`${{ github.ref_name }}`" + - type: section + fields: + - type: mrkdwn + text: "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>" + - type: mrkdwn + text: "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>" + - type: divider + - type: context + elements: + - type: mrkdwn + text: "Triggered by: :bust_in_silhouette: `${{ github.actor }}`" \ No newline at end of file diff --git a/Makefile b/Makefile index 60e3a4c3..7adcf5cc 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ delete-e2e-firewall: update-test-submodules echo "$$OUTPUT"; \ exit 1; \ else \ - echo "E2E Cloud firewall created successfully."; \ + echo "E2E Cloud firewall deleted successfully."; \ fi update-test-submodules: @@ -102,6 +102,9 @@ test: integration-test testall: ./scripts/test_all.sh +smoketest: + ./scripts/test_basic_smoke.sh + unittest: ansible-test units --target-python default diff --git a/scripts/test_basic_smoke.sh b/scripts/test_basic_smoke.sh new file mode 100755 index 00000000..8ace65bd --- /dev/null +++ b/scripts/test_basic_smoke.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +PARALLEL_JOBS="${PARALLEL_JOBS:=3}" + +run_test() { + ansible-test integration $1 +} + +cleanup() { + if [[ -z "$CLEANUP_DONE" ]]; then + make delete-e2e-firewall + CLEANUP_DONE=1 + fi +} + +trap cleanup EXIT + +CLEANUP_DONE=0 + +make create-integration-config || exit 1 +make create-e2e-firewall || exit 1 + +export -f run_test + +parallel -j $PARALLEL_JOBS --group --keep-order --retries 3 run_test ::: $(ls tests/integration/targets | grep _basic) +TEST_EXIT_CODE=$? + + +exit $TEST_EXIT_CODE \ No newline at end of file From 9729ec729c2e014bd7069a417c4c1fadd22665c9 Mon Sep 17 00:00:00 2001 From: Youjung Kim <126618609+ykim-akamai@users.noreply.github.com> Date: Mon, 9 Dec 2024 11:23:28 -0800 Subject: [PATCH 8/8] test: Update instance_inventory test assertions (#631) * gha test * gha test 2 * gha test 3 * gha test 4 * gha test 4 * add smoke test suite * Update assertions --- .../instance_inventory/playbooks/test_inventory_filter.yml | 2 +- .../playbooks/test_inventory_templatetoken.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/targets/instance_inventory/playbooks/test_inventory_filter.yml b/tests/integration/targets/instance_inventory/playbooks/test_inventory_filter.yml index e359b26b..67b08fcd 100644 --- a/tests/integration/targets/instance_inventory/playbooks/test_inventory_filter.yml +++ b/tests/integration/targets/instance_inventory/playbooks/test_inventory_filter.yml @@ -9,7 +9,7 @@ assert: that: - '"ansible-test-inventory" in hostvars' - - hostvars | length == 1 + - hostvars | length > 0 - '"networking_info" in hostvars["ansible-test-inventory"]' - '"ipv4" in hostvars["ansible-test-inventory"]["networking_info"]' - '"ipv6" in hostvars["ansible-test-inventory"]["networking_info"]' \ No newline at end of file diff --git a/tests/integration/targets/instance_inventory/playbooks/test_inventory_templatetoken.yml b/tests/integration/targets/instance_inventory/playbooks/test_inventory_templatetoken.yml index 9e9924d1..45aac365 100644 --- a/tests/integration/targets/instance_inventory/playbooks/test_inventory_templatetoken.yml +++ b/tests/integration/targets/instance_inventory/playbooks/test_inventory_templatetoken.yml @@ -9,4 +9,4 @@ assert: that: - '"ansible-test-inventory" in hostvars' - - hostvars | length == 1 \ No newline at end of file + - hostvars | length > 0 \ No newline at end of file