Skip to content

Enable Group 23 - Vic Machine Service to run in parallel under CI#7961

Merged
rogeliosanchez merged 7 commits intovmware:masterfrom
rogeliosanchez:VIC-7927
May 22, 2018
Merged

Enable Group 23 - Vic Machine Service to run in parallel under CI#7961
rogeliosanchez merged 7 commits intovmware:masterfrom
rogeliosanchez:VIC-7927

Conversation

@rogeliosanchez
Copy link
Contributor

[specific ci=Group23-VIC-Machine-Service]
[parallel jobs=2]

Fixes #7927

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}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we store the handle in a suite variable here to avoid needing to do that in each suite?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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 } }'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be easier to run the server without specifying a port; it will pick an available one at random.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zjs Are you 100% sure? Because that would be better than this implementation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will get this going. Thanks @zjs!

Resource ../../resources/Group23-VIC-Machine-Service-Util.robot
Suite Setup Start VIC Machine Server
Suite Teardown Terminate All Processes kill=True
Suite Setup Setup
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its better to be more specific when naming setup and teardown keywords.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@mdharamadas1 mdharamadas1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just a comment

Copy link
Contributor

@mhagen-vmware mhagen-vmware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, def want to allow the random port if possible though

Copy link
Contributor

@singhshwetaQE singhshwetaQE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@codecov-io
Copy link

codecov-io commented May 21, 2018

Codecov Report

Merging #7961 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #7961   +/-   ##
=======================================
  Coverage   26.07%   26.07%           
=======================================
  Files          37       37           
  Lines        5243     5243           
=======================================
  Hits         1367     1367           
  Misses       3769     3769           
  Partials      107      107

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4573c60...a6008d2. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants