Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
4f85541c
Commit
4f85541c
authored
Dec 25, 2019
by
jiangpeng
Committed by
vipwzw
Dec 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scirpts:update autotest
parent
653223d8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
119 additions
and
47 deletions
+119
-47
.gitignore
.gitignore
+1
-1
Makefile
Makefile
+4
-14
build.sh
build/autotest/build.sh
+0
-32
run.sh
build/autotest/run.sh
+114
-0
No files found.
.gitignore
View file @
4f85541c
...
...
@@ -27,7 +27,7 @@ build/para.sh
build/system-test-rpc.sh
build/ci
build/autotest/*
!build/autotest/
build
.sh
!build/autotest/
run
.sh
.DS_Store
logs/
build/wallet
...
...
Makefile
View file @
4f85541c
...
...
@@ -43,23 +43,13 @@ vet:
@
go vet
${
PKG_LIST_VET
}
autotest
:
##
build autotest binary
@
cd
build/autotest
&&
bash ./
build.sh
${
CHAIN33_PATH
}
&&
cd
../../
@
cd
build/autotest
&&
bash ./
run.sh build
&&
cd
../../
@
if
[
-n
"
$(dapp)
"
]
;
then
\
rm
-rf
build/autotest/local
\
&&
cp
-r
$(CHAIN33_PATH)
/build/autotest/local
$(CHAIN33_PATH)
/build/autotest/
*
.sh build/autotest
\
&&
cd
build/autotest
&&
chmod
-R
755
local
&&
chmod
755
*
.sh
&&
bash ./copy-autotest.sh
local
\
&&
cd local
&&
bash ./local-autotest.sh
$(dapp)
\
&&
cd
../../../
;
fi
cd
build/autotest
&&
bash ./run.sh
local
$(dapp)
&&
cd
../../
;
fi
autotest_ci
:
autotest
##
autotest ci
@
rm
-rf
build/autotest/jerkinsci
\
&&
cp
-r
$(CHAIN33_PATH)
/build/autotest/jerkinsci
$(CHAIN33_PATH)
/build/autotest/
*
.sh build/autotest/
\
cd
build/autotest
&&
chmod
-R
755 jerkinsci
&&
chmod
755
*
.sh
&&
bash ./copy-autotest.sh jerkinsci/temp
$(proj)
\
&&
cd
jerkinsci
&&
bash ./jerkins-ci-autotest.sh
$(proj)
&&
cd
../../../
@
cd
build/autotest
&&
bash ./run.sh jerkinsci
$(proj)
&&
cd
../../
autotest_tick
:
autotest
##
run with ticket mining
@
rm
-rf
build/autotest/gitlabci
\
&&
cp
-r
$(CHAIN33_PATH)
/build/autotest/gitlabci
$(CHAIN33_PATH)
/build/autotest/
*
.sh build/autotest/
\
&&
cd
build/autotest
&&
chmod
-R
755 gitlabci
&&
chmod
755
*
.sh
&&
bash ./copy-autotest.sh gitlabci
\
&&
cd
gitlabci
&&
bash ./gitlab-ci-autotest.sh build
&&
cd
../../../
@
cd
build/autotest
&&
bash ./run.sh gitlabci build
&&
cd
../../
update
:
##
version 可以是git tag打的具体版本号
,
也可以是commit hash
,
什么都不填的情况下默认从master分支拉取最新版本
@
if
[
-n
"
$(version)
"
]
;
then
\
...
...
build/autotest/build.sh
deleted
100755 → 0
View file @
653223d8
#!/usr/bin/env bash
set
-e
set
-o
pipefail
#set -o verbose
#set -o xtrace
CHAIN33_PATH
=
$1
sedfix
=
""
if
[
"
$(
uname
)
"
==
"Darwin"
]
;
then
sedfix
=
".bak"
fi
echo
"=====chain33_path:
${
CHAIN33_PATH
}
========"
AutoTestMain
=
"
${
CHAIN33_PATH
}
/cmd/autotest/main.go"
ImportPlugin
=
'"github.com/33cn/plugin/plugin"'
function
build_auto_test
()
{
cp
"
${
AutoTestMain
}
"
./
sed
-i
$sedfix
"/^package/a import _
${
ImportPlugin
}
"
main.go
go build
-v
-i
-o
autotest
}
function
clean_auto_test
()
{
rm
-f
../autotest/main.go
}
trap
"clean_auto_test"
INT TERM EXIT
build_auto_test
build/autotest/run.sh
0 → 100755
View file @
4f85541c
#!/usr/bin/env bash
set
-e
set
-o
pipefail
#set -o verbose
#set -o xtrace
# os: ubuntu18.04 x64
sedfix
=
""
if
[
"
$(
uname
)
"
==
"Darwin"
]
;
then
sedfix
=
".bak"
fi
## get chain33 path
CHAIN33_PATH
=
$(
grep
-m1
github.com/33cn/chain33 ../../go.mod |
grep
-o
'[^ ]\+$'
)
CHAIN33_PATH
=
"
${
CHAIN33_PATH
%/
}
"
if
[[
-d
../../
${
CHAIN33_PATH
}
]]
;
then
CHAIN33_PATH
=
../../
"
$CHAIN33_PATH
"
elif
[[
!
-d
${
CHAIN33_PATH
}
]]
;
then
CHAIN33_PATH
=
"
${
GOPATH
}
"
/pkg/mod/github.com/33cn/chain33@
"
$CHAIN33_PATH
"
fi
function
build_auto_test
()
{
trap
"rm -f ../autotest/main.go"
INT TERM EXIT RETURN
local
AutoTestMain
=
"
${
CHAIN33_PATH
}
/cmd/autotest/main.go"
local
ImportPlugin
=
'"github.com/33cn/plugin/plugin"'
cp
"
${
AutoTestMain
}
"
./
sed
-i
$sedfix
"/^package/a import _
${
ImportPlugin
}
"
main.go
go build
-v
-i
-o
autotest
}
function
copyAutoTestConfig
()
{
declare
-a
Chain33AutoTestDirs
=(
"
${
CHAIN33_PATH
}
/system"
"../../plugin"
)
echo
"#copy auto test config to path
\"
$1
\"
"
local
AutoTestConfigFile
=
"
$1
/autotest.toml"
#pre config auto test
{
echo
'cliCmd="./chain33-cli"'
echo
"checkTimeout=60"
}
>
"
${
AutoTestConfigFile
}
"
#copy all the dapp test case config file
for
rootDir
in
"
${
Chain33AutoTestDirs
[@]
}
"
;
do
if
[[
!
-d
${
rootDir
}
]]
;
then
continue
fi
testDirArr
=
$(
find
"
${
rootDir
}
"
-type
d
-name
autotest
)
for
autotest
in
${
testDirArr
}
;
do
dapp
=
$(
basename
"
$(
dirname
"
${
autotest
}
"
)
"
)
dappConfig
=
${
autotest
}
/
${
dapp
}
.toml
#make sure dapp have auto test config
if
[
-e
"
${
dappConfig
}
"
]
;
then
cp
"
${
dappConfig
}
"
"
$1
"
/
#add dapp test case config
{
echo
"[[TestCaseFile]]"
echo
"dapp=
\"
$dapp
\"
"
echo
"filename=
\"
$dapp
.toml
\"
"
}
>>
"
${
AutoTestConfigFile
}
"
fi
done
done
}
function
copyChain33
()
{
echo
"# copy chain33 bin to path
\"
$1
\"
, make sure build chain33"
cp
../chain33 ../chain33-cli ../chain33.toml
"
$1
"
cp
"
${
CHAIN33_PATH
}
"
/cmd/chain33/chain33.test.toml
"
$1
"
}
function
copyAll
()
{
dir
=
"
$1
"
#check dir exist
if
[[
!
-d
${
dir
}
]]
;
then
mkdir
"
${
dir
}
"
fi
cp
autotest
"
${
dir
}
"
copyAutoTestConfig
"
${
dir
}
"
copyChain33
"
${
dir
}
"
echo
"# all copy have done!"
}
function
main
()
{
if
[[
$1
==
"build"
]]
;
then
#build autotest
build_auto_test
else
dir
=
"
$1
"
echo
"
$dir
"
rm
-rf
../autotest/
"
$dir
"
&&
mkdir
"
$dir
"
cp
-r
"
$CHAIN33_PATH
"
/build/autotest/
"
$dir
"
/
*
./
"
$dir
"
/
&&
copyAll
"
$dir
"
chmod
-R
755
"
$dir
"
&&
cd
"
$dir
"
&&
./autotest.sh
"
${
@
:2
}
"
&&
cd
../
fi
}
main
"
$@
"
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