Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-bitswap
Commits
1d55e098
Commit
1d55e098
authored
Jul 03, 2019
by
hannahhoward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ci(benchmarks): clean up scripts
Remove unused code, follow conventions
parent
31553b74
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
71 deletions
+3
-71
bin/benchmark-to-file.sh
bin/benchmark-to-file.sh
+0
-2
bin/build.sh
bin/build.sh
+0
-24
bin/diff-benchmarks.sh
bin/diff-benchmarks.sh
+1
-4
bin/run-benchmarks.sh
bin/run-benchmarks.sh
+2
-41
No files found.
bin/benchmark-to-file.sh
View file @
1d55e098
#!/bin/bash
output
=
"
$1
"
branch
=
"
$2
"
git checkout
"
$2
"
...
...
bin/build.sh
deleted
100755 → 0
View file @
31553b74
#!/bin/bash
set
-eo
pipefail
list_buildable
()
{
go list
-f
'{{if (len .GoFiles)}}{{.ImportPath}} {{if .Module}}{{.Module.Dir}}{{else}}{{.Dir}}{{end}}{{end}}'
./... |
grep
-v
/vendor/
}
build_all
()
{
# Make sure everything can compile since some package may not have tests
# Note: that "go build ./..." will fail if some packages have only
# tests (will get "no buildable Go source files" error) so we
# have to do this the hard way.
list_buildable |
while
read
-r
pkg
dir
;
do
echo
'*** go build'
"
$pkg
"
buildmode
=
archive
if
[[
"
$(
go list
-f
'{{.Name}}'
)
"
==
"main"
]]
;
then
# plugin works even when a "main" function is missing.
buildmode
=
plugin
fi
(
cd
"
$dir
"
;
go build
-buildmode
=
$buildmode
-o
/dev/null
"
$pkg
"
)
done
}
build_all
\ No newline at end of file
bin/diff-benchmarks.sh
View file @
1d55e098
#!/bin/bash
before
=
"
$1
"
after
=
"
$2
"
parse
()
{
sed
-n
\
-e
's/ *\t */\t/g'
\
...
...
@@ -29,4 +26,4 @@ if [[ $? -ne 4 ]]; then
exit
1
else
echo
"PASS"
fi
\ No newline at end of file
fi
bin/run-benchmarks.sh
View file @
1d55e098
...
...
@@ -3,51 +3,12 @@ set -eo pipefail
display_and_run
()
{
echo
"***"
"
$@
"
eval
$(
printf
'%q '
"
$@
"
)
eval
"
$(
printf
'%q '
"
$@
"
)
"
}
# reset workdir to state from git (to remove possible rewritten dependencies)
display_and_run git reset
--hard
# Environment
echo
"*** Setting up test environment"
if
[[
"
$TRAVIS_OS_NAME
"
==
"linux"
]]
;
then
if
[[
"
$TRAVIS_SUDO
"
==
true
]]
;
then
# Ensure that IPv6 is enabled.
# While this is unsupported by TravisCI, it still works for localhost.
sudo
sysctl
-w
net.ipv6.conf.lo.disable_ipv6
=
0
sudo
sysctl
-w
net.ipv6.conf.default.disable_ipv6
=
0
sudo
sysctl
-w
net.ipv6.conf.all.disable_ipv6
=
0
fi
else
# OSX has a default file limit of 256, for some tests we need a
# maximum of 8192.
ulimit
-Sn
8192
fi
list_buildable
()
{
go list
-f
'{{if (len .GoFiles)}}{{.ImportPath}} {{if .Module}}{{.Module.Dir}}{{else}}{{.Dir}}{{end}}{{end}}'
./... |
grep
-v
/vendor/
}
build_all
()
{
# Make sure everything can compile since some package may not have tests
# Note: that "go build ./..." will fail if some packages have only
# tests (will get "no buildable Go source files" error) so we
# have to do this the hard way.
list_buildable |
while
read
-r
pkg
dir
;
do
echo
'*** go build'
"
$pkg
"
buildmode
=
archive
if
[[
"
$(
go list
-f
'{{.Name}}'
)
"
==
"main"
]]
;
then
# plugin works even when a "main" function is missing.
buildmode
=
plugin
fi
(
cd
"
$dir
"
;
go build
-buildmode
=
$buildmode
-o
/dev/null
"
$pkg
"
)
done
}
export
GO111MODULE
=
on
display_and_run go get golang.org/x/tools/cmd/benchcmp
build_all
display_and_run git reset
--hard
git checkout
-b
after
git fetch origin master:refs/remotes/origin/before
...
...
@@ -59,4 +20,4 @@ git checkout after
display_and_run
BENCHMARK_SEED
=
"
$$
"
./bin/benchmark-to-file.sh benchmark-after.txt after
if
[[
"
$TRAVIS_OS_NAME
"
==
"linux"
]]
;
then
display_and_run ./bin/diff-benchmarks.sh benchmark-before.txt benchmark-after.txt
fi
\ No newline at end of file
fi
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