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

nxus-searcher-preset #1

Merged
merged 3 commits into from
Nov 7, 2018
Merged

nxus-searcher-preset #1

merged 3 commits into from
Nov 7, 2018

Conversation

loppear
Copy link
Contributor

@loppear loppear commented Nov 1, 2018

Adds a preset and environment for nxus apps using searcher / elasticsearch to manage setup/teardown of an ephemeral search index.

Also gets rid of the jest-nxus.config.js file and reads the main jest testEnvironmentOptions key instead for overriding server and env settings.

// But let nxus startup actually create the index with settings
await super.setup()

this.global.tester.searcherRefresh = async () => {
Copy link
Contributor Author

@loppear loppear Nov 6, 2018

Choose a reason for hiding this comment

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

@ScottMaxson asks "why is this being added to the global here".

So this refresh function only makes sense to me at the intersection of tests/nxus/searcher, so I think it makes sense to live in this preset's environment. But I didn't think it should introduce a new global so I'm adding it into the tester namespace. Open to other suggestions. Maybe it makes sense as a method on searcher itself and I'm wrong about only using it in tests. In that case, tests would use application.get('searcher').refreshIndex() say. But waterline-elasticsearch doesn't expose this client method directly so it would still look like a hack there a bit. :)

@loppear loppear merged commit 5c9bff7 into master Nov 7, 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.

2 participants