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

Document how to test a pull request or development branch locally with a full Hoodie app #189

Open
janl opened this issue Sep 7, 2015 · 1 comment

Comments

@janl
Copy link
Contributor

janl commented Sep 7, 2015

@Charlotteis asked:

What would the best way to test this, be? hoodiehq-archive/node-multicouch#28 It looks good syntatically, but I would like to make sure it works 😄

Jan replied:

multicouch is a dependency of hoodie-server, so when you create a new hoodie app, it lives in ./node_modules/hoodie-server/node_modules/multicouch

If you now also check out the node-multicouch repo, and get the branch of the PR owner (separate how-to on that in a sec), you can run npm link in there.

Then you into you hoodie app again, and then cd ./node_modules/hoodie-server/node_modules in there you run npm link multicouch.

What happens is this: npm link in the multicouch repo makes this package available globally on your system, with a symlink, when you then npm link multicouch inside a project like we do above, npm will uninstall the multicouch version it downloaded and replace it with another symlink, that points to the global installation of multicouch.

That is now, your checkout of multicouch that you are on the special in is the code that is loaded when you start your Hoodie app

So you can stop hoodie, add a console.log for debugging, start hoodie again and check out what console.log printed

To test the issue at hand: do the npm link dance, uninstall all CouchDB from your system and then start your hoodie app

How to get into that branch that the PR was created from:

On every PR, next to the merge button is a link to “command line instructions”, click on that and copy the two commands from step 1, ignore step 2.

In our case here:

git checkout -b ivanbatic-master master
git pull https://github.com/ivanbatic/node-multicouch.git master

Then you are on the ivanbatic-master branch, and you can do the npm link dance as described above

End of Slack transcript.


It’d be great if somebody could turn this into actual documentation-prose and submit it to the docs.

Let’s put it under http://docs.hood.ie/en/tutorials/, say http://docs.hood.ie/en/tutorials/development and leave it there until we have more relevant content for a separate developer handbook section.

@varjmes
Copy link
Contributor

varjmes commented Sep 7, 2015

Would the multicouch one come under something like: docs.hood.ie/en/tutorials/development/package-testing do you think? Node multicouch could be the example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants