redhat-cop / openshift-applier

Used to apply OpenShift objects to an OpenShift Cluster
Apache License 2.0
102 stars 61 forks source link

Adding tests for processing OpenShift Templates #101

Closed oybed closed 5 years ago

oybed commented 5 years ago

What does this PR do?

Adding in tests for testing using pre-existing OpenShift templates already loaded in the cluster.

How should this be tested?

See README -run the tests per the instructions

Is there a relevant Issue open for this?

not really, but mentioned in #91

Who would you like to review this?

cc: @redhat-cop/openshift-applier @etsauer

etsauer commented 5 years ago

@oybed I think before we add more tests to our /tests directory, we need to figure out how to get molecule to actually run them. Right now our CI only actually runs the multi-files-dir inventory, so the rest of these aren't really adding value to the repo.

oybed commented 5 years ago

@etsauer I don't see why that would holding up adding more tests. I run these manually all the time, so would really like to get them in.

Also, there's an open issue already for enhancing the automated testing to run them all. https://github.com/redhat-cop/openshift-applier/issues/85

etsauer commented 5 years ago

@oybed ok, thats fair. I'll take on the molecule enhancements. For now, I've run through the test, and I think getting the behavior we should be expecting, based on #91

TASK [openshift-applier : Determine location for the file] ********************************************************************************************************************************************************
Friday 01 February 2019  12:42:24 -0500 (0:00:00.071)       0:00:06.121 ******* 
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: IOError: [Errno 2] No such file or directory: 'openshift//httpd-example'
fatal: [localhost]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}

PLAY RECAP ********************************************************************************************************************************************************************************************************
localhost                  : ok=32   changed=2    unreachable=0    failed=1   

Should I go ahead and merge?

oybed commented 5 years ago

@etsauer yes, please merge.

I'm glad you were able to reproduce the issue - I am not. Using Ansible 2.7.5 and python 2.7.15 these tests work fine. Which versions are you on that makes it fail?

etsauer commented 5 years ago
$ ansible --version
ansible 2.7.6
  config file = /home/esauer/src/openshift-applier/ansible.cfg
  configured module search path = [u'/home/esauer/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/esauer/.local/lib/python2.7/site-packages/ansible
  executable location = /home/esauer/.local/bin/ansible
  python version = 2.7.15 (default, Oct 15 2018, 15:26:09) [GCC 8.2.1 20180801 (Red Hat 8.2.1-2)]