From b52f860edbc3326a386f6f127286acac4fc1e8dafeacad49ea6ca11fe368074f Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sun, 3 Jul 2022 15:34:23 +0000 Subject: [PATCH] Accepting request 986389 from home:bnavigator:branches:devel:languages:python:aws - Enable the test suite with fake-gcs-server running OBS-URL: https://build.opensuse.org/request/show/986389 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-gcsfs?expand=0&rev=19 --- python-gcsfs.changes | 5 +++++ python-gcsfs.spec | 28 ++++++++++++++++------------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/python-gcsfs.changes b/python-gcsfs.changes index 41b05bd..f5c04e7 100644 --- a/python-gcsfs.changes +++ b/python-gcsfs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Jul 2 18:49:11 UTC 2022 - Ben Greiner + +- Enable the test suite with fake-gcs-server running + ------------------------------------------------------------------- Wed Jun 29 10:18:06 UTC 2022 - Ben Greiner diff --git a/python-gcsfs.spec b/python-gcsfs.spec index 377b828..5bcea3b 100644 --- a/python-gcsfs.spec +++ b/python-gcsfs.spec @@ -17,8 +17,6 @@ %{?!python_module:%define python_module() python3-%{**}} -# the test suite moved to a docker simulator which we cannot run inside an obs environment -%bcond_with fulltest %define skip_python2 1 Name: python-gcsfs Version: 2022.5.0 @@ -44,9 +42,7 @@ Recommends: python-gcsfs-fuse = %{version} Suggests: python-crcmod BuildArch: noarch # SECTION test requirements -# always import in order to detect dependency breakages at build time BuildRequires: %{python_module aiohttp} -BuildRequires: %{python_module black} BuildRequires: %{python_module click} BuildRequires: %{python_module decorator > 4.1.2} BuildRequires: %{python_module fsspec == %{version}} @@ -56,8 +52,10 @@ BuildRequires: %{python_module google-api-python-client} BuildRequires: %{python_module google-auth >= 1.2} BuildRequires: %{python_module google-auth-oauthlib} BuildRequires: %{python_module google-cloud-storage} +BuildRequires: %{python_module pytest-timeout} BuildRequires: %{python_module pytest} BuildRequires: %{python_module requests} +BuildRequires: fake-gcs-server # /SECTION %python_subpackages @@ -87,15 +85,21 @@ sed -i 's/--color=yes//' setup.cfg %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -# The full test suite requires to start a docker container via fake-gcs-server -# see https://github.com/fsspec/gcsfs/blob/main/docs/source/developer.rst -# and the gcs fixtures in conftest.py +# https://github.com/fsspec/gcsfs/blob/main/docs/source/developer.rst +fake-gcs-server \ + -backend memory \ + -scheme http \ + -public-host http://localhost:4443 \ + -external-url http://localhost:4443 \ + >$PWD/fake-gcs-server.stdout 2>$PWD/fake-gcs-server.stderr & +trap "jobs; kill %1 || true" EXIT +export STORAGE_EMULATOR_HOST=http://localhost:4443 export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/gcsfs/tests/fake-secret.json -%if %{with fulltest} -%pytest -rfEs -%else -%pytest -rfEs -k test_checkers -%endif +# Don't test fuse, it hangs on mounting inside obs +donttest="test_fuse" +# finds an existing path on the non-first multiflavor test runs" +donttest+=" or test_mkdir_with_path" +%pytest -rfEs -k "not ($donttest)" %files %{python_files} %doc README.rst