tests/unit: install build requires from SPEC

The unit test uses Golang to directly execute unit tests from dist-git
sources. Running unit tests requires all package build dependencies to
be installed. Previously, this was handled by explicitly specifying all
package build dependencies as a test dependencies. This results in the
requirement to update the unit test for any new release with additional
build dependency. This information is already encoded in the SPEC file
and it is not really specific to the unit test.

Move away from specifying package build dependencies as the test
dependency and install BuildRequires from the package SPEC as part of
the test case.

Related: rhbz#2059870
This commit is contained in:
Tomas Hozza 2022-07-18 14:28:09 +02:00
parent 732b443e07
commit 3c26cc981f
No known key found for this signature in database
GPG Key ID: C5887AD51D9F3C2D
1 changed files with 1 additions and 2 deletions

View File

@ -1,6 +1,5 @@
summary: Run unit tests
require:
- golang
- krb5-devel
test: cd ../osbuild-composer-*/ && GOFLAGS=-mod=vendor go test ./...
test: cd ../osbuild-composer-*/ && sudo dnf builddep -y osbuild-composer.spec && GOFLAGS=-mod=vendor go test ./...
duration: 1h