Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Adding support to use current build number while running tests #761

Merged

Conversation

shuklanirdesh82
Copy link
Contributor

@shuklanirdesh82 shuklanirdesh82 commented Nov 21, 2016

Supplying a fix for #509 "Test runs should be isolated in namespace"

  1. added a new util file named 'TestInputParamsUtil.go' which keeps track of all test variables passed through command line and later used by tests
  2. make necessary changes at sanity_test.go & cmd_test.go
  3. renaming default volume name passed from vmdk_plugin/Makefile

-----local test run logs -------
Parameter passed from Makefile

# does sanity check of create/remove docker volume on the guest
TEST_VOL_NAME ?= DefaultTestVol
ssh  -kTax -o StrictHostKeyChecking=no root@10.20.105.77 /tmp/docker-volume-vsphere/docker-volume-vsphere.test -test.v \
	-v DefaultTestVol \
	-H1 tcp://10.20.105.77:2375 -H2 tcp://10.20.105.89:2375
=== RUN   TestSanity
Running tests on  tcp://10.20.105.77:2375 (may take a while)...
Running parallel tests on tcp://10.20.105.77:2375 and tcp://10.20.105.89:2375 (may take a while)...
--- PASS: TestSanity (162.56s)
	sanity_test.go:189: Successfully connected to tcp://10.20.105.77:2375
	sanity_test.go:189: Successfully connected to tcp://10.20.105.89:2375
	sanity_test.go:195: Creating vol=DefaultTestVol on client tcp://10.20.105.77:2375.
	sanity_test.go:89: Running cmd=&[touch /mnt/testvol/DefaultTestVol/file_to_touch] with vol=DefaultTestVol on client tcp://10.20.105.77:2375
	sanity_test.go:89: Running cmd=&[stat /mnt/testvol/DefaultTestVol/file_to_touch] with vol=DefaultTestVol on client tcp://10.20.105.77:2375

@kerneltime
Copy link
Contributor

Are these changes complete?

@shuklanirdesh82
Copy link
Contributor Author

refcnt_test.go is having its own unique name for volume creation and I have supplied for the rest.

}
}

fmt.Printf("Running parallel tests on %s and %s (may take a while)...\n", endPoint1, endPoint2)
// Create a short buffered channel to introduce random pauses
results := make(chan error, parallelVolumes)
createRequest := types.VolumeCreateRequest{
Name: volumeName,
Name: volName,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice change.
The volume name generation should be also changed in the goroutine below to something like:

createRequest.Name += strconv.Itoa(idx) + strconv.Itoa(i)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review! I will update in the next diff.

@msterin
Copy link
Contributor

msterin commented Nov 21, 2016

Please add how did you test the change (I guess a grep for the log would be good).
Also, do we have an Issue this PR is addressing ? If yes, please add a reference.
The rest looks good, assuming @kerneltime and @brunotm comments are addressed and CI passes

@shuklanirdesh82
Copy link
Contributor Author

Addressed all previous comment and verified through CI run (https://ci.vmware.run/vmware/docker-volume-vsphere/518) .. code is ready for review.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants