Run tests using source from GitHub

This commit is contained in:
Major Hayden 2022-06-27 14:19:03 -05:00
commit 70b2af8654
No known key found for this signature in database
GPG key ID: 737051E0C1011FB1
4 changed files with 39 additions and 7 deletions

View file

@ -1,6 +1,6 @@
# NOTE(mhayden): The tests require network access to talk to some Azure
# endpoints, so the tests are disabled for now. 😞
%bcond_with tests
%bcond_without tests
%global srcname azure-batch
@ -10,7 +10,9 @@ Release: %autorelease
Summary: Microsoft Azure Batch Client Library for Python
License: MIT
URL: https://pypi.org/project/%{srcname}/
Source0: %{pypi_source %{srcname} %{version} zip}
# This source comes from making a git archive of the main azure-sdk-for-python
# repository. To reproduce the source code, run the generate-source.sh script.
Source0: %{srcname}-%{version}.tgz
BuildArch: noarch
@ -24,6 +26,7 @@ BuildRequires: python3dist(azure-mgmt-resource)
BuildRequires: python3dist(azure-sdk-tools)
BuildRequires: python3dist(pytest)
BuildRequires: python3dist(pytest-aiohttp)
BuildRequires: python3dist(python-dotenv)
%endif
%global _description %{expand:
@ -34,7 +37,6 @@ Microsoft Azure Batch Client Library for Python}
%package -n python3-%{srcname}
Summary: %{summary}
Obsoletes: python3-azure-sdk < 5.0.1
%description -n python3-%{srcname} %{_description}
@ -44,7 +46,7 @@ Obsoletes: python3-azure-sdk < 5.0.1
%generate_buildrequires
%pyproject_buildrequires -r
%pyproject_buildrequires
%build
@ -56,9 +58,13 @@ Obsoletes: python3-azure-sdk < 5.0.1
%pyproject_save_files azure
%if %{with tests}
%check
%pytest --disable-warnings
%pyproject_check_import
%if %{with tests}
%pytest \
-k "not test_batch_applications \
and not test_batch_files"
%endif