Skip to content

Integration framework improvement#1936

Merged
istio-merge-robot merged 15 commits intoistio:masterfrom
yutongz:integration
Dec 6, 2017
Merged

Integration framework improvement#1936
istio-merge-robot merged 15 commits intoistio:masterfrom
yutongz:integration

Conversation

@yutongz
Copy link
Copy Markdown
Contributor

@yutongz yutongz commented Nov 30, 2017

What this PR does / why we need it:
Some improvements based on the prototype before.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

Release note:

none
  1. Introduce common components and env
  2. Introduce entry script
  3. Add flags instead of hardcoded binary path.

Also include a doc about steps to adding tests: https://goo.gl/fej8qb
For design and concept, please refer https://goo.gl/1zE5Rq
Will create a github README page after this PR merged.

For now, you can checkout my branch and run tests/integration/integration.sh on a machine where you can run envoy binary.

/cc @wattli @mandarjog @douglas-reid

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 30, 2017

Codecov Report

Merging #1936 into master will increase coverage by 0.34%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1936      +/-   ##
=========================================
+ Coverage   81.66%     82%   +0.34%     
=========================================
  Files         190     190              
  Lines       15972   15624     -348     
=========================================
- Hits        13043   12812     -231     
+ Misses       2462    2359     -103     
+ Partials      467     453      -14
Flag Coverage Δ
#broker 47.27% <ø> (ø) ⬆️
#mixer 83.59% <ø> (+0.49%) ⬆️
#pilot 80.85% <ø> (+0.19%) ⬆️
#security 92.03% <ø> (ø) ⬆️
Impacted Files Coverage Δ
mixer/adapter/svcctrl/handler.go 27.77% <0%> (-10.94%) ⬇️
mixer/adapter/prometheus/prometheus.go 75.24% <0%> (-3.79%) ⬇️
mixer/adapter/denier/denier.go 88.88% <0%> (-3.22%) ⬇️
mixer/adapter/svcctrl/reportbuilder.go 86.46% <0%> (-2.11%) ⬇️
mixer/adapter/svcctrl/svcctrl.go 61.11% <0%> (-1.26%) ⬇️
pilot/proxy/envoy/discovery.go 75.93% <0%> (-0.56%) ⬇️
mixer/adapter/stdio/stdio.go 98.38% <0%> (-0.53%) ⬇️
mixer/cmd/client/cmd/util.go 63.39% <0%> (ø) ⬆️
pilot/model/validation.go 92.74% <0%> (ø) ⬆️
mixer/adapter/svcctrl/client.go 0% <0%> (ø) ⬆️
... and 23 more

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 2f58299...02f3dfb. Read the comment docs.

@yutongz
Copy link
Copy Markdown
Contributor Author

yutongz commented Nov 30, 2017

/cc @hklai

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a need for an additional LocalComponent if it is the same as CommonProcessComp?

Also, perhaps you can just rename CommonProcessComp to LocalProcessComp?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry I know I sent you this way before, but now I am having a second though looking at the outcome. =p

Having LocalComponent taking another Component as inheritance/extension is really ugly.

Shall we rename CommonProcessComp to just Process which represents a Process owned by this Component instead?

We may as well ditch the whole inheritance paradigm here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I guess you are right. The current solution is a little complex. Right, we can have a Process[struct] that wraps a os.Process and have start() and stop() to start/stop a background process. And those methods can be used in Component.Start()/Stop()

@yutongz
Copy link
Copy Markdown
Contributor Author

yutongz commented Dec 4, 2017

PTAL

name string
process *os.Process
logFile string
framework.CompProcess
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about just Process?

TestID string
Components []Component
// TestEnvManager is core test framework struct
type TestEnvManager struct {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about EnvironmentStarter?

Other than starting, this does not manage much right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Personally, I prefer "manager" or may be some other words since it takes care of the whole cycle of a environment: start, stop, alive check.

And I plan to add a parallel health monitor for the environment such that when tests failed in the middle we can see if the component crash is the reason.

// SetUp sets up the whole environment as well brings up components
func (framework *IstioTestFramework) SetUp() (err error) {
if err = framework.TestEnv.Bringup(); err != nil {
func (envManager *TestEnvManager) SetUp() (err error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be StartUp() instead?

envManager.TestEnv.Cleanup()
}

// IsEnvReady check if the whole environment is ready for running tests
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please document that this method wait for the env to be ready.

Probably rename this to waitUntilReady or something


// CompProcess is a wrap of os.Process
// With implemented methods to control local components
type CompProcess struct {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe TestProcess instead?

// TestEnvManager is core test framework struct
type TestEnvManager struct {
TestEnv TestEnv
TestID string
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is TestID needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For identification in log/test summary

Copy link
Copy Markdown
Contributor

@hklai hklai left a comment

Choose a reason for hiding this comment

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

Looks fine to me. Thanks!

name string
process *os.Process
logFile string
testProcess framework.TestProcess
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where is testProcess assigned?

// Bringup doing setup for AppOnlyEnv
// Bringup implement the function in TestEnv
// Create local temp dir. Can be manually overrided if necessary.
func (appOnlyEnv *AppOnlyEnv) Bringup() (err error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we have consistent names for start up and shut down between Env and Comp (or even Process)?

@hklai
Copy link
Copy Markdown
Contributor

hklai commented Dec 6, 2017

/lgtm

@istio-merge-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hklai

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@istio-merge-robot
Copy link
Copy Markdown

/test all [submit-queue is verifying that this PR is safe to merge]

@istio-merge-robot
Copy link
Copy Markdown

Automatic merge from submit-queue.

@istio-merge-robot istio-merge-robot merged commit e7d8f7d into istio:master Dec 6, 2017
@@ -20,7 +20,7 @@ type Component interface {
GetName() string

// Bringup doing setup for this component
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The comment seems to be in a wrong place


// Bringup doing setup for this component
// Start() is being called in framework.SetUp()
// Start() is being called in framework.StartUp()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we remove () in the comment of Start and Stop?

@yutongz
Copy link
Copy Markdown
Contributor Author

yutongz commented Dec 12, 2017

@mangchiandjjoe Will resolve them in my next PR, thanks!

@yutongz yutongz deleted the integration branch February 5, 2018 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants