From 9faf431fbbd2c1fe94ee14aea096480123b0a6c6 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Sun, 25 Oct 2020 23:02:59 +0530 Subject: [PATCH 1/4] Breakup conditional for readability --- tests/conftest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index ffd9f4215..81e136688 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -63,10 +63,10 @@ def pytest_collection_modifyitems(config, items): if not hasattr(item, 'module'): # e.g.: DoctestTextfile continue - # Mark network tests as flaky - if (item.get_closest_marker('network') is not None and - "CI" in os.environ): - item.add_marker(pytest.mark.flaky(reruns=3)) + if "CI" in os.environ: + # Mark network tests as flaky + if item.get_closest_marker('network') is not None: + item.add_marker(pytest.mark.flaky(reruns=3)) if (item.get_closest_marker('fails_on_new_resolver') and config.getoption("--new-resolver") and From 66bb8a88c49ff58f5c7202daf75d9a84d96d77f2 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Sun, 25 Oct 2020 23:03:10 +0530 Subject: [PATCH 2/4] Add a small delay between re-runs --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 81e136688..bf071c8de 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -66,7 +66,7 @@ def pytest_collection_modifyitems(config, items): if "CI" in os.environ: # Mark network tests as flaky if item.get_closest_marker('network') is not None: - item.add_marker(pytest.mark.flaky(reruns=3)) + item.add_marker(pytest.mark.flaky(reruns=3, reruns_delay=2)) if (item.get_closest_marker('fails_on_new_resolver') and config.getoption("--new-resolver") and From bd3d5f8f29a63f34ab0b04dfe27d026e10da60b9 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Sun, 25 Oct 2020 23:18:48 +0530 Subject: [PATCH 3/4] Set the CI variable on Azure Pipelines --- .azure-pipelines/linux.yml | 3 +++ .azure-pipelines/macos.yml | 3 +++ .azure-pipelines/windows.yml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.azure-pipelines/linux.yml b/.azure-pipelines/linux.yml index 6965a15fc..e55980743 100644 --- a/.azure-pipelines/linux.yml +++ b/.azure-pipelines/linux.yml @@ -1,3 +1,6 @@ +variables: + CI: true + jobs: - template: jobs/test.yml parameters: diff --git a/.azure-pipelines/macos.yml b/.azure-pipelines/macos.yml index 85c2a0246..9ad9edae8 100644 --- a/.azure-pipelines/macos.yml +++ b/.azure-pipelines/macos.yml @@ -1,3 +1,6 @@ +variables: + CI: true + jobs: - template: jobs/test.yml parameters: diff --git a/.azure-pipelines/windows.yml b/.azure-pipelines/windows.yml index 9d1bf5385..f56b8f504 100644 --- a/.azure-pipelines/windows.yml +++ b/.azure-pipelines/windows.yml @@ -1,3 +1,6 @@ +variables: + CI: true + jobs: - template: jobs/test-windows.yml parameters: From abb3d0fae3f14a86bc2c4df6cd6ef54311e0ee34 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Sun, 25 Oct 2020 23:32:26 +0530 Subject: [PATCH 4/4] Move build_env tests to functional These tests use the script fixture which as a 30s setup time on my machine. This KILLS productivity when trying to run unit tests as part of a feedback loop during development. --- tests/{unit => functional}/test_build_env.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/{unit => functional}/test_build_env.py (100%) diff --git a/tests/unit/test_build_env.py b/tests/functional/test_build_env.py similarity index 100% rename from tests/unit/test_build_env.py rename to tests/functional/test_build_env.py