-
-
Notifications
You must be signed in to change notification settings - Fork 164
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
always use an empty pelias.json in test #1431
always use an empty pelias.json in test #1431
Conversation
package.json
Outdated
@@ -15,7 +15,7 @@ | |||
"start": "./bin/start", | |||
"test": "npm run unit", | |||
"travis": "npm test", | |||
"unit": "./bin/units", | |||
"unit": "PELIAS_CONFIG=./test/pelias-config-empty.json ./bin/units", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually would work great in ./bin/units
itself (I think). That way anyone who runs the unit tests through any mechanism would get the right PELIAS_CONFIG
Ah yeah, we should have done this a long time ago. It looks like we need the actual empty |
I went in and fixed it all myself, and will take care of merging this from here. Thanks for not putting up with the cruft we've let sit for too long :P |
This change resolves #1419 by ensuring all unit tests will run with the `api.targets.auto_discover` property set to false, even if the value of that property in the `pelias-config` defaults or `~/pelias.json` is set to true. There were two changes required to achieve this: First, expand upon the work in #1431 that added an empty `pelias.json` file for use in the unit tests. Its now no longer empty and includes setting `auto_discover` to false. Second, one unit test still ended up calling Elasticsearch with that change. It was a test for the `TypeMapping` module itself, and it was overriding `pelias-config` with its own. Now with a test-specific `pelias.json` file, that code can simply be removed, and the unit tests can use the unmodified `pelias-config` library. I tested these changes against pelias/config#127 to make sure that PR won't break anything, and I believe everything is good to go.
This change resolves #1419 by ensuring all unit tests will run with the `api.targets.auto_discover` property set to false, even if the value of that property in the `pelias-config` defaults or `~/pelias.json` is set to true. There were two changes required to achieve this: First, expand upon the work in #1431 that added an empty `pelias.json` file for use in the unit tests. Its now no longer empty and includes setting `auto_discover` to false. Second, one unit test still ended up calling Elasticsearch with that change. It was a test for the `TypeMapping` module itself, and it was overriding `pelias-config` with its own. Now with a test-specific `pelias.json` file, that code can simply be removed, and the unit tests can use the unmodified `pelias-config` library. I tested these changes against pelias/config#127 to make sure that PR won't break anything, and I believe everything is good to go. Closes #1419
This change resolves #1419 by ensuring all unit tests will run with the `api.targets.auto_discover` property set to false, even if the value of that property in the `pelias-config` defaults or `~/pelias.json` is set to true. There were two changes required to achieve this: First, expand upon the work in #1431 that added an empty `pelias.json` file for use in the unit tests. Its now no longer empty and includes setting `auto_discover` to false. Second, one unit test still ended up calling Elasticsearch with that change. It was a test for the `TypeMapping` module itself, and it was overriding `pelias-config` with its own. Now with a test-specific `pelias.json` file, that code can simply be removed, and the unit tests can use the unmodified `pelias-config` library. I tested these changes against pelias/config#127 to make sure that PR won't break anything, and I believe everything is good to go. Closes #1419
I noticed that if I had a pelias.json in api/ or in ~/, it seemed like it would get used by tests and a couple of them would break because they were taking in some of my pelias configuration (other sources mostly).
To make unit tests always pass for developers, always point the unit test command at an empty pelias.json in test/
Closes #1239