Enable Group 23 - Vic Machine Service to run in parallel under CI#7961
Enable Group 23 - Vic Machine Service to run in parallel under CI#7961rogeliosanchez merged 7 commits intovmware:masterfrom
Conversation
| Set Suite Variable ${HTTP_PORT} ${http_port} | ||
| ${handle}= Start Process ./bin/vic-machine-server --port ${HTTP_PORT} --scheme http shell=True cwd=/go/src/github.com/vmware/vic | ||
| Process Should Be Running ${handle} | ||
| [Return] ${handle} |
There was a problem hiding this comment.
Can we store the handle in a suite variable here to avoid needing to do that in each suite?
There was a problem hiding this comment.
@zjs I remember there being a reason I did it this way, but I'll change it once the build passes for this first PR run.
|
|
||
| # Get unused unprivileged TCP port | ||
| Get HTTP Port | ||
| ${rc} ${http_port}= Run And Return Rc And Output netstat -atn | perl -0777 -ne '@ports = /tcp.*?\:(\d+)\s+/imsg ; for $port (32768..61000) {if(!grep(/^$port$/, @ports)) { print $port; last } }' |
There was a problem hiding this comment.
It might be easier to run the server without specifying a port; it will pick an available one at random.
There was a problem hiding this comment.
@zjs Are you 100% sure? Because that would be better than this implementation.
There was a problem hiding this comment.
It definitely picks a random one.
That said, I'm not sure of the best way to see what port was picked.
Currently, I think it's just logged. We're not currently specifying a unique logfile for each invocation, but it seems like that would be easy enough to do (e.g., by writing to a file in ${OUTPUT DIR}).
If we do that, we could grep for a line like Serving vic machine at http://127.0.0.1:40081 and get the port number off of the end. (Or, perhaps even better, just stick the entire URL in a variable and use that in the test code instead of using the port number with a hard-coded protocol and host, making it easier to add tests for HTTPS in the future.)
| Resource ../../resources/Group23-VIC-Machine-Service-Util.robot | ||
| Suite Setup Start VIC Machine Server | ||
| Suite Teardown Terminate All Processes kill=True | ||
| Suite Setup Setup |
There was a problem hiding this comment.
Its better to be more specific when naming setup and teardown keywords.
There was a problem hiding this comment.
True. I followed this naming convention since there are other tests that had more inside those keywords. This way, you can add other future setup/teardown steps in those keywords once these tests are expanded.
mdharamadas1
left a comment
There was a problem hiding this comment.
lgtm, just a comment
mhagen-vmware
left a comment
There was a problem hiding this comment.
Lgtm, def want to allow the random port if possible though
Codecov Report
@@ Coverage Diff @@
## master #7961 +/- ##
=======================================
Coverage 26.07% 26.07%
=======================================
Files 37 37
Lines 5243 5243
=======================================
Hits 1367 1367
Misses 3769 3769
Partials 107 107Continue to review full report at Codecov.
|
[specific ci=Group23-VIC-Machine-Service]
[parallel jobs=2]
Fixes #7927