Run actual full project creation in gitea test

Add the full remote_puppet_git playbook that we actually use in
production so that we can test the whole kit and caboodle. For
now don't add a review.o.o server to the mix, because we aren't
testing anything about it.

Change-Id: If1112a363e96148c06f8edf1e3adeaa45fc7271c
This commit is contained in:
Monty Taylor 2019-07-11 10:23:41 -04:00 committed by James E. Blair
parent f9358173a3
commit 5c6b3411b7
5 changed files with 14 additions and 41 deletions

View File

@ -614,6 +614,7 @@
description: |
Run the playbook for the gitea servers.
dependencies: opendev-buildset-registry
timeout: 3600
nodeset:
nodes:
- name: bridge.openstack.org
@ -625,6 +626,7 @@
vars:
run_playbooks:
- playbooks/service-gitea-lb.yaml
- playbooks/remote_puppet_git.yaml
run_test_playbook: playbooks/test-gitea.yaml
host-vars:
gitea01.opendev.org:

View File

@ -27,8 +27,7 @@
strategy: free
max_fail_percentage: 1
roles:
- role: gitea-git-repos
project_config_ref: "{{ hostvars.localhost.gitinfo.after }}"
- gitea-git-repos
- hosts: "review:!disabled"
name: "Puppet-git: Run puppet on the Gerrit server"

View File

@ -14,6 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import datetime
import time
import requests
import urllib.parse
@ -38,7 +39,8 @@ class Gitea(object):
self._log = []
def log(self, *args):
self._log.append(" ".join(args))
now = datetime.datetime.utcnow().isoformat()
self._log.append(" ".join((now,) + args))
def get_log(self):
return "\n".join(self._log)

View File

@ -32,15 +32,11 @@
template:
src: app.ini.j2
dest: /var/gitea/conf/app.ini
- name: Install requests
package:
name:
- python3-requests
state: present
- name: Install docker-compose
- name: Install distro packages
package:
name:
- docker-compose
- python3-requests
state: present
- name: Run docker-compose pull
shell:

View File

@ -1,38 +1,12 @@
- hosts: "localhost"
name: "Setup test project data"
vars:
projects:
- project: opendev/base-jobs
description: Zuul configuration common to all OpenDev tenants
tasks:
- name: Create test project-config directory
file:
path: "/opt/project-config/gerrit/"
state: directory
- name: Write test project configuration
copy:
dest: "/opt/project-config/gerrit/projects.yaml"
content: "{{ projects }}"
# TODO(mordred) This should be part of the service, once we refactor
# the project creation and are running remote_puppet_git.
- hosts: "gitea"
name: "Install and configure gitea"
roles:
- install-docker
- gitea
- hosts: "gitea"
name: "Create repos on gitea servers"
strategy: free
max_fail_percentage: 1
roles:
- role: gitea-git-repos
- hosts: "gitea"
tasks:
- name: Test project was created in gitea
- 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