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

Add docker tests, updated travis CI to use docker #715

Closed
wants to merge 11 commits into from

Conversation

dbdean
Copy link
Contributor

@dbdean dbdean commented Sep 4, 2017

This PR has added a testing docker image that can run the test cases successfully, and has updated the README and the travis.yml use the docker-based testing image.

I'm happy to modify this PR as needed to help it get to master.

Thanks!

@dbdean
Copy link
Contributor Author

dbdean commented Sep 21, 2017

Any news on this PR? I'd be happy to help if any adjustments might be required to get it into master.

1 similar comment
@dbdean
Copy link
Contributor Author

dbdean commented Oct 12, 2017

Any news on this PR? I'd be happy to help if any adjustments might be required to get it into master.

@parente
Copy link
Member

parente commented Oct 13, 2017

When you say "run the tests successfully" did you see a failure with the existing setup? I'm curious about the motivation to dockerize the travis setup.

Copy link
Member

@parente parente left a comment

Choose a reason for hiding this comment

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

Left a few comments inline to check my understanding of the changes.


script:
- invoke test
- make test

env:
Copy link
Member

Choose a reason for hiding this comment

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

I believe the env vars below encode a github key that avoids the tests hitting the rate limit of anonymous calls to the github api. These would need to be forwarded into the container for the tests to use.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it captures it from the local environment, rather than having it passed in

Dockerfile.tests Outdated
@@ -0,0 +1,9 @@
FROM nbviewer_nbviewer
Copy link
Member

Choose a reason for hiding this comment

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

Instead of relying on the default image name here chosen by docker-compose, it might be better to specify an image name explicitly in the compose YAML and use it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that is probably a good idea. I'll look into that shortly.


test: build
docker build -t nbviewer_test -f Dockerfile.tests .
docker run -e GITHUB_API_TOKEN nbviewer_test invoke test
Copy link
Member

Choose a reason for hiding this comment

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

Does this successfully pass the token from the travis environment into the container?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It passes any GITHUB_API_TOKEN that is in the outside environment into the container, yes. It does appear to work with the encrypted token set up currently on github.

@dbdean
Copy link
Contributor Author

dbdean commented Oct 13, 2017

It's been a little while, but I believe my problem was that while I could use docker to run the viewer without having to install any depedencies on my local machine, I had to do so to run the tests, at least as it was suggested in the README.

@dbdean
Copy link
Contributor Author

dbdean commented Oct 16, 2017

Thanks for your assistance @parente!

I have updated this PR to include an explicit name for the nbviewer image in the docker-compose.yml, and base the testing image on that.

I've also had to add a fix for #730 to make it run in travis as less 3.0.0 is still broken.

I you merge this PR, you can close that issue, but you may want to keep an eye on less, to see if the pinning can be removed at some point in the future when they fix less/less.js#3116.

@dbdean
Copy link
Contributor Author

dbdean commented Oct 25, 2017

Hi @parente, I'd love to get this into master. Anything I can do to move this forward?

@minrk
Copy link
Member

minrk commented Dec 6, 2017

Sorry for not seeing this. While I think it's a good idea to document / allow running the tests in a docker container, I don't think this is what we should do on Travis. We lose the Python test matrix, and add an extra layer of indirection.

@parente
Copy link
Member

parente commented Jun 26, 2018

After running into a Python 2 specific issue in a recent PR, I agree with @minrk that the Travis build matrix of multiple versions has value over a dockerized, single version build and test.

@parente parente closed this Dec 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants