-
Notifications
You must be signed in to change notification settings - Fork 114
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
Fix v5 yum repo url #24
Fix v5 yum repo url #24
Conversation
@blbradley I see you've merged previous PRs... can you review/merge this one too? |
Sure! Have you ran your changes with success? |
Addition: Would you like to add CentOS to the test suite? Not a requirement or anything. |
@blbradley I am running with the proposed changes. I'd also like to write some tests, but running the suite fails for me:
Maybe it's something particular to my workstation since they ran cleanly via travis. I'll keep trying to get them running... |
I got the tests running on an EC2 instance, so I should be able to add CentOS next... |
I used an Ubuntu-specific provision command because I deferred making a choice. This formula could use an OS-agnostic way of installing Java. Would using sun-java-formula be acceptable? |
I propose that we leave the CentOS testing and Java formula discussion to another PR/issue. |
@blbradley I just saw your recent comments, but I'm already done adding centos support and new tests for the repo URL. I think distro specific provision commands are necessary, but I'm new to Test Kitchen so please advise if there's a better way to do that. I'm not sure about the best practice for Java and the tests. Currently elasticsearch-formula leaves Java installation up to the end user... at my company we already have some Salt code for installing Java, so that works well for me. But if you want me to leverage sun-java-formula in the formula that really goes beyond the scope of fixing the repo url. I don't see any problem installing openjdk for the tests. If you want to switch the Java install or want something more complicated for it that could be done separately. |
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.
In addition, I think the tests you added should be covered by using testinfra's Package.is_installed
. I've been trying to keep the tests OS-agnostic.
.kitchen.yml
Outdated
@@ -22,10 +14,31 @@ provisioner: | |||
- elasticsearch | |||
|
|||
platforms: | |||
# update base ubuntu image and install | |||
# software-properties-common for add-apt-repository | |||
<% @ubuntu_provision_commands = [ |
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.
I think it may be best to move each OS-specific provision command to a bash script outside of this file.
.kitchen.yml
Outdated
<% end %> | ||
- name: centos-6 | ||
driver_config: | ||
box: rchrd/centos-6-x64-salt |
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.
Vagrant is not used by the test suite. As such, this line doesn't do anything.
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.
Doh... I copied that from another salt-formula. Didn't realize they were using Vagrant instead of Docker. I'll work on this more today
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.
No worries! You used the right name. So, an appropriate image was used. It will be fine if you get rid of the driver_config
here.
I do appreciate your work and want to get it merged! I'm not sure how to use a bash script as a provision command. So, let me know if you need help with that. |
I'm unsure about this... as you noticed, I added tests to cover my repo URL change. Not sure how checking if a package is installed is relevant....? |
If the package installed correctly from a state run, then the repo URL must have been configured correctly. So, if you test the package being installed, then the repo URL has been tested. |
I tried to use relative paths and bash scripts with no success. It does not look like the entire repo root directory is copied to built Docker images. Just the directory specified in |
I see your point about the package installation test being good enough for the repo URL. Hmmm last run on Travis didn't work, but it passed locally. I'll try to figure that out... |
I think it would be worth using sun-java-formula in the test suite (and not in the formula) vs trying to run bash scripts to install Java. Please give that a try soon. |
Before I started, your provision commands included:
Therefore, I think it's reasonable to do this for centos:
If you want to redo the tests with sun-java-formula, let's merge this and perhaps open an issue for future follow-up. I think I have everything working at this point... just waiting on Travis to verify. |
Hmmm pretty sure everything was working locally. I'll retry from scratch to verify. At some point I think my testing was faulty because of cached Docker images, but I think it was working before going to bed last night. Not sure what to make of the |
Yeah it works locally. Here's my last run: https://gist.github.com/cmclaughlin/e709e6f3aac66945a2214fa7743269a2 |
It appears Travis is running off the master branch, not my PR. I guess the KitchenCI config is running off my branch? But the job definition has this:
I don't see any mention of changing branches. Am I missing something? |
@cmclaughlin FWIW if you expand that git clone it does a
Also per the last travis run (36) line
so it's definitely running the right SHA |
As for the failure:
If you look above this (hidden as it's not red):
Looks like travis is more aggressive about memory limits and is SIGKILL'ing the elasticsearch process whereas your docker is more hefty |
I got sun-java-formula working with just the test suite. I'll push a fix soon. We can revert or change if needed. |
Thanks for investigating that. And thanks for integrating sun-java-formula for the tests... I'm curious how you'll do that. |
Test case for ES 5 on CentOS is failing on a memory error. Here is the important log output:
I recall this being a new safety check in ES 5.1. May need to manage another parameter to get the tests to work. |
In addition, the yaml that was intended to be imported should be removed. |
I reported this type of failure in #17. |
6337e78
to
73a30ce
Compare
@blbradley I think I'm done here, but Travis CI still fails. However, the tests pass for me locally. I don't think it's what you saw in issue #17... it's something about SSH'ing into the Docker containers. Have you seen that before? |
No. I restarted the build just in case. |
Travis has been acting slow the past few days, and the test suite currently takes a really long time. We need to defer the CentOS testing to another PR and get this bug fixed now. In order to keep the commits from this PR for your usage, I'm going to revert to the first commit using On another note, we will only be able to test three OSes before optimization on the test suite is required. See saltstack-formulas/docker-formula#95. It might be only two with how slow Travis has been acting this week. |
73a30ce
to
ff0f08b
Compare
Based on the latest docs... https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html The yum repo url should end with /yum However, based on the 2.1 docs... https://www.elastic.co/guide/en/elasticsearch/reference/2.1/setup-repositories.html It should end with /centos Also don't try to install apt-transport-https on rpm systems.
@blbradley sounds good... I just removed the centos test and squashed, so this should be OK to merge. |
Thank you so much, Charles! I do appreciate you giving the test suite a good ole' one-two and for reporting/fixing the bug that I caused (I think). |
Based on the latest docs...
https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html
The yum repo url should end with /yum
However, based on the 2.1 docs...
https://www.elastic.co/guide/en/elasticsearch/reference/2.1/setup-repositories.html
It should end with /centos
Also don't try to install apt-transport-https on rpm systems.