d40f5d3089
This adds upgrade testing from our current Gerrit version (3.5) to the likely future version of our next upgrade (3.6). To do so we have to refactor the gerrit testing becase the 3.5 to 3.6 upgrade requires we run a command against 3.5. The previous upgrade system assumed the old version could be left alone and jumped straight into the upgrade finally testing the end state. Now we have split up the gerrit bootstrapping and gerrit testing so that normal gerrit testing and upgrade testing can run these different tasks at different points in the gerrit deployment process. Now the upgrade tests use the bootstrapping playbook to create users, projects, and changes on the old version of gerrit before running the copy-approvals command. Then after the upgrade we run the test assertion portion of the job. Change-Id: Id58b27e6f717f794a8ef7a048eec7fbb3bc52af6
67 lines
1.8 KiB
YAML
67 lines
1.8 KiB
YAML
- hosts: "review"
|
|
tasks:
|
|
- name: Run selenium container
|
|
include_role:
|
|
name: run-selenium
|
|
|
|
# Get the group info so that we can check group UUIDs don't change when
|
|
# groups are renamed.
|
|
- name: Get group UUID
|
|
uri:
|
|
url: 'http://localhost:8081/a/groups/CI-tools'
|
|
method: GET
|
|
user: admin
|
|
password: secret
|
|
status_code: 200
|
|
return_content: yes
|
|
register: group_raw
|
|
|
|
- name: Debug serialized json
|
|
debug:
|
|
var: group_raw
|
|
|
|
- name: Deserialize returned data to internal variable.
|
|
set_fact:
|
|
# The first 4 bytes of the returned data are )]}' which is
|
|
# invalid json.
|
|
group_json: '{{ group_raw.content | regex_replace("^....", "") | from_json }}'
|
|
|
|
- name: Debug deserialized json
|
|
debug:
|
|
var: group_json
|
|
|
|
- name: Run rename playbook
|
|
import_playbook: ../rename_repos.yaml
|
|
vars:
|
|
repolist: /home/zuul/src/opendev.org/opendev/system-config/playbooks/zuul/test_gerrit_renames.yaml
|
|
|
|
- hosts: "review"
|
|
tasks:
|
|
- name: Get group UUID of renamed group
|
|
uri:
|
|
url: 'http://localhost:8081/a/groups/CI-tools-updated'
|
|
method: GET
|
|
user: admin
|
|
password: secret
|
|
status_code: 200
|
|
return_content: yes
|
|
register: group_renamed_raw
|
|
|
|
- name: Debug serialized json
|
|
debug:
|
|
var: group_renamed_raw
|
|
|
|
- name: Deserialize returned data to internal variable.
|
|
set_fact:
|
|
# The first 4 bytes of the returned data are )]}' which is
|
|
# invalid json.
|
|
group_renamed_json: '{{ group_renamed_raw.content | regex_replace("^....", "") | from_json }}'
|
|
|
|
- name: Debug deserialized json
|
|
debug:
|
|
var: group_renamed_json
|
|
|
|
- name: Check renamed UUID is consistent
|
|
assert:
|
|
that: group_renamed_json['id'] == group_json['id']
|