[7.0] add tests for fixing cmd apm-server setup template#1935
[7.0] add tests for fixing cmd apm-server setup template#1935simitt merged 2 commits intoelastic:7.0from
apm-server setup template#1935Conversation
simitt
commented
Feb 15, 2019
- backports adding tests for setup cmd.
tests/system/test_setup.py
Outdated
| self.es.indices.delete_template('apm-*') | ||
| except: | ||
| pass | ||
| assert self.es.indices.exists_template(name='apm-*') == False |
There was a problem hiding this comment.
not a big deal, but assert not self.es.indices.exists_template(name='apm-*') would be more idiomatic imo
tests/system/test_setup.py
Outdated
| assert self.es.indices.exists_template(name='apm-*') == False | ||
|
|
||
| shutil.copy(self.beat_path + "/_meta/beat.yml", | ||
| os.path.join(self.working_dir, "apm-server.yml")) |
There was a problem hiding this comment.
I think subclassing test_export.SubCommandTest would eliminate the need for this.
There was a problem hiding this comment.
I didn't want to derive from ServerSetUpBaseTest as this calls wait_until_startup() in the setup() command, which again expects to see Starting apm-server in the logs, which won't be there. I did not want to go down the path of overwriting this.
There was a problem hiding this comment.
SubCommandTest already implements wait_until_started to cover that. I wouldn't insist except that I'm worried about having the config generation in multiple places.
There was a problem hiding this comment.
You're right! I'll change accordingly.
8e19337 to
b60fa36
Compare
Add tests for template setup. fixes elastic#1922
b60fa36 to
456c0ec
Compare