Closed ctrimble closed 8 years ago
A few notes:
@lburgazzoli restructuring the vagrant files and upgrading to 2.2.4
are not a problem. I plan opening some PRs with integration testing and I just need a way to programmatically start and stop a real etcd instance.
How about this:
Vagrantfile
in the top level directory/src/test/vagrant
2.2.4
and expose it on 4001
Looking at different articles on integration testing with Gradle, it looks like the tool wants the integration tests in a different directory than the unit tests. There does not seem to be a consensus on the name for this directory, unfortunately. I have placed the vagrant files in /src/it/vagrant
with the intent of placing tests in /src/it/java
.
TODO: set up one integration tests showing how to up vagrant from gradle and build an integration test that waits for etcd to become available, using a JUnit rule.
This is getting closer to something good.
/src/integration/
as there was some impedance when using the name it
.integration
is defined, that will start vagrant and then run the integration tests.Some work is still required on the way EtcdClientRules are created. Notes would be greatly appreciated.
Could you please check if you can integrate the Vagrant setup with the scripts in src/main/bash ?
@lburgazzoli I have integrated the provided scripts. The run script caused some problems. I made following changes:
Would it be possible to add also an argument to etcd_run.sh to configure if run in background or not ?
I was going to do that, but that seemed like it would also require options for redirecting output, so I held back. What if we ran the command with exec
, then you could cleanly background etcd with &
?
./run_etcd.sh &
My shell is a little weak, so I could easily be missing something here. Is there some advantage to spawning the child process from within the script?
It is mainly for running tests on travis-ci where it is usually better to keep things inside the script, maybe something like:
./run_etcd.sh -d --> will run it in background ./run_etcd.sh -d -f pathToRedirection --> will run it in background with redirection ./run_etcd.sh -e --> will run it with exec
@ctrimble would you be ok with such implementation ?
@lburgazzoli sorry for not getting to this. I am in the middle of building an important feature, so this has been lower priority.
I like the idea of everything running off of basically the same script. I read the Travis CI documentation relating to this and I understand the motivation for backgrounding the process to be a feature of the script itself. -d
seems a little clunky, since the process is not truly daemonized, but it doesn't really matter to me. I just want to support testing.
I've merged your pr and I will work to commands later this week
Thanks for merging. Sorry I haven't been able to get back to this.
This PR adds Vagrant configuration for starting an etcd instance. The instance is exposed on ports 4001 and 2379.