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

rework s3_bucket and ec2_instance tests to make sure they have the right botocore available for tests needing recent botocore #496

Merged
merged 1 commit into from
Sep 14, 2021
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
6 changes: 4 additions & 2 deletions tests/integration/targets/ec2_instance/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# this just makes sure they're in the right place
dependencies:
- prepare_tests
- setup_ec2_facts
- role: setup_botocore_pip
- role: prepare_tests
- role: setup_ec2_facts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies:
- prepare_tests
- setup_ec2_facts
- role: prepare_tests
- role: setup_ec2_facts
collections:
- amazon.aws
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
- block:
- include_role:
name: setup_botocore_pip
vars:
botocore_version: '1.19.27'

- name: "New instance with an extra block device"
ec2_instance:
state: running
Expand Down Expand Up @@ -93,6 +98,9 @@
instance_type: "{{ ec2_instance_type }}"
wait: true
register: block_device_instances_gp3
# Managing Troughput requires botocore >= 1.19.27
vars:
ansible_python_interpreter: "{{ botocore_virtualenv_interpreter }}"

- assert:
that:
Expand Down
5 changes: 2 additions & 3 deletions tests/integration/targets/s3_bucket/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
dependencies:
- prepare_tests
- setup_ec2
- setup_remote_tmp_dir
- role: prepare_tests
- role: setup_botocore_pip
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
dependencies:
- prepare_tests
- setup_ec2
- setup_remote_tmp_dir
- role: prepare_tests
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,15 @@
security_token: "{{ security_token | default(omit) }}"
region: "{{ aws_region }}"
block:
- pip:
name: virtualenv
- set_fact:
virtualenv: "{{ remote_tmp_dir }}/virtualenv"
virtualenv_command: "{{ ansible_python_interpreter }} -m virtualenv"
- set_fact:
virtualenv_interpreter: "{{ virtualenv }}/bin/python"
- pip:
name:
- 'boto3>=1.13.0'
- 'botocore==1.18.11'
- 'coverage<5'
virtualenv: '{{ virtualenv }}'
virtualenv_command: '{{ virtualenv_command }}'
virtualenv_site_packages: no
- include_role:
name: setup_botocore_pip
vars:
botocore_version: '1.18.11'

# ============================================================
- name: Wrap test in virtualenv
vars:
ansible_python_interpreter: "{{ virtualenv }}/bin/python"
ansible_python_interpreter: "{{ botocore_virtualenv_interpreter }}"
block:
- set_fact:
local_bucket_name: "{{ bucket_name | hash('md5')}}ownership"
Expand Down Expand Up @@ -136,7 +125,3 @@
name: '{{ local_bucket_name }}'
state: absent
ignore_errors: yes

- file:
path: "{{ virtualenv }}"
state: absent