Skip to content

Commit

Permalink
playbooks: Unify test setup for system & unit tests
Browse files Browse the repository at this point in the history
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 6063eb2

containers#898
  • Loading branch information
HarryMichal committed Oct 22, 2021
1 parent 6063eb2 commit b4b1c48
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 44 deletions.
1 change: 1 addition & 0 deletions .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 18 additions & 0 deletions playbooks/setup-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
24 changes: 1 addition & 23 deletions playbooks/system-test.yaml
Original file line number Diff line number Diff line change
@@ -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 }}'
21 changes: 0 additions & 21 deletions playbooks/unit-test.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit b4b1c48

Please sign in to comment.