Outsource %ansible_test_unit logic to helper script

We want %ansible_test_unit to retrieve the collection name{,space} from
galaxy.yml. This removes the need for the %collection_name{,space}
macros and utilizes ansible_collection.py's more robust approach to
running the tests.
epel8
Maxwell G 2 years ago
parent deee147c95
commit 78dcf4c992
No known key found for this signature in database
GPG Key ID: F79E4E25E8C661F8

@ -13,12 +13,10 @@
--filelist %{ansible_collection_filelist} --filelist %{ansible_collection_filelist}
} }
%ansible_test_unit() %{shrink:
%{_rpmconfigdir}/ansible_collection.py test --
--python-interpreter %{__python3} --local %{?*}
}
%ansible_test_unit() %{expand:\\\
mkdir -p ../ansible_collections/%{collection_namespace}
cp -a $(pwd) ../ansible_collections/%{collection_namespace}/%{collection_name}
pushd ../ansible_collections/%{collection_namespace}/%{collection_name}
ansible-test units --python-interpreter %{__python3} --local %{?*}
popd}
%ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/ %ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/

Loading…
Cancel
Save