Skip to content

Commit

Permalink
src: Assign tests to test suites
Browse files Browse the repository at this point in the history
The project already has a number of different tests plugged into the
build system. To have greater control over which tests are executed,
assign them into different suites. 'linting' for formatting and linting
and 'unit' for unit tests and generally self-contained tests testing
a small portion of Toolbx.

containers#1062
  • Loading branch information
HarryMichal committed May 30, 2022
1 parent 4469774 commit 96bc4d4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
4 changes: 2 additions & 2 deletions playbooks/unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
- hosts: all
tasks:
- name: Test
command: ninja -C builddir test
command: meson test --suite unit
args:
chdir: '{{ zuul.project.src_dir }}'
chdir: '{{ zuul.project.src_dir }}/builddir'
23 changes: 20 additions & 3 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,25 @@ custom_target(
)

if shellcheck.found()
test('shellcheck go-build-wrapper', shellcheck, args: [go_build_wrapper_file])
test(
'shellcheck go-build-wrapper',
shellcheck,
args: [go_build_wrapper_file],
suite: 'linting'
)
endif

test('go fmt', meson_go_fmt_program, args: [meson.current_source_dir()])
test('toolbox go unit tests', go, args: ['test', '-v', './...'], workdir: meson.current_source_dir())
test(
'go fmt',
meson_go_fmt_program,
args: [meson.current_source_dir()],
suite: 'linting'
)

test(
'go test',
go,
args: ['test', '-v', './...'],
suite: 'unit',
workdir: meson.current_source_dir()
)

0 comments on commit 96bc4d4

Please sign in to comment.