Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Add allennlp test-install command #1213

Merged
merged 17 commits into from
May 16, 2018

Conversation

nelson-liu
Copy link
Contributor

Fixes #856 by creating an allennlp test-install command that runs the unit test suite.

I've tested it locally outside of my allennlp install directory and it seems to work fine for both options, but unsure how to write a unit test for this.

This command skips the sniff tests by default, which should address @DeNeutoy 's concern from #1208 ?

@nelson-liu nelson-liu requested a review from joelgrus May 14, 2018 17:06
@joelgrus
Copy link
Contributor

I would pull out the project_root logic into a function and test that at least.

I would probably also store the initial working dir and change back to it at the end, not sure if it makes a difference, but it feels cleaner.

I can't think of a good way to test it either

@DeNeutoy
Copy link
Contributor

Yeah, I don't think we can test the thing which runs the tests in the tests 😆

Once we set up CI which runs the pip installation, this will be tested implicitly by that, so I think we're all good.

@nelson-liu
Copy link
Contributor Author

I realized that if the test_requirements (pytest, flaky, responses>=0.7, jupyter) are not installed, this will totally break all of the allennlp commands.

Is it worth adding these packages to the requirements installed by pip? Alternatively, we could fix #1200 ...

@matt-gardner
Copy link
Contributor

The whole reason requirements.txt was separate from test_requirements.txt was because we weren't including the tests in the pip release. If we're going to include tests in the pip release, do we need that distinction anymore?

@nelson-liu
Copy link
Contributor Author

perhaps we can move these essential testing packages (pytest, flaky, responses>=0.7, jupyter) to requirements.txt and the setup.py install_requires, then rename requirements_test.txt to requirements_dev.txt?

no need for a user to install sphinx or numpydoc or coverage...

@matt-gardner
Copy link
Contributor

I think others have stronger / more informed opinions here than me, so I'll let someone else answer the question. I was just providing some context.

@schmmd
Copy link
Member

schmmd commented May 16, 2018

Jupyter is enormous and is currently in our test_requirements (see #645). I'd rather not have that in our requirements.txt--but at the same time it'd be great to eliminate test_requirements so I'm not sure what's best!

@nelson-liu
Copy link
Contributor Author

nelson-liu commented May 16, 2018

another option is to turn off notebook tests by default in test-install and make users install jupyter in order to run them. This means that jupyter can stay in test_requirements and doesn't have to be installed by default.

@joelgrus
Copy link
Contributor

ANOTHER option is to rewrite the notebook tutorials as markdown tutorials and get rid of our jupyter dependency altogether 😇

@DeNeutoy
Copy link
Contributor

@nelson-liu Either solution you propose is fine - we can re-write the tutorials in a separate PR

@nelson-liu nelson-liu merged commit 356829d into allenai:master May 16, 2018
@nelson-liu nelson-liu deleted the test-install-command branch May 16, 2018 21:51
gabrielStanovsky pushed a commit to gabrielStanovsky/allennlp that referenced this pull request Sep 7, 2018
* Add allennlp test-install command

* Add back a newline that I accidentally removed

* Add small test for _get_project_root

* Fix typo in parens

* Remove erroneous copy/paste

* Add docs for test-install

* Remove some unused imports in commands.__init__.py

* Turn off notebook tests by default as well

* Raise informative error message if jupyter not found

* Move pytest, flaky, responses to requirements
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants