From 2eff8e08e1e16463e526503db46ae5c21138d776 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Sat, 26 Jun 2021 18:12:22 +0200 Subject: [PATCH 1/3] Fix breakage in Fastmail tests Some code that wasn't updated with the switch to asyncio. --- tests/storage/servers/fastmail/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/storage/servers/fastmail/__init__.py b/tests/storage/servers/fastmail/__init__.py index a847fdd..3935c40 100644 --- a/tests/storage/servers/fastmail/__init__.py +++ b/tests/storage/servers/fastmail/__init__.py @@ -5,7 +5,7 @@ import pytest class ServerMixin: @pytest.fixture - def get_storage_args(self, item_type, slow_create_collection): + def get_storage_args(self, item_type, slow_create_collection, aio_connector): if item_type == "VTODO": # Fastmail has non-standard support for TODOs # See https://github.com/pimutils/vdirsyncer/issues/824 @@ -15,6 +15,7 @@ class ServerMixin: args = { "username": os.environ["FASTMAIL_USERNAME"], "password": os.environ["FASTMAIL_PASSWORD"], + "connector": aio_connector, } if self.storage_class.fileext == ".ics": @@ -25,7 +26,12 @@ class ServerMixin: raise RuntimeError() if collection is not None: - args = slow_create_collection(self.storage_class, args, collection) + args = await slow_create_collection( + self.storage_class, + args, + collection, + ) + return args return inner From ef2419efa9af2ab72b4c40e6a54d45fe6c3ccbd3 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Sat, 26 Jun 2021 18:12:54 +0200 Subject: [PATCH 2/3] Avoid running bogus tests with Fastmail The fix that disabled VTODO tests accidentally ran all other tests twice for this storage. This wasn't picked up earlier since Fastmail is not currently running on CI. --- tests/storage/servers/fastmail/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/storage/servers/fastmail/__init__.py b/tests/storage/servers/fastmail/__init__.py index 3935c40..3233fc8 100644 --- a/tests/storage/servers/fastmail/__init__.py +++ b/tests/storage/servers/fastmail/__init__.py @@ -5,11 +5,12 @@ import pytest class ServerMixin: @pytest.fixture - def get_storage_args(self, item_type, slow_create_collection, aio_connector): - if item_type == "VTODO": - # Fastmail has non-standard support for TODOs - # See https://github.com/pimutils/vdirsyncer/issues/824 - pytest.skip("Fastmail has non-standard VTODO support.") + def get_storage_args(self, slow_create_collection, aio_connector, request): + if "item_type" in request.fixturenames: + if request.getfixturevalue("item_type") == "VTODO": + # Fastmail has non-standard support for TODOs + # See https://github.com/pimutils/vdirsyncer/issues/824 + pytest.skip("Fastmail has non-standard VTODO support.") async def inner(collection="test"): args = { From f09d0605803bb658372a7475fabaf03ec74dde8f Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Sat, 26 Jun 2021 18:25:35 +0200 Subject: [PATCH 3/3] Run Fastmail tests on CI --- .builds/tests-release.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.builds/tests-release.yaml b/.builds/tests-release.yaml index 6abcb44..ef5c4d2 100644 --- a/.builds/tests-release.yaml +++ b/.builds/tests-release.yaml @@ -10,6 +10,7 @@ sources: - https://github.com/pimutils/vdirsyncer secrets: - a36c8ba3-fba0-4338-b402-6aea0fbe771e + - 4d9a6dfe-5c8d-48bd-b864-a2f5d772c536 environment: BUILD: test CI: true @@ -33,6 +34,19 @@ tasks: # Non-system python is used for packages: export PATH=$PATH:~/.local/bin/ make -e style + - check-secrets: | + # Stop here if this is a PR. PRs can't run with the below secrets. + [ -f ~/fastmail-secrets ] || complete-build + - extra-storages: | + set +x + source ~/fastmail-secrets + set -x + + cd vdirsyncer + export PATH=$PATH:~/.local/bin/ + DAV_SERVER=fastmail pytest tests/storage + - check-tag: | + # Stop here unless this is a tag. git describe --exact-match --tags || complete-build - publish: | cd vdirsyncer