k3s-ansible icon indicating copy to clipboard operation
k3s-ansible copied to clipboard

WIP: add tests

Open edenreich opened this issue 4 years ago • 5 comments

This pull request is still ongoing and related to #13

There is probably a better way to structure molecule tests (I'm a bit new to molecule) One thing I've noticed is that idempotence test is failing because we're deleting the downloaded binary everytime.

Feel free to add on this or restructure it :)

edenreich avatar Jun 20 '20 22:06 edenreich

Nice, definitely a step in the right direction

St0rmingBr4in avatar Jun 20 '20 22:06 St0rmingBr4in

I've found that we're missing selinux-policy and libselinux-python yum packages on centos, but maybe it's just the docker image so I'm not entirely sure, because I've read somewhere it should come preinstalled

edenreich avatar Jun 20 '20 23:06 edenreich

Struggling to include roles from a different directory on a molecule test. any ideas ? I'm trying to include k3s/master and k3s/node in k3s role.

I've tried import_tasks, import_playbooks, but then it yells at me that it cannot find jinja template :S

Wish it was simple as just giving it a path attribute (unfortunately it's not the case):

- name: Include master
  include_role:
    name: master
    path: master

edenreich avatar Jun 21 '20 13:06 edenreich

I will look into this, I think we need to get this working. It will catch a lot of little mistakes that inadvertently get merged.

St0rmingBr4in avatar Jul 24 '20 09:07 St0rmingBr4in

I also building my own molecule test have with follow coverage playbook

---
- name: Converge
  vars:
    ansible_user: ansible
  ansible.builtin.import_playbook: ./../../site.yml

have follow error when run the molecule test

 UNREACHABLE! => {"changed": false, "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo ~/.ansible/tmp `\"&& mkdir \"` echo ~/.ansible/tmp/ansible-tmp-1614678369.911774-14191-28401085203069 `\" && echo ansible-tmp-1614678369.911774-14191-28401085203069=\"` echo ~/.ansible/tmp/ansible-tmp-1614678369.911774-14191-28401085203069 `\" ), exited with result 1", "unreachable": true}

I want to know how to fix it? I using image jeff geerling will little modification

FinalDes avatar Mar 02 '21 11:03 FinalDes

Closing as out of date. Leaving the Issue open for a new push to add CI.

dereknola avatar Nov 13 '23 19:11 dereknola