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

Lab Extension Testing #872

Merged
merged 9 commits into from Sep 26, 2016
Merged

Conversation

blink1073
Copy link
Member

@blink1073 blink1073 commented Sep 13, 2016

cf #728.

Adds local testing for the lab extension mechanism and tests on Travis.

@blink1073
Copy link
Member Author

This is ready for review.

Copy link
Contributor

@jasongrout jasongrout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still want to look at this more, but here are some initial comments.

check_call(cmd.split(), shell=shell, cwd=cwd)


class TestInstallNBExtension(TestCase):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestInstallLabExtension

entryPath: './mockextension/index.js',
config: {
output: {
path: path.join(process.cwd(), 'mockextension', 'build'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine that lots of people will be giving explicit output paths for the built files like this (I did with ipywidgets, for example). I think we should add it to the buildExtension configuration, rather than depending on people to always override the webpack config. Perhaps as an outputPath entry?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All review comments addressed as comments or in 7d89515

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def test_create_labextensions_system(self):
with TemporaryDirectory() as td:
self.system_labext = pjoin(td, u'labextensions')
with patch.object(labextensions, 'SYSTEM_JUPYTER_PATH', [td]):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're patching this out in the setup.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not this particular directory, I tried removing it and it claimed it did not exist.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea what you mean here.

with patch.object(labextensions, 'SYSTEM_JUPYTER_PATH', [td]):
install_labextension(self.src, self.name, user=False)
self.assert_installed(
pjoin(self.name),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pjoin(self.name) is equivalent to self.name. This happens other places too.

)

def test_create_labextensions_user(self):
with TemporaryDirectory() as td:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why you need a TemporaryDirectory() call in this function.


config_dir = os.path.join(_get_config_dir(user=True), 'labconfig')
cm = BaseJSONConfigManager(config_dir=config_dir)
enabled = cm.get('jupytlab_config').get('LabApp', {}).get('labextensions', {}).get(self.name, False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jupytlab -> jupyterlab?

@jasongrout
Copy link
Contributor

Thanks! This is huge.

@jasongrout
Copy link
Contributor

I read through it again. Looks good to me; thanks!

@jasongrout jasongrout merged commit 3c1311a into jupyterlab:master Sep 26, 2016
@blink1073 blink1073 deleted the labextension-tests branch September 26, 2016 14:02
@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Aug 11, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. tag:Build System
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants