UNPKG

5.48 kBMarkdownView Raw
1# Contributing to Meteorite
2
3Do the normal fork, patch, pull-request dance. If you don't know what that means or need any help, let us know.
4
5## Troubleshooting
6
7Sometimes git can get into broken states if weird things happen and the error messages you get as a result can be confusing.
8
9So before reporting errors, please first try cleaning up all of Meteorite's files and starting again (in your app's dir):
10
11```js
12 mrt uninstall
13 mrt uninstall --system
14 mrt
15```
16
17If you are seeing permission errors (e.g. `EACCESS`, talk of needing to be Administrator) please read: https://github.com/oortcloud/meteorite#permission-woes
18
19## Troubleshooting part 2, ADVANCED
20
21If you are still seeing problems after trying the above, or you want to figure out why you need to do it, please remember that Meteorite is at heart a very simple script that _isn't really doing much_.
22
23Remember that when you `mrt install` or just run `mrt`, Meteorite is doing the following:
24
251. Inspecting your `smart.json` to figure out what packages need to be installed.
262. Cloning them into `~/.meteorite/sources/<AUTHOR>/<REPO_NAME>`, checking out the right branch, git pulling.
273. Copying the files into `~/.meteorite/packages/<NAME>/<AUTHOR>/<REPO_NAME>/<COMMIT>/`
284. Symlinking packages from `packages/` to that location.
295. [Possibly] Running Meteor from a git checkout (similarly, in `~/.meteorite/meteors/<NAME>/<AUTHOR>/<REPO_NAME>/<COMMIT>/`).
30
31You can inspect `smart.lock` for some insights too.
32
33Helpful debugging you can do is:
34
351. Manually doing the same, seeing if you see the same error.
362. Digging around in `~/.meteorite` and seeing if git checkouts have gotten into a broken state.
37
38Meteorite is fairly brittle as it calls out to commandline git all the time, and problems can can sometime get missed. We appreciate you going the extra mile.
39
40
41## How to develop
42
43Use `npm link` to install your forked copy of Meteorite, then do something to make it more awesome.
44
45
46## Testing
47
48We have a pretty good start at an acceptance test suite but it could be a lot better. Help us fix this!
49
50### 1. Setup
51
52To run meteorite's test suite, you'll need a local atmosphere instance and a bit of setup for the meteorite dependencies. Here are the steps to get those set up:
53
54```sh
55$ cd ~/tmp
56$ git clone https://github.com/oortcloud/atmosphere.git
57$ cd atmosphere/app
58$ mrt --port 3333
59
60# in a separate terminal...
61
62$ cd ~/tmp
63$ git clone git@github.com:oortcloud/meteorite.git
64$ cd meteorite
65$ git submodule update --init
66$ npm install
67```
68
69### 2. Git path
70
71You'll need to ensure you have a git executable available at your PATH so `which git` can find it.
72
73You can find out where your current git command is being executed like this:
74
75```sh
76$ which git
77```
78
79
80### 3. Create test user on local Atmosphere instance
81
82The tests expect a local version of atmosphere running on port 3333, with a user 'test' with password 'testtest'. So now that the local atmosphere app is running, point your browser to http://localhost:3333/ and sign up with the following credentials:
83
84 * Username: test
85 * Password: testtest
86
87
88### 4. Running tests
89
90Once the above setup steps are complete, here's how you run the meteorite test suite:
91
92``` sh
93$ npm test
94# or
95$ mocha spec/unit spec/acceptance -t 240000 -R spec
96```
97
98### 5. Refreshing the test cache (as needed)
99
100Because Meteorite downloads Git repositories, we cache the results so the test suite will run fast. It will be slow the first time.
101
102When the related repositories change, you'll need to flush the cache.
103
104``` sh
105$ npm run-script flushcache
106```
107
108
109
110### Test troubleshooting
111
112#### Error: timeout of 240000ms exceeded
113
114If you get a timeout after the "Ensuring local atmosphere is running with the right packages" message, then it means you haven't started your local atmosphere app yet or its not running on port 3333.
115
116`$ mrt --port 3333`
117
118```sh
119$ npm test
120
121> meteorite@0.7.1 test /Users/alanning/tmp/meteorite
122> mocha spec/unit spec/acceptance -t 240000 -R spec
123
124
125
126Preparing..
127 Ensuring we have the dev bundle for system meteor
128 Ensuring local atmosphere is running with the right packages
129 1) "before all" hook
130
131 0 passing (4m)
132 1 failing
133
134 1) "before all" hook:
135 Error: timeout of 240000ms exceeded
136 at null.<anonymous> (/Users/alanning/tmp/meteorite/node_modules/mocha/lib/runnable.js:175:14)
137 at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
138
139
140
141npm ERR! weird error 1
142npm ERR! not ok code 0
143```
144
145#### Error: Ensure you've added the test user (with password testtest) to your local atmosphere server
146
147This means the local atmosphere app is running but the test user hasn't been created yet. Point your browser to `http://localhost:3333/` and signup with these credentials:
148
149 * Username: test
150 * Password: testtest
151
152
153#### Error: Problem finding package mrt-test-pkg1 ...or... Subcommand search does not exist
154
155This means that your meteorite version is out of date. Do an npm uninstall and reinstall like so:
156
157```sh
158$ npm uninstall -g meteorite
159$ npm install -g meteorite
160```
161
162Note: If your system requires root access to install global npm packages, make sure you use the -H flag:
163
164```sh
165$ sudo -H npm uninstall -g meteorite
166$ sudo -H npm install -g meteorite
167```
168
169
170### Todo
171
172Figure out work-arounds for the following issues, using a patched version of mocha if we have to.
173
174* Can't use mocha's recursive option because it breaks trying to process files in the test apps as test files.
175* Can't seem to use `--watch`.