playbooks: Unify test setup for system & unit tests

There is no significant benefit in keeping this configuration separated.
Now the to-be installed packages are tracked in a single place and the
test playbooks only call the relevant tests.

This was pointed out by in 6063eb27b9

https://github.com/containers/toolbox/pull/898
This commit is contained in:
Ondřej Míchal 2021-10-22 15:21:41 +03:00
parent 6063eb27b9
commit c33075f3e1
4 changed files with 20 additions and 44 deletions

View file

@ -7,6 +7,7 @@
nodes:
- name: ci-node-33
label: cloud-fedora-33-small
pre-run: playbooks/setup-env.yaml
run: playbooks/unit-test.yaml
- job:

View file

@ -40,3 +40,21 @@
- name: Show podman debug information
command: podman info --debug
- name: Set up build directory
command: meson builddir
args:
chdir: '{{ zuul.project.src_dir }}'
- name: Build Toolbox
command: ninja -C builddir
args:
chdir: '{{ zuul.project.src_dir }}'
creates: builddir/src/toolbox
- name: Install Toolbox
become: yes
command: ninja -C builddir install
args:
chdir: '{{ zuul.project.src_dir }}'
creates: /usr/local/bin/toolbox

View file

@ -1,32 +1,10 @@
---
- hosts: all
vars:
toolbox_bin: '/usr/local/bin/toolbox'
tasks:
- name: Set up build directory
command: meson builddir
args:
chdir: '{{ zuul.project.src_dir }}'
- name: Build Toolbox
command: ninja -C builddir
args:
chdir: '{{ zuul.project.src_dir }}'
creates: builddir/src/toolbox
- name: Install Toolbox
become: yes
command: ninja -C builddir install
args:
chdir: '{{ zuul.project.src_dir }}'
creates: '{{ toolbox_bin }}'
- name: Run system tests
command: bats --timing ./test/system
environment:
PODMAN: '/usr/bin/podman'
TOOLBOX: '{{ toolbox_bin }}'
TOOLBOX: '/usr/local/bin/toolbox'
args:
chdir: '{{ zuul.project.src_dir }}'

View file

@ -1,27 +1,6 @@
---
- hosts: all
tasks:
- name: Install requirements
become: yes
package:
name:
- golang
- golang-github-cpuguy83-md2man
- ninja-build
- meson
- ShellCheck
- name: Set up build directory
command: meson builddir
args:
chdir: '{{ zuul.project.src_dir }}'
- name: Build Toolbox
command: ninja -C builddir
args:
chdir: '{{ zuul.project.src_dir }}'
creates: builddir/src/toolbox
- name: Test
command: ninja -C builddir test
args: