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
bf35cb63
Commit
bf35cb63
authored
Jun 29, 2016
by
k8s-merge-robot
Committed by
GitHub
Jun 29, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #26603 from mikedanese/go-test-cleanup
Automatic merge from submit-queue now that go test runs iteration loops, use that instead of custom executor cc @ixdy
parents
5f4aaaa1
d046275a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
51 deletions
+3
-51
test-go.sh
hack/test-go.sh
+3
-51
No files found.
hack/test-go.sh
View file @
bf35cb63
...
@@ -74,7 +74,6 @@ usage: $0 [OPTIONS] [TARGETS]
...
@@ -74,7 +74,6 @@ usage: $0 [OPTIONS] [TARGETS]
OPTIONS:
OPTIONS:
-p <number> : number of parallel workers, must be >= 1
-p <number> : number of parallel workers, must be >= 1
-i <number> : number of times to run each test per worker, must be >= 1
EOF
EOF
}
}
...
@@ -82,7 +81,6 @@ isnum() {
...
@@ -82,7 +81,6 @@ isnum() {
[[
"
$1
"
=
~ ^[0-9]+
$
]]
[[
"
$1
"
=
~ ^[0-9]+
$
]]
}
}
iterations
=
1
parallel
=
1
parallel
=
1
while
getopts
"hp:i:"
opt
;
do
while
getopts
"hp:i:"
opt
;
do
case
$opt
in
case
$opt
in
...
@@ -99,12 +97,9 @@ while getopts "hp:i:" opt ; do
...
@@ -99,12 +97,9 @@ while getopts "hp:i:" opt ; do
fi
fi
;;
;;
i
)
i
)
iterations
=
"
$OPTARG
"
kube::log::usage
"'
$0
': use GOFLAGS='-count <num-iterations>'"
if
!
isnum
"
${
iterations
}
"
||
[[
"
${
iterations
}
"
-le
0
]]
;
then
kube::test::usage
kube::log::usage
"'
$0
': argument to -i must be numeric and greater than 0"
exit
1
kube::test::usage
exit
1
fi
;;
;;
?
)
?
)
kube::test::usage
kube::test::usage
...
@@ -180,50 +175,7 @@ produceJUnitXMLReport() {
...
@@ -180,50 +175,7 @@ produceJUnitXMLReport() {
kube::log::status
"Saved JUnit XML test report to
${
junit_xml_filename
}
"
kube::log::status
"Saved JUnit XML test report to
${
junit_xml_filename
}
"
}
}
runTestIterations
()
{
local
worker
=
$1
shift
kube::log::status
"Worker
${
worker
}
: Running
${
iterations
}
times"
for
arg
;
do
trap
'exit 1'
SIGINT
local
pkg
=
${
KUBE_GO_PACKAGE
}
/
${
arg
}
kube::log::status
"
${
pkg
}
"
# keep going, even if there are failures
local
pass
=
0
local
count
=
0
for
i
in
$(
seq
1
${
iterations
})
;
do
if
go
test
"
${
goflags
[@]
:+
${
goflags
[@]
}}
"
\
${
KUBE_RACE
}
${
KUBE_TIMEOUT
}
"
${
pkg
}
"
\
"
${
testargs
[@]
:+
${
testargs
[@]
}}
"
;
then
pass
=
$((
pass
+
1
))
else
ITERATION_FAILURES
=
$((
ITERATION_FAILURES
+
1
))
fi
count
=
$((
count
+
1
))
done
2>&1
kube::log::status
"Worker
${
worker
}
:
${
pass
}
/
${
count
}
passed"
done
return
0
}
runTests
()
{
runTests
()
{
# TODO: this should probably be refactored to avoid code duplication with the
# coverage version.
if
[[
$iterations
-gt
1
]]
;
then
ITERATION_FAILURES
=
0
# purposely non-local
if
[[
$#
-eq
0
]]
;
then
set
--
$(
kube::test::find_dirs
)
fi
for
p
in
$(
seq
1
${
parallel
})
;
do
runTestIterations
${
p
}
"
$@
"
&
done
wait
if
[[
${
ITERATION_FAILURES
}
-gt
0
]]
;
then
return
1
fi
return
0
fi
local
junit_filename_prefix
local
junit_filename_prefix
junit_filename_prefix
=
$(
junitFilenamePrefix
)
junit_filename_prefix
=
$(
junitFilenamePrefix
)
...
...
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