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

View File

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

View File

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

View File

@ -32,15 +32,11 @@
template: template:
src: app.ini.j2 src: app.ini.j2
dest: /var/gitea/conf/app.ini dest: /var/gitea/conf/app.ini
- name: Install requests - name: Install distro packages
package:
name:
- python3-requests
state: present
- name: Install docker-compose
package: package:
name: name:
- docker-compose - docker-compose
- python3-requests
state: present state: present
- name: Run docker-compose pull - name: Run docker-compose pull
shell: 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" - hosts: "gitea"
tasks: tasks:
- name: Test project was created in gitea - name: Test base jobs project was created in gitea
uri: uri:
url: "https://localhost:3000/opendev/base-jobs" url: "https://localhost:3000/opendev/base-jobs"
validate_certs: false validate_certs: false
status_code: 200 status_code: 200
- name: Test zuul project was created in gitea
uri:
url: "https://localhost:3000/zuul/zuul"
validate_certs: false
status_code: 200