system-config/playbooks/test-gitea.yaml
Clark Boylan d504604b0c Test the rename_repos playbook
It would be useful to test our rename playbook against gitea and gerrit
when we make changes to these related playbooks, roles, and docker
images. To do this we need to converge our test and production setups
for gerrit a bit more. We create an openstack-project-creator account in
the test gerrit to match prod and we have rename_repos.yaml talk to
localhost for gerrit ssh commands.

With that done we can run the rename_repos.yaml playbook from
test-gitea.yaml and test-gerrit.yaml to help ensure the playbook
functions as expected against these services.

Co-Authored-By: Ian Wienand <iwienand@redhat.com>
Change-Id: I49ffaf86828e87705da303f40ad4a86be030c709
2021-07-28 08:33:55 -07:00

37 lines
1.3 KiB
YAML

- hosts: "gitea"
tasks:
- name: Test base jobs project was created in gitea
uri:
url: "https://localhost:3000/opendev/base-jobs"
validate_certs: false
status_code: 200
- name: Test zuul project was created in gitea
uri:
url: "https://localhost:3000/zuul/zuul"
validate_certs: false
status_code: 200
return_content: yes
register: zuul_content
- name: Assert description updated
fail:
msg: Zuul description was not updated
when: '"Zuuls new description" not in zuul_content.content'
- name: Push system-config into our test gitea for testing
shell: |
cd /home/zuul/src/opendev.org/opendev/system-config
git remote add test-gitea https://gerrit:{{ gitea_gerrit_password }}@localhost:3000/opendev/system-config
GIT_SSL_NO_VERIFY=1 git push -f test-gitea master
- name: Run rename playbook
import_playbook: rename_repos.yaml
vars:
repolist: /home/zuul/src/opendev.org/opendev/system-config/playbooks/zuul/test_gitea_renames.yaml
# This is conveniently left here so that it can be uncommented in order to
# autohold the system-config-run-gitea job in zuul.
#- hosts: bridge.openstack.org
# tasks:
# - name: Force a failure for human intervention
# fail:
# msg: Failing so that we can check on things with a hold