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

toxification of functional tests #456

Merged
merged 4 commits into from Jan 12, 2017
Merged

toxification of functional tests #456

merged 4 commits into from Jan 12, 2017

Conversation

alfredodeza
Copy link
Contributor

This is an initial take on harnessing the functional testing from ceph-ansible in ceph-docker.

This will greatly simplify the setup, validation, and teardown of the environment since ceph-ansible already has a way to do all those, including the needed support for docker itself.

For this to work it will need ceph-ansible changes to allow consuming a dev image that build_imgs.sh will create, and changes to ceph-build to call tox

Signed-off-by: Alfredo Deza <adeza@redhat.com>
vagrant up --no-provision --provider=$VAGRANT_PROVIDER
bash $TOXINIDIR/tests/scripts/generate_ssh_config.sh $CEPH_ANSIBLE_SCENARIO_PATH

ansible-playbook -vv -i $CEPH_ANSIBLE_SCENARIO_PATH/hosts $TOXINIDIR/site-docker.yml.sample --extra-vars="fetch_directory=$CEPH_ANSIBLE_SCENARIO_PATH/fetch"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

site-docker.yml.sample is in $CEPH_ANSIBLE_SCENARIO_PATH not $TOXINIDIR


ansible-playbook -vv -i $CEPH_ANSIBLE_SCENARIO_PATH/hosts $TOXINIDIR/site-docker.yml.sample --extra-vars="fetch_directory=$CEPH_ANSIBLE_SCENARIO_PATH/fetch"

ansible-playbook -vv -i $CEPH_ANSIBLE_SCENARIO_PATH/hosts $TOXINIDIR/tests/functional/setup.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue here, incorrect path to setup.yml.


ansible-playbook -vv -i $CEPH_ANSIBLE_SCENARIO_PATH/hosts $TOXINIDIR/tests/functional/setup.yml

testinfra -n 4 --sudo -v --connection=ansible --ansible-inventory=$CEPH_ANSIBLE_SCENARIO_PATH/hosts $TOXINIDIR/tests/functional/tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue here, incorrect path to the tests directory.

# only available for ansible >= 2.2
ANSIBLE_STDOUT_CALLBACK = debug
centos7_cluster: CEPH_ANSIBLE_SCENARIO_PATH = {toxinidir}/ceph-ansible/tests/functional/centos/7/docker-cluster
xenial_cluster: CEPH_ANSIBLE_SCENARIO_PATH = {toxinidir}/ceph-ansible/tests/functional/ubuntu/xenial/docker-cluster
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is not an ubuntu/xenial/docker-cluster testing scenario in ceph-ansible. I'm guessing we'll need to use the same scenario from centos/7/docker-cluster but tell it to use a different image.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, correct. I didn't think it would be an issue to just have it defined already


# vars
#################################################################################
ANSIBLE_SSH_ARGS = -F $CEPH_ANSIBLE_SCENARIO_PATH/vagrant_ssh_config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does ansible actually respect ANSIBLE_SSH_ARGS when it's defined here?

ceph_ansible2.1: CEPH_ANSIBLE_BRANCH = stable-2.1

deps=
ansible==2.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you need to install the test requirements.txt from ceph-ansible here? If not we won't get testinfra installed or pytest. Or I suppose you could just define them here directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't because ceph-ansible is not checked out yet at this point, so that would mean it would need to assume the right dependencies of ceph-ansible, with the possibility of them getting out of sync. That is why the dependencies are installed in tox.sh

Signed-off-by: Alfredo Deza <adeza@redhat.com>
Alfredo Deza added 2 commits January 12, 2017 08:07
Signed-off-by: Alfredo Deza <adeza@redhat.com>
Signed-off-by: Alfredo Deza <adeza@redhat.com>
@andrewschoen
Copy link
Contributor

There is still a bit of work here to have ceph-ansible deploy the images we build as part of the process, but I can take on that work and submit a new PR for it.

@andrewschoen andrewschoen merged commit a8bcf1c into master Jan 12, 2017
@ktdreyer ktdreyer deleted the toxify branch February 9, 2017 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants