redtest subpackage
To be able to run your tests, the redpesk infrastructure expects a “redtest” sub-package to be created from your application’s specfile.
This sub-package actually contains the run-redtest
script (cf. redtests in the applications sources) and needs to install it in the /usr/libexec/redtest/<your_app_name>/
directory.
To learn more about how to create sub-packages in spec file please visit Creating Subpackages.
In our example, the following sections have been added to the spec file. It can be seen that a new sub-package “redtest” is created, with the right installation directory for the run-redtest
script.
[..]
%package redtest
Summary: redtest subpackage of the helloworld API
Requires: python3-requests
Requires: python3-tap.py
Requires: python3-pytest
Requires: python3-pytest-tap
%description redtest
Tests subpackage for the helloworld API package. The tests results generated follows the TAP format.
[..]
%install
[..]
mkdir -p %{buildroot}%{_libexecdir}/redtest/%{name}/
cp -a redtest/. %{buildroot}%{_libexecdir}/redtest/%{name}/
[..]
%files redtest
%defattr(-,root,root)
%{_libexecdir}/redtest/%{name}/*
You can therefore modify your spec file accordingly to your needs.
The redtest package containing uniquely the run-redtest
script, the %install
and %files redtest
sections should really look like the example above.
Tips: Do not forget to set the correct required packages for your tests, with the key word Requires:
in the %package redtest
section!