-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Run package tests in vagrant #12646
Run package tests in vagrant #12646
Conversation
@electrical, @spinscale, @rmuir probably will have opinions on this. |
That looks awesome! Can we detect if vagrant is installed so we don't add the Something like in https://github.com/elastic/elasticsearch/blob/master/distribution/pom.xml#L196-L220 |
Right now we don't run it at all unless you do |
I only glanced at it, and it looks awesome to me at a glance too. I hope to have some time to try it out locally soon but don't let me hold up the change, this is really needed. |
I've marked this 2.0.0 - if we merge soon then I suspect it'll actually get into beta1. |
@electrical, @spinscale, @rmuir, @dadoonet this could use another reviewer. @dakrone's run through it and found lots of issues I fixed. I'd love someone who's running debian or ubuntu to give it a run through. Baring that someone who can just review the code would be nice. |
I'll give this a run tomorrow UK time. |
Hurrah! Thanks for that. |
Whoever looks at this next, keep in mind #12682. |
<allRpmBoxes>centos-6, centos-7, fedora-22</allRpmBoxes> | ||
|
||
<debBoxes>trusty</debBoxes> | ||
<rpmBoxes>centos-7.0</rpmBoxes> |
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 fails, as the box above has a different name...
I tried your branch this morning on my laptop. Sadly until now, I did not succeed in making it run. Here is what I did: mvn clean install -DskipTests
cd distribution
mvn verify -Pvagrant It failed. But I saw in logs that the VM was successfully downloaded:
Then, I tried to relaunch it again: cd tests
mvn verify I get this error:
Note: vagrant -v gives
Do you know what it means? Did I do something wrong? |
So when running all those tests, is the output somewhere redirected, so in case a build fails, I can follow what vagrant did without watching the screen? |
So I can confirm it starts with Vagrant 1.7.4 (thanks @spinscale for the help). May be we should try to control the version when starting Ant or at least document it? Not a big deal though. Tests running ATM... Let's see where it goes... |
I'm wondering if we should not make each test part of the distribution we are testing. I mean that I'd prefer do something like:
Is this possible? |
No, thats not possible or wanted. Sorry, we can't make our integration tests complicated. Please, add this to the |
I'm not talking about complicating integration tests. I don't want it too. I'm saying that if I run: cd distribution/rpm
mvn verify It runs what we have today (package the rpm, test it using REST tests). But it we run cd distribution/rpm
mvn verify -Pvagrant It packages the rpm, test it using REST tests and run the Vagrant test for this distribution. We should may be rename the
It would run for each module we have:
So if a module is failing you don't have to run again all the Qa for all the things. I Maven land, qa tools are supposed to run within their modules. Same for site plugin. If you want to generate a site, you basically generate it by module. My 2 cents on it |
I dont care about maven conventions in this case. Sorry, maven is wrong here and I am -1 to making integration tests complicated in this way. Please, add it to the qa module. These vagrant tests depend on all kinds of stuff, like plugins. They are not specific to the packaging. |
Fair enough. |
and by the way, the current solution (all in distribution/tests) is fine as a quick start. But ultimately we should move it to qa: https://github.com/elastic/elasticsearch/tree/master/qa This way it can easily depend on e.g. kuromoji plugin or whatever and not require special 'mvn install' or anything like that. |
machines using vagrant and bats.</description> | ||
<packaging>pom</packaging> | ||
|
||
<!-- The documentation for how to run this is in ../Vagrantfile --> |
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.
But its ../../VagrantFile, is this intended?
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'll fix the note but yeah, I meant to put the file in the root directory. When you run vagrant it walks up your directory tree looking for a Vagrantfile. Whatever it finds it uses. It'd be super weird to put one a /
or something but otherwise this is convenient behavior because you can start vagrant from anywhere in your project.
Maybe it makes sense to move the documentation in Vagrantfile into TESTING.md? |
+1 |
Done. |
I also added a section on testing the packages more manually - involving maven only minimally. Its the kind of tighter loops that I did when working on bugs in the package scripts. |
@nik9000 awesome work, thanks! It was really missing. I noticed a wrong parent version number in |
Ok - fixed the version in the pom. Above rpmbuild - someone further up told me that the rpms wouldn't work with rpmbuild <5.0. What version of rpmbuild do you have? If it really won't work with that version of rpmbuild then you can work around it with -P-rpm and I can update the error message with that hint. Soooo - this pull request has grown some extra commits overnight. Did this come from the accidental force push to master? |
I just dropped that check. |
+1, tested this locally and got it running. |
I'm having some trouble getting this running, which is very likely my own fault :)
Full gist of logs: https://gist.github.com/polyfractal/b49abd33b475a8890efa Lemme know what else you need :) |
it's because you ran with -Pvagrant in distribution module. So if your are in distribution module, just run mvn package In qa module mvn package -Pvagrant |
That did the trick, thanks @dadoonet!
|
I think we should add an "empty" vagrant profile in the parent pom so It should fix that. WDYT @nik9000? |
Can we instead not use profiles? Could we use ant logic to run by default if vagrant is installed? And if people really want to turn this off for verify runs, we can have a sys prop to disable? |
Btw, I only mean that as a suggestion for the future. This seems to be working, we should get it in. |
Agreed. I'd prefer folks not to use -Pxxxx Like here: https://github.com/elastic/elasticsearch/blob/master/distribution/pom.xml#L202 |
or activate the profile with a property. like -Dtests.vagrant or something. let the profile be a impl detail. |
OK - I'll fix that after merging. Looks like I have enough approval to merge this so I'm going to rebase and merge. Unless the rebase is substantively complicated. |
This creates a module in qa called vagrant that can be run if you have vagrant and virtualbox installed and will run the packaging tests in trusty and centos-7.0. You can ask it to run tests in other linuxes. This is the full list: * precise aka Ubuntu 12.04 * trusty aka Ubuntu 14.04 * vivid aka Ubuntun 15.04 * wheezy aka Debian 7, the current debian oldstable distribution * jessie aka Debian 8, the current debina stable distribution * centos-6 * centos-7 * fedora-22 * oel-7 There is lots of documentation on how to do this in the TESTING.asciidoc. Closes elastic#12611
Rebase was unremarkable - just required three way merge and git did it on its own. Merging and then hopping on a plane. |
This creates a module in distribution called tests that can be run if you
have vagrant and virtualbox installed and will run the packaging tests in
trusty, precise, wheeze, jessie, centos-6.6, and centos-7.0.
See distribution/Vagrantfile for real documentation, but the tl/dr is run
mvn verify -Pvagrant
and go get coffee.Closes #12611