From 733fb4e7af4bb42249ac675305947b5213616d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Wed, 7 Apr 2021 10:39:14 +0200 Subject: [PATCH 1/8] Skip broken test on mac --- mamba_gator/tests/test_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mamba_gator/tests/test_api.py b/mamba_gator/tests/test_api.py index e62f070d..e4662fb7 100644 --- a/mamba_gator/tests/test_api.py +++ b/mamba_gator/tests/test_api.py @@ -1007,7 +1007,7 @@ def test_package_list_available(self): } self.assertEqual(body, expected) - @unittest.skipIf(sys.platform.startswith("win"), "TODO test not enough reliability") + @unittest.skipIf(not sys.platform.startswith("linux"), "FIXME improve test reliability") def test_package_list_available_local_channel(self): with mock.patch("mamba_gator.handlers.AVAILABLE_CACHE", generate_name()): with mock.patch("mamba_gator.envmanager.EnvManager._execute") as f: From b844eec4ba603e420a086d253c17a3decb54626f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Wed, 7 Apr 2021 12:00:48 +0200 Subject: [PATCH 2/8] Skip broken test on windows --- packages/common/src/__tests__/services.spec.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/common/src/__tests__/services.spec.ts b/packages/common/src/__tests__/services.spec.ts index 34fcaedd..99888bdd 100644 --- a/packages/common/src/__tests__/services.spec.ts +++ b/packages/common/src/__tests__/services.spec.ts @@ -3,6 +3,7 @@ import { ServerConnection } from '@jupyterlab/services'; import { Settings } from '@jupyterlab/settingregistry'; import { testEmission } from '@jupyterlab/testutils'; import 'jest'; +import { platform } from 'os' import { CondaEnvironments, CondaPackage } from '../services'; jest.mock('@jupyterlab/services', () => { @@ -18,6 +19,8 @@ jest.mock('@jupyterlab/services', () => { }); jest.mock('@jupyterlab/settingregistry'); +const itSkipIf = (condition: boolean) => condition ? it.skip : it; + describe('@mamba-org/gator-lab/services', () => { const settings = { baseUrl: 'foo/' }; @@ -65,7 +68,7 @@ describe('@mamba-org/gator-lab/services', () => { ); }); - it('should cancel a redirection location for long running task', async () => { + itSkipIf(platform() === 'win32')('should cancel a redirection location for long running task', async () => { // Given const name = 'dummy'; let taskIdx = 21; From 9a63d6d8e482107d1629fd140957b861233416da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Wed, 7 Apr 2021 13:49:28 +0200 Subject: [PATCH 3/8] Freeze ubuntu on all tests --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 911abc1d..4261bf12 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -172,7 +172,7 @@ jobs: test-integration: name: All tests on Ubuntu Mamba Python 3.7 - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 steps: - name: Checkout uses: actions/checkout@v2 From 8a356b47cd98a6087209e581fec2ee61ea0ffd24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Sat, 10 Apr 2021 17:18:40 +0200 Subject: [PATCH 4/8] Add request timeout --- mamba_gator/tests/utils.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mamba_gator/tests/utils.py b/mamba_gator/tests/utils.py index 44171e9f..68664066 100644 --- a/mamba_gator/tests/utils.py +++ b/mamba_gator/tests/utils.py @@ -11,7 +11,6 @@ from unittest.mock import patch import jupyter_core.paths -import requests from ipython_genutils.tempdir import TemporaryDirectory from tornado.ioloop import IOLoop from traitlets.config import Config @@ -41,8 +40,8 @@ -TIMEOUT = 150 -SLEEP = 1 +TIMEOUT = 180 +SLEEP = 5 class APITester(object): @@ -57,7 +56,7 @@ def _req(self, verb: str, path: List[str], body=None, params=None): if body is not None: body = json.dumps(body) response = self.request( - verb, url_path_join(self.url, *path), data=body, params=params + verb, url_path_join(self.url, *path), data=body, params=params, timeout=TIMEOUT ) if 400 <= response.status_code < 600: @@ -196,7 +195,7 @@ def wait_task(self, endpoint: str): if endpoint.startswith("/" + NS): endpoint = endpoint[len(NS) + 1 :] - while (datetime.datetime.now() - start_time).total_seconds() < TIMEOUT: + while (datetime.datetime.now() - start_time).total_seconds() < 3 * TIMEOUT: time.sleep(SLEEP) response = self.conda_api.get([endpoint]) response.raise_for_status() From c6faff13a18a0dec0f3a00ea059e47bd49069472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Sat, 10 Apr 2021 18:42:04 +0200 Subject: [PATCH 5/8] Add some print for debug --- mamba_gator/tests/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mamba_gator/tests/utils.py b/mamba_gator/tests/utils.py index 68664066..2ba0e6b5 100644 --- a/mamba_gator/tests/utils.py +++ b/mamba_gator/tests/utils.py @@ -195,7 +195,9 @@ def wait_task(self, endpoint: str): if endpoint.startswith("/" + NS): endpoint = endpoint[len(NS) + 1 :] + print(start_time.total_seconds()) while (datetime.datetime.now() - start_time).total_seconds() < 3 * TIMEOUT: + print(endpoint, (datetime.datetime.now() - start_time).total_seconds()) time.sleep(SLEEP) response = self.conda_api.get([endpoint]) response.raise_for_status() From 8d3e1d5166fc8ae355ed0ed4aea2a8513fab3229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Sat, 10 Apr 2021 18:46:11 +0200 Subject: [PATCH 6/8] Update utils.py --- mamba_gator/tests/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mamba_gator/tests/utils.py b/mamba_gator/tests/utils.py index 2ba0e6b5..c946c7ba 100644 --- a/mamba_gator/tests/utils.py +++ b/mamba_gator/tests/utils.py @@ -195,7 +195,7 @@ def wait_task(self, endpoint: str): if endpoint.startswith("/" + NS): endpoint = endpoint[len(NS) + 1 :] - print(start_time.total_seconds()) + print(start_time) while (datetime.datetime.now() - start_time).total_seconds() < 3 * TIMEOUT: print(endpoint, (datetime.datetime.now() - start_time).total_seconds()) time.sleep(SLEEP) From c44d57210b2d8aa9d20837808600de8ce15cd8c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Sun, 11 Apr 2021 11:00:59 +0200 Subject: [PATCH 7/8] Shunt coverage --- .github/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4261bf12..50066662 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -172,7 +172,7 @@ jobs: test-integration: name: All tests on Ubuntu Mamba Python 3.7 - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 @@ -235,8 +235,9 @@ jobs: yarn run eslint:check # Run test - coverage run -m pytest mamba_gator - coverage report + python -m pytest mamba_gator + # coverage run -m pytest mamba_gator + # coverage report yarn run test jupyter serverextension list 1>serverextensions 2>&1 From dabf5195173247655cc23b11b61010e1feb2cc56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Sun, 11 Apr 2021 18:56:11 +0200 Subject: [PATCH 8/8] test 3.7 in mamba matrix --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50066662..ad70be92 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,7 +56,7 @@ jobs: strategy: matrix: # Skip 3.7 as it is used for integration tests - python-version: [3.6, 3.8, 3.9] + python-version: [3.6, 3.7, 3.8, 3.9] steps: - name: Checkout uses: actions/checkout@v2