integration: Use vars_files in plays
It's unsightly and hard to maintain collections of references and long lists across multiple playbooks/include files. Centralize them all in ``vars.yml``, then include that in all plays. Minor: Update all files with a newline at the start and end. Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
parent
a30a118fe6
commit
493a72bbc9
13 changed files with 101 additions and 86 deletions
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
|
||||
- name: clone bats source repo
|
||||
git:
|
||||
repo: "https://github.com/sstephenson/bats.git"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
|
||||
- name: stat the expected cri-o directory
|
||||
stat:
|
||||
path: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
|
||||
- name: clone cri-tools source repo
|
||||
git:
|
||||
repo: "https://github.com/kubernetes-incubator/cri-tools.git"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
|
||||
- name: clone kubernetes source repo
|
||||
git:
|
||||
repo: "https://github.com/runcom/kubernetes.git"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
|
||||
- name: clone plugins source repo
|
||||
git:
|
||||
repo: "https://github.com/containernetworking/plugins.git"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
|
||||
- name: clone runc source repo
|
||||
git:
|
||||
repo: "https://github.com/opencontainers/runc.git"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
|
||||
- name: enable and start CRI-O
|
||||
systemd:
|
||||
name: crio
|
||||
|
@ -31,11 +32,6 @@
|
|||
retries: 100
|
||||
delay: 30
|
||||
|
||||
- name: Buffer location for e2e output and reports
|
||||
set_fact:
|
||||
# N/B: This need manual coordination with results.yml
|
||||
artifacts: "{{ ansible_env.GOPATH }}/src/k8s.io/kubernetes/artifacts"
|
||||
|
||||
- name: ensure directory exists for e2e reports
|
||||
file:
|
||||
path: "{{ artifacts }}"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
|
||||
- name: set up GOPATH if it is not already set
|
||||
lineinfile:
|
||||
dest: /etc/environment
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
- hosts: all
|
||||
remote_user: root
|
||||
vars:
|
||||
xunit: false
|
||||
vars_files:
|
||||
- "{{ playbook_dir }}/vars.yml"
|
||||
tags:
|
||||
- setup
|
||||
tasks:
|
||||
|
@ -28,8 +28,8 @@
|
|||
|
||||
- hosts: all
|
||||
remote_user: root
|
||||
vars:
|
||||
xunit: false
|
||||
vars_files:
|
||||
- "{{ playbook_dir }}/vars.yml"
|
||||
tags:
|
||||
- integration
|
||||
- e2e
|
||||
|
@ -39,8 +39,8 @@
|
|||
|
||||
- hosts: all
|
||||
remote_user: root
|
||||
vars:
|
||||
xunit: false
|
||||
vars_files:
|
||||
- "{{ playbook_dir }}/vars.yml"
|
||||
tags:
|
||||
- integration
|
||||
tasks:
|
||||
|
@ -49,6 +49,8 @@
|
|||
|
||||
- hosts: all
|
||||
remote_user: root
|
||||
vars_files:
|
||||
- "{{ playbook_dir }}/vars.yml"
|
||||
tags:
|
||||
- e2e
|
||||
tasks:
|
||||
|
|
|
@ -2,14 +2,9 @@
|
|||
# vim-syntax: ansible
|
||||
|
||||
- hosts: '{{ hosts | default("all") }}'
|
||||
vars_files:
|
||||
- "{{ playbook_dir }}/vars.yml"
|
||||
vars:
|
||||
# Paths use rsync 'source' conventions
|
||||
crio_integration_filepath: "/root/src/github.com/kubernetes-incubator/cri-o/testout.txt"
|
||||
# N/B: This needs coordination with e2e.yml
|
||||
crio_node_e2e_filepath: "/root/go-tools/src/k8s.io/kubernetes/artifacts/" # everything
|
||||
# Treat empty env. var as "undefined and use default()
|
||||
result_dest_basedir: '{{ lookup("env","WORKSPACE") |
|
||||
default(playbook_dir, True) }}/artifacts'
|
||||
_result_filepaths: [] # do not use
|
||||
_dstfnbuff: [] # do not use
|
||||
tasks:
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
|
||||
- name: register a repo for Golang
|
||||
yum_repository:
|
||||
name: 'centos-paas-sig-openshift-origin37-rpms'
|
||||
|
@ -14,61 +15,7 @@
|
|||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
- btrfs-progs-devel
|
||||
- container-selinux
|
||||
- curl
|
||||
- device-mapper-devel
|
||||
- expect
|
||||
- findutils
|
||||
- gcc
|
||||
- git
|
||||
- glib2-devel
|
||||
- glibc-devel
|
||||
- glibc-static
|
||||
- golang
|
||||
- gpgme-devel
|
||||
- hostname
|
||||
- iproute
|
||||
- iptables
|
||||
- krb5-workstation
|
||||
- libassuan-devel
|
||||
- libffi-devel
|
||||
- libgpg-error-devel
|
||||
- libguestfs-tools
|
||||
- libseccomp-devel
|
||||
- libvirt-client
|
||||
- libvirt-python
|
||||
- libxml2-devel
|
||||
- libxslt-devel
|
||||
- make
|
||||
- mlocate
|
||||
- nfs-utils
|
||||
- nmap-ncat
|
||||
- npm
|
||||
- oci-register-machine
|
||||
- oci-systemd-hook
|
||||
- oci-umount
|
||||
- openssl
|
||||
- openssl-devel
|
||||
- ostree-devel
|
||||
- pkgconfig
|
||||
- python
|
||||
- python2-boto
|
||||
- python2-crypto
|
||||
- python2-mock
|
||||
- python-click
|
||||
- python-devel
|
||||
- python-virtualenv
|
||||
- PyYAML
|
||||
- redhat-rpm-config
|
||||
- rpcbind
|
||||
- rsync
|
||||
- sed
|
||||
- skopeo-containers
|
||||
- socat
|
||||
- tar
|
||||
- wget
|
||||
with_items: "{{ rpm_pkgs }}"
|
||||
async: 600
|
||||
poll: 10
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
|
||||
- name: Change test_runner.sh to use bats xunit output
|
||||
lineinfile:
|
||||
dest: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o/test/test_runner.sh"
|
||||
|
@ -21,7 +22,7 @@
|
|||
|
||||
- name: set extra shell for non-xunit tests
|
||||
set_fact:
|
||||
extra_shell_suffix: " >testout.txt 2>&1"
|
||||
extra_shell_suffix: " &> {{ artifacts }}/testout.txt"
|
||||
when: not xunit
|
||||
|
||||
- name: run integration tests
|
||||
|
@ -35,13 +36,13 @@
|
|||
|
||||
- name: Make testing output directory
|
||||
file:
|
||||
path: "{{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o/reports"
|
||||
path: "{{ artifacts }}"
|
||||
state: directory
|
||||
ignore_errors: yes
|
||||
when: xunit
|
||||
|
||||
- name: Move all xunit files into one dir to scp
|
||||
shell: "mv {{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o/test/TestReport-bats*.xml {{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o/reports/"
|
||||
shell: "mv {{ ansible_env.GOPATH }}/src/github.com/kubernetes-incubator/cri-o/test/TestReport-bats*.xml {{ artifacts }}"
|
||||
when: xunit
|
||||
|
||||
- name: ensure we fail on bad tests
|
||||
|
|
67
contrib/test/integration/vars.yml
Normal file
67
contrib/test/integration/vars.yml
Normal file
|
@ -0,0 +1,67 @@
|
|||
---
|
||||
|
||||
# Enable using BATS to output integration-test xunit output (FIXME: broken? Kill it?)
|
||||
xunit: false
|
||||
|
||||
rpm_pkgs:
|
||||
- btrfs-progs-devel
|
||||
- container-selinux
|
||||
- curl
|
||||
- device-mapper-devel
|
||||
- expect
|
||||
- findutils
|
||||
- gcc
|
||||
- git
|
||||
- glib2-devel
|
||||
- glibc-devel
|
||||
- glibc-static
|
||||
- golang
|
||||
- gpgme-devel
|
||||
- hostname
|
||||
- iproute
|
||||
- iptables
|
||||
- krb5-workstation
|
||||
- libassuan-devel
|
||||
- libffi-devel
|
||||
- libgpg-error-devel
|
||||
- libguestfs-tools
|
||||
- libseccomp-devel
|
||||
- libvirt-client
|
||||
- libvirt-python
|
||||
- libxml2-devel
|
||||
- libxslt-devel
|
||||
- make
|
||||
- mlocate
|
||||
- nfs-utils
|
||||
- nmap-ncat
|
||||
- npm
|
||||
- oci-register-machine
|
||||
- oci-systemd-hook
|
||||
- oci-umount
|
||||
- openssl
|
||||
- openssl-devel
|
||||
- ostree-devel
|
||||
- pkgconfig
|
||||
- python
|
||||
- python2-boto
|
||||
- python2-crypto
|
||||
- python2-mock
|
||||
- python-click
|
||||
- python-devel
|
||||
- python-virtualenv
|
||||
- PyYAML
|
||||
- redhat-rpm-config
|
||||
- rpcbind
|
||||
- rsync
|
||||
- sed
|
||||
- skopeo-containers
|
||||
- socat
|
||||
- tar
|
||||
- wget
|
||||
|
||||
# For results.yml Paths use rsync 'source' conventions
|
||||
artifacts: "/tmp/artifacts" # Base-directory for collection
|
||||
crio_integration_filepath: "{{ artifacts }}/testout.txt"
|
||||
crio_node_e2e_filepath: "{{ artifacts }}/junit_01.xml"
|
||||
result_dest_basedir: '{{ lookup("env","WORKSPACE") |
|
||||
default(playbook_dir, True) }}/artifacts'
|
Loading…
Reference in a new issue