Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterate refactor integration tests #338

Merged
merged 11 commits into from
Jan 1, 2024
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
10 changes: 8 additions & 2 deletions .github/workflows/ansible-test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

env:
# NOTE: Yes, the origination is not from a PR :smile: but we do have
# integration tests on PR and we want the cloud resources uniquely named
PR_NUMBER: 0

jobs:
integration:
runs-on: ubuntu-22.04
Expand All @@ -16,6 +21,7 @@ jobs:
name: Integration (Ⓐ${{ matrix.versions.ansible }} on ${{ matrix.versions.python }} / ${{ matrix.module }})
strategy:
fail-fast: false
max-parallel: 1
matrix:
# https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html
versions:
Expand All @@ -33,7 +39,7 @@ jobs:
- digital_ocean_database_info
- digital_ocean_domain
- digital_ocean_domain_info
- digital_ocean_domain_record
# - digital_ocean_domain_record # No test
- digital_ocean_domain_record_info
- digital_ocean_droplet
- digital_ocean_droplet_info
Expand All @@ -47,7 +53,7 @@ jobs:
- digital_ocean_load_balancer
- digital_ocean_load_balancer_info
- digital_ocean_monitoring_alerts
- digital_ocean_monitoring_alerts_info
# - digital_ocean_monitoring_alerts_info # No test
- digital_ocean_project
- digital_ocean_project_info
- digital_ocean_project_resource_info
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/pull-request-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

env:
PR_NUMBER: ${{ github.event.pull_request.number }}

jobs:
test-integration:
runs-on: ubuntu-22.04
Expand All @@ -23,6 +26,7 @@ jobs:
timeout-minutes: 60
strategy:
fail-fast: false
max-parallel: 1
matrix:
versions:
- ansible: stable-2.14
Expand All @@ -39,7 +43,7 @@ jobs:
- digital_ocean_database_info
- digital_ocean_domain
- digital_ocean_domain_info
- digital_ocean_domain_record
# - digital_ocean_domain_record # No test
- digital_ocean_domain_record_info
- digital_ocean_droplet
- digital_ocean_droplet_info
Expand All @@ -53,7 +57,7 @@ jobs:
- digital_ocean_load_balancer
- digital_ocean_load_balancer_info
- digital_ocean_monitoring_alerts
- digital_ocean_monitoring_alerts_info
# - digital_ocean_monitoring_alerts_info # No test
- digital_ocean_project
- digital_ocean_project_info
- digital_ocean_project_resource_info
Expand Down
2 changes: 2 additions & 0 deletions changelogs/fragments/338-refactor-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
trivial:
- ci - refactor integration test workflows (https://github.com/ansible-collections/community.digitalocean/pull/338).
1 change: 1 addition & 0 deletions tests/integration/integration_config.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
do_api_key: ${DO_API_KEY}
aws_access_key_id: ${AWS_ACCESS_KEY_ID}
aws_secret_access_key: ${AWS_SECRET_ACCESS_KEY}
pr_number: ${PR_NUMBER}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
do_region: nyc1
volume_name: gh-ci-volume
volume_name: gh-ci-volume-0-{{ pr_number }}
volume_size: 15
volume_down_size: 10
volume_up_size: 20
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
unsupported
disabled
Original file line number Diff line number Diff line change
@@ -1 +1 @@
unsupported
disabled
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
do_region: nyc1
droplet_name: gh-ci-droplet
droplet_name: gh-ci-droplet-0-{{ pr_number }}
droplet_image: ubuntu-22-04-x64
droplet_size: s-1vcpu-1gb
droplet_new_size: s-1vcpu-2gb
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
do_region: nyc1
droplet_name: gh-ci-droplet
droplet_name: gh-ci-droplet-1-{{ pr_number }}
droplet_image: ubuntu-22-04-x64
droplet_size: s-1vcpu-1gb
project_name: gh-ci-project
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
do_region: nyc1

cluster_name: gh-ci-k8s
cluster_name: gh-ci-k8s-0-{{ pr_number }}
cluster_version: latest
cluster_node_pools:
- name: gh-ci-k8s-workers
- name: gh-ci-k8s-workers-0-{{ pr_number }}
size: s-1vcpu-2gb
count: 1

cluster_ha_name: gh-ci-ha-k8s
cluster_ha_name: gh-ci-ha-k8s-1-{{ pr_number }}
cluster_ha_version: latest
cluster_ha_node_pools:
- name: gh-ci-k8s-ha-workers
- name: gh-ci-k8s-ha-workers-1-{{ pr_number }}
size: s-1vcpu-2gb
count: 3
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
do_region: nyc1

cluster_name: gh-ci-k8s
cluster_name: gh-ci-k8s-2-{{ pr_number }}
cluster_version: latest
cluster_node_pools:
- name: gh-ci-k8s-workers
- name: gh-ci-k8s-workers-2-{{ pr_number }}
size: s-1vcpu-2gb
count: 1
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
register: result
ignore_errors: true # expected to fail

- name: Verify Kubernetes cluster information is not found
- name: Verify Kubernetes cluster information is not changed
ansible.builtin.assert:
that:
- not result.changed
- not result.data.name is defined
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
do_region: nyc1
droplet_name: gh-ci-droplet
droplet_name: gh-ci-droplet-2-{{ pr_number }}
droplet_image: ubuntu-22-04-x64
droplet_size: s-1vcpu-1gb
lb_name: gh-ci-loadbalancer
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
unsupported
disabled
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
do_region: nyc1
droplet_name: gh-ci-droplet
droplet_name: gh-ci-droplet-3-{{ pr_number }}
droplet_image: ubuntu-22-04-x64
droplet_size: s-1vcpu-1gb
alert_email: mamercad@gmail.com
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
disabled
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
do_region: nyc1
droplet_name: gh-ci-droplet
droplet_name: gh-ci-droplet-4-{{ pr_number }}
droplet_image: ubuntu-22-04-x64
droplet_size: s-1vcpu-1gb
snapshot_name: gh-ci-snapshot
volume_name: gh-ci-volume
volume_name: gh-ci-volume-4-{{ pr_number }}
volume_size: 15
volume_down_size: 10
volume_up_size: 20
Loading