Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
25f25cba
Commit
25f25cba
authored
Jun 13, 2016
by
Paul Morie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve debugging experience for single integration test case
parent
15213d0a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
testing.md
docs/devel/testing.md
+1
-1
test-integration.sh
hack/test-integration.sh
+16
-6
No files found.
docs/devel/testing.md
View file @
25f25cba
...
@@ -146,7 +146,7 @@ To run all unit tests and generate an HTML coverage report, run the following:
...
@@ -146,7 +146,7 @@ To run all unit tests and generate an HTML coverage report, run the following:
KUBE_COVER
=
y hack/test-go.sh
KUBE_COVER
=
y hack/test-go.sh
```
```
At the end of the run, an
the
HTML report will be generated with the path
At the end of the run, an HTML report will be generated with the path
printed to stdout.
printed to stdout.
To run tests and collect coverage in only one package, pass its relative path
To run tests and collect coverage in only one package, pass its relative path
...
...
hack/test-integration.sh
View file @
25f25cba
...
@@ -37,28 +37,34 @@ KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,extensions/v1beta1;v1,autos
...
@@ -37,28 +37,34 @@ KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,extensions/v1beta1;v1,autos
KUBE_TIMEOUT
=
"-timeout 600s"
KUBE_TIMEOUT
=
"-timeout 600s"
KUBE_INTEGRATION_TEST_MAX_CONCURRENCY
=
${
KUBE_INTEGRATION_TEST_MAX_CONCURRENCY
:-
"-1"
}
KUBE_INTEGRATION_TEST_MAX_CONCURRENCY
=
${
KUBE_INTEGRATION_TEST_MAX_CONCURRENCY
:-
"-1"
}
LOG_LEVEL
=
${
LOG_LEVEL
:-
2
}
LOG_LEVEL
=
${
LOG_LEVEL
:-
2
}
KUBE_TEST_ARGS
=
${
KUBE_TEST_ARGS
:-}
cleanup
()
{
cleanup
()
{
kube::log::status
"Cleaning up etcd"
kube::etcd::cleanup
kube::etcd::cleanup
kube::log::status
"Integration test cleanup complete"
kube::log::status
"Integration test cleanup complete"
}
}
runTests
()
{
runTests
()
{
kube::log::status
"Starting etcd instance"
kube::etcd::start
kube::etcd::start
kube::log::status
"Running integration test cases"
kube::log::status
"Running integration test cases"
# TODO: Re-enable race detection when we switch to a thread-safe etcd client
# TODO: Re-enable race detection when we switch to a thread-safe etcd client
# KUBE_RACE="-race"
# KUBE_RACE="-race"
KUBE_GOFLAGS
=
"
-tags 'integration no-docker'
"
\
KUBE_GOFLAGS
=
"
${
KUBE_GOFLAGS
:-}
-tags 'integration no-docker'
"
\
KUBE_RACE
=
""
\
KUBE_RACE
=
""
\
KUBE_TIMEOUT
=
"
${
KUBE_TIMEOUT
}
"
\
KUBE_TIMEOUT
=
"
${
KUBE_TIMEOUT
}
"
\
KUBE_TEST_API_VERSIONS
=
"
$1
"
\
KUBE_TEST_API_VERSIONS
=
"
$1
"
\
"
${
KUBE_ROOT
}
/hack/test-go.sh"
test
/integration
"
${
KUBE_ROOT
}
/hack/test-go.sh"
test
/integration
kube::log::status
"Running integration test scenario with watch cache on"
# Run the watch cache tests
KUBE_TEST_API_VERSIONS
=
"
$1
"
"
${
KUBE_OUTPUT_HOSTBIN
}
/integration"
--v
=
${
LOG_LEVEL
}
\
# KUBE_TEST_ARGS doesn't mean anything to the watch cache test.
--max-concurrency
=
"
${
KUBE_INTEGRATION_TEST_MAX_CONCURRENCY
}
"
--watch-cache
=
true
if
[[
-z
"
${
KUBE_TEST_ARGS
}
"
]]
;
then
kube::log::status
"Running integration test scenario with watch cache on"
KUBE_TEST_API_VERSIONS
=
"
$1
"
"
${
KUBE_OUTPUT_HOSTBIN
}
/integration"
--v
=
${
LOG_LEVEL
}
\
--max-concurrency
=
"
${
KUBE_INTEGRATION_TEST_MAX_CONCURRENCY
}
"
--watch-cache
=
true
fi
cleanup
cleanup
}
}
...
@@ -73,12 +79,16 @@ checkEtcdOnPath() {
...
@@ -73,12 +79,16 @@ checkEtcdOnPath() {
checkEtcdOnPath
checkEtcdOnPath
"
${
KUBE_ROOT
}
/hack/build-go.sh"
"
$@
"
cmd/integration
"
${
KUBE_ROOT
}
/hack/build-go.sh"
"
$@
"
cmd/integration
# Run cleanup to stop etcd on interrupt or other kill signal.
# Run cleanup to stop etcd on interrupt or other kill signal.
trap
cleanup EXIT
trap
cleanup EXIT
# If a test case is specified, just run once with v1 API version and exit
if
[[
-n
"
${
KUBE_TEST_ARGS
}
"
]]
;
then
runTests v1
fi
# Convert the CSV to an array of API versions to test
# Convert the CSV to an array of API versions to test
IFS
=
';'
read
-a
apiVersions
<<<
"
${
KUBE_TEST_API_VERSIONS
}
"
IFS
=
';'
read
-a
apiVersions
<<<
"
${
KUBE_TEST_API_VERSIONS
}
"
for
apiVersion
in
"
${
apiVersions
[@]
}
"
;
do
for
apiVersion
in
"
${
apiVersions
[@]
}
"
;
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment