Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip broken unit tests #134

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mamba_gator/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 6 additions & 5 deletions mamba_gator/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -41,8 +40,8 @@



TIMEOUT = 150
SLEEP = 1
TIMEOUT = 180
SLEEP = 5


class APITester(object):
Expand All @@ -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:
Expand Down Expand Up @@ -196,7 +195,9 @@ def wait_task(self, endpoint: str):
if endpoint.startswith("/" + NS):
endpoint = endpoint[len(NS) + 1 :]

while (datetime.datetime.now() - start_time).total_seconds() < TIMEOUT:
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)
response = self.conda_api.get([endpoint])
response.raise_for_status()
Expand Down
5 changes: 4 additions & 1 deletion packages/common/src/__tests__/services.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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/' };

Expand Down Expand Up @@ -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;
Expand Down