-
Notifications
You must be signed in to change notification settings - Fork 59
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
Facilitate local unit tests #121
Conversation
Currently ovn and ovs are checked out in under `pwd`. This is fine for a one-off build such as the one travis does. But for for if we wanted to reuse the ovs build for many tests while keeping the working directory clean, this is not enough In order to support sharing ovs builds between tests, support selecting the ovn/ovn build directory from the outside. Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Thanks @amorenoz . Yes, this is looks very reasonable and useful. What's the work pending (I am asking since it is marked as RFC)? |
@hzhou8 I marked as RFC because I was not sure if it would be considered useful. If it is, I think it's ready for review |
12d0827
to
aea0d7c
Compare
ok for me, minor typos in wording |
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Use a container to isolate from other ovsdb instances Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
This significantly speeds up test execution Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
aea0d7c
to
ce1dd59
Compare
@amorenoz if I wanted to execute 'go test -v ./...' or run a single test such as 'go test -run TestLogicalRouterPort' (refer https://github.com/eBay/go-ovn/blob/master/logical_router_port_test.go#L10), how would I be able to do that? Thanks |
@vjayaramrh I think the test_run.sh script can be further improved to provide an option to run a specific test case. With this we can use "docker run ... sh" to start the container and execute the test_run.sh script for specific test cases. I will merge this PR now since it would already provide lots of conveniences. More improvements are welcome :) |
@vjayaramrh, although it's possible to run your own "docker run" command, we could make it easier by adding an option, like @hzhou8 mentions, or even my documenting that process. WDYT? |
While doing some changes to go-ovn I wanted to have a quick and isolated way to run the go-ovn unit tests (instead of relying on travis or having to do a lot of preliminary setup). So I ended up reusing the travis scripts to have a container-isolated local
Makefile
.The result is that, running
make check
will build a container (only the first time you run it) and run the unit tests using the same scripts travis.Sending this PR as a request for comments. Is something like this considered useful?