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
65363515
Commit
65363515
authored
Aug 22, 2019
by
harrylee
Committed by
vipwzw
Aug 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add copy-autotest.sh
parent
8d031c0f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
126 additions
and
37 deletions
+126
-37
.gitignore
.gitignore
+5
-0
Makefile
Makefile
+9
-7
copy-autotest.sh
build/autotest/copy-autotest.sh
+82
-0
kvmvcc_mavl_test.go
plugin/store/kvmvccmavl/kvmvcc_mavl_test.go
+30
-30
No files found.
.gitignore
View file @
65363515
...
...
@@ -26,7 +26,12 @@ build/para.sh
build/system-test-rpc.sh
build/ci
build/autotest/*
!build/autotest/copy-autotest.sh
!build/autotest/build.sh
!build/autotest/local/local-autotest.sh
!build/autotest/jerkinsci/*.yml
!build/autotest/jerkinsci/*.sh
!build/autotest/jerkinsci/Dockerfile-autotest
.DS_Store
logs/
build/wallet
...
...
Makefile
View file @
65363515
...
...
@@ -10,7 +10,7 @@ SRC_CLI := github.com/33cn/plugin/cli
APP
:=
build/chain33
CHAIN33
=
github.com/33cn/chain33
CHAIN33_VERSION
=
$(
shell
nl
go.mod |grep
"github.com/33cn/chain33"
|awk
'{print $$3}'
)
CHAIN33_PATH
=
${
GOPATH
}
/pkg/mod/github.com/33cn/chain33@
${
CHAIN33_VERSION
}
export
CHAIN33_PATH
=
${
GOPATH
}
/pkg/mod/github.com/33cn/chain33@
${
CHAIN33_VERSION
}
BUILD_FLAGS
=
-ldflags
"-X
${
CHAIN33_PATH
}
/common/version.GitCommit=
`
git rev-parse
--short
=
8 HEAD
`
"
LDFLAGS
:=
-ldflags
"-w -s"
PKG_LIST_VET
:=
`
go list ./... |
grep
-v
"vendor"
|
grep
-v
plugin/dapp/evm/executor/vm/common/crypto/bn256
`
...
...
@@ -46,13 +46,15 @@ vet:
autotest
:
##
build autotest binary
@
cd
build/autotest
&&
bash ./build.sh
${
CHAIN33_PATH
}
&&
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
&&
bash ./copy-autotest.sh
local
&&
cd local
&&
bash ./local-autotest.sh
$(dapp)
&&
cd
../../../
;
fi
# && rm -rf build/autotest/local
\
# && cp -r
$(CHAIN33_PATH)
/build/autotest/local
$(CHAIN33_PATH)
/build/autotest/
*
.sh build/autotest
\
cd
build/autotest
&&
chmod
755
local
&&
bash ./copy-autotest.sh
local
\
&&
cd local
&&
chmod
640
*
.toml
&&
bash ./local-autotest.sh
$(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
&&
bash ./copy-autotest.sh jerkinsci/temp
$(proj)
\
#
@rm -rf build/autotest/jerkinsci \
#
&& cp -r $(CHAIN33_PATH)/build/autotest/jerkinsci $(CHAIN33_PATH)/build/autotest/*.sh build/autotest/ \
cd
build/autotest
&&
bash
./copy-autotest.sh
jerkinsci/temp$(proj)
\
&&
cd
jerkinsci
&&
bash
./jerkins-ci-autotest.sh
$(proj)
&&
cd
../../../
autotest_tick
:
autotest
##
run with ticket mining
@
rm
-rf
build/autotest/gitlabci
\
...
...
build/autotest/copy-autotest.sh
0 → 100755
View file @
65363515
#!/usr/bin/env bash
set
-e
set
-o
pipefail
#set -o verbose
#set -o xtrace
# os: ubuntu16.04 x64
#chain33 dapp autotest root directory
declare
-a
Chain33AutoTestDirs
=(
"system"
"plugin"
"vendor/github.com/33cn/chain33/system"
"vendor/github.com/33cn/plugin/plugin"
)
#copy auto test to specific directory
# check args
if
[
"$#"
-lt
1
]
;
then
echo
"Usage:
$0
directory list"
exit
1
fi
function
copyAutoTestConfig
()
{
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
"
}
echo
"=======CHAIN33_PATH:
${
CHAIN33_PATH
}
===="
for
dir
in
"
$@
"
;
do
#check dir exist
if
[
!
-d
"
${
dir
}
"
]
;
then
mkdir
"
${
dir
}
"
fi
cp
autotest
"
${
dir
}
"
copyAutoTestConfig
"
${
dir
}
"
copyChain33
"
${
dir
}
"
echo
"# all copy have done!"
done
plugin/store/kvmvccmavl/kvmvcc_mavl_test.go
View file @
65363515
...
...
@@ -173,8 +173,8 @@ func TestKvmvccMavlCommit(t *testing.T) {
for
i
:=
0
;
i
<
30
;
i
++
{
key
=
GetRandomString
(
MaxKeylenth
)
value
=
fmt
.
Sprintf
(
"v%d"
,
i
)
keys
=
append
(
keys
,
[]
byte
(
string
(
key
)
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
string
(
key
)),
Value
:
[]
byte
(
string
(
value
)
)})
keys
=
append
(
keys
,
[]
byte
(
key
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
key
),
Value
:
[]
byte
(
value
)})
}
datas
:=
&
types
.
StoreSet
{
StateHash
:
drivers
.
EmptyRoot
[
:
],
...
...
@@ -623,8 +623,8 @@ func TestPruning(t *testing.T) {
for
i
:=
0
;
i
<
30
;
i
++
{
key
=
GetRandomString
(
MaxKeylenth
)
value
=
fmt
.
Sprintf
(
"v%d"
,
i
)
keys
=
append
(
keys
,
[]
byte
(
string
(
key
)
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
string
(
key
)),
Value
:
[]
byte
(
string
(
value
)
)})
keys
=
append
(
keys
,
[]
byte
(
key
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
key
),
Value
:
[]
byte
(
value
)})
}
datas
:=
&
types
.
StoreSet
{
StateHash
:
drivers
.
EmptyRoot
[
:
],
...
...
@@ -796,8 +796,8 @@ func benchmarkGet(b *testing.B, isResetForkHeight bool) {
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
key
:=
GetRandomString
(
MaxKeylenth
)
value
:=
fmt
.
Sprintf
(
"%s%d"
,
key
,
i
)
keys
=
append
(
keys
,
[]
byte
(
string
(
key
)
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
string
(
key
)),
Value
:
[]
byte
(
string
(
value
)
)})
keys
=
append
(
keys
,
[]
byte
(
key
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
key
),
Value
:
[]
byte
(
value
)})
if
i
%
10000
==
0
{
datas
:=
&
types
.
StoreSet
{
StateHash
:
hash
,
KV
:
kv
,
Height
:
0
}
hash
,
err
=
store
.
Set
(
datas
,
true
)
...
...
@@ -853,8 +853,8 @@ func benchmarkStoreGetKvs4N(b *testing.B, isResetForkHeight bool) {
for
i
:=
0
;
i
<
kvnum
;
i
++
{
key
=
GetRandomString
(
MaxKeylenth
)
value
=
fmt
.
Sprintf
(
"v%d"
,
i
)
keys
=
append
(
keys
,
[]
byte
(
string
(
key
)
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
string
(
key
)),
Value
:
[]
byte
(
string
(
value
)
)})
keys
=
append
(
keys
,
[]
byte
(
key
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
key
),
Value
:
[]
byte
(
value
)})
}
datas
:=
&
types
.
StoreSet
{
StateHash
:
drivers
.
EmptyRoot
[
:
],
...
...
@@ -907,8 +907,8 @@ func benchmarkStoreGetKvsForNN(b *testing.B, isResetForkHeight bool) {
for
i
:=
0
;
i
<
30
;
i
++
{
key
=
GetRandomString
(
MaxKeylenth
)
value
=
fmt
.
Sprintf
(
"v%d"
,
i
)
keys
=
append
(
keys
,
[]
byte
(
string
(
key
)
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
string
(
key
)),
Value
:
[]
byte
(
string
(
value
)
)})
keys
=
append
(
keys
,
[]
byte
(
key
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
key
),
Value
:
[]
byte
(
value
)})
}
datas
:=
&
types
.
StoreSet
{
StateHash
:
drivers
.
EmptyRoot
[
:
],
...
...
@@ -977,8 +977,8 @@ func benchmarkStoreGetKvsFor10000(b *testing.B, isResetForkHeight bool) {
for
i
:=
0
;
i
<
30
;
i
++
{
key
=
GetRandomString
(
MaxKeylenth
)
value
=
fmt
.
Sprintf
(
"v%d"
,
i
)
keys
=
append
(
keys
,
[]
byte
(
string
(
key
)
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
string
(
key
)),
Value
:
[]
byte
(
string
(
value
)
)})
keys
=
append
(
keys
,
[]
byte
(
key
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
key
),
Value
:
[]
byte
(
value
)})
}
datas
:=
&
types
.
StoreSet
{
StateHash
:
drivers
.
EmptyRoot
[
:
],
...
...
@@ -1050,8 +1050,8 @@ func benchmarkGetIter(b *testing.B, isResetForkHeight bool) {
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
key
:=
GetRandomString
(
MaxKeylenth
)
value
:=
fmt
.
Sprintf
(
"%s%d"
,
key
,
i
)
keys
=
append
(
keys
,
[]
byte
(
string
(
key
)
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
string
(
key
)),
Value
:
[]
byte
(
string
(
value
)
)})
keys
=
append
(
keys
,
[]
byte
(
key
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
key
),
Value
:
[]
byte
(
value
)})
if
i
%
10000
==
0
{
datas
:=
&
types
.
StoreSet
{
StateHash
:
hash
,
KV
:
kv
,
Height
:
0
}
hash
,
err
=
store
.
Set
(
datas
,
true
)
...
...
@@ -1105,8 +1105,8 @@ func benchmarkSet(b *testing.B, isResetForkHeight bool) {
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
key
:=
GetRandomString
(
MaxKeylenth
)
value
:=
fmt
.
Sprintf
(
"%s%d"
,
key
,
i
)
keys
=
append
(
keys
,
[]
byte
(
string
(
key
)
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
string
(
key
)),
Value
:
[]
byte
(
string
(
value
)
)})
keys
=
append
(
keys
,
[]
byte
(
key
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
key
),
Value
:
[]
byte
(
value
)})
if
i
%
10000
==
0
{
datas
:=
&
types
.
StoreSet
{
StateHash
:
hash
,
KV
:
kv
,
Height
:
0
}
hash
,
err
=
store
.
Set
(
datas
,
true
)
...
...
@@ -1152,8 +1152,8 @@ func benchmarkStoreSet(b *testing.B, isResetForkHeight bool) {
for
i
:=
0
;
i
<
30
;
i
++
{
key
=
GetRandomString
(
MaxKeylenth
)
value
=
fmt
.
Sprintf
(
"v%d"
,
i
)
keys
=
append
(
keys
,
[]
byte
(
string
(
key
)
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
string
(
key
)),
Value
:
[]
byte
(
string
(
value
)
)})
keys
=
append
(
keys
,
[]
byte
(
key
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
key
),
Value
:
[]
byte
(
value
)})
}
datas
:=
&
types
.
StoreSet
{
StateHash
:
drivers
.
EmptyRoot
[
:
],
...
...
@@ -1197,8 +1197,8 @@ func benchmarkSetIter(b *testing.B, isResetForkHeight bool) {
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
key
:=
GetRandomString
(
MaxKeylenth
)
value
:=
fmt
.
Sprintf
(
"%s%d"
,
key
,
i
)
keys
=
append
(
keys
,
[]
byte
(
string
(
key
)
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
string
(
key
)),
Value
:
[]
byte
(
string
(
value
)
)})
keys
=
append
(
keys
,
[]
byte
(
key
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
key
),
Value
:
[]
byte
(
value
)})
if
i
%
10000
==
0
{
datas
:=
&
types
.
StoreSet
{
StateHash
:
hash
,
KV
:
kv
,
Height
:
0
}
hash
,
err
=
store
.
Set
(
datas
,
true
)
...
...
@@ -1244,8 +1244,8 @@ func benchmarkMemSet(b *testing.B, isResetForkHeight bool) {
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
key
=
GetRandomString
(
MaxKeylenth
)
value
=
fmt
.
Sprintf
(
"v%d"
,
i
)
keys
=
append
(
keys
,
[]
byte
(
string
(
key
)
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
string
(
key
)),
Value
:
[]
byte
(
string
(
value
)
)})
keys
=
append
(
keys
,
[]
byte
(
key
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
key
),
Value
:
[]
byte
(
value
)})
}
datas
:=
&
types
.
StoreSet
{
StateHash
:
drivers
.
EmptyRoot
[
:
],
...
...
@@ -1288,8 +1288,8 @@ func benchmarkStoreMemSet(b *testing.B, isResetForkHeight bool) {
for
i
:=
0
;
i
<
30
;
i
++
{
key
=
GetRandomString
(
MaxKeylenth
)
value
=
fmt
.
Sprintf
(
"v%d"
,
i
)
keys
=
append
(
keys
,
[]
byte
(
string
(
key
)
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
string
(
key
)),
Value
:
[]
byte
(
string
(
value
)
)})
keys
=
append
(
keys
,
[]
byte
(
key
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
key
),
Value
:
[]
byte
(
value
)})
}
datas
:=
&
types
.
StoreSet
{
StateHash
:
drivers
.
EmptyRoot
[
:
],
...
...
@@ -1335,8 +1335,8 @@ func benchmarkCommit(b *testing.B, isResetForkHeight bool) {
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
key
=
GetRandomString
(
MaxKeylenth
)
value
=
fmt
.
Sprintf
(
"v%d"
,
i
)
keys
=
append
(
keys
,
[]
byte
(
string
(
key
)
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
string
(
key
)),
Value
:
[]
byte
(
string
(
value
)
)})
keys
=
append
(
keys
,
[]
byte
(
key
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
key
),
Value
:
[]
byte
(
value
)})
}
datas
:=
&
types
.
StoreSet
{
StateHash
:
drivers
.
EmptyRoot
[
:
],
...
...
@@ -1440,8 +1440,8 @@ func benchmarkIterMemSet(b *testing.B, isResetForkHeight bool) {
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
key
=
GetRandomString
(
MaxKeylenth
)
value
=
fmt
.
Sprintf
(
"v%d"
,
i
)
keys
=
append
(
keys
,
[]
byte
(
string
(
key
)
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
string
(
key
)),
Value
:
[]
byte
(
string
(
value
)
)})
keys
=
append
(
keys
,
[]
byte
(
key
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
key
),
Value
:
[]
byte
(
value
)})
}
datas
:=
&
types
.
StoreSet
{
StateHash
:
drivers
.
EmptyRoot
[
:
],
...
...
@@ -1483,8 +1483,8 @@ func benchmarkIterCommit(b *testing.B, isResetForkHeight bool) {
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
key
=
GetRandomString
(
MaxKeylenth
)
value
=
fmt
.
Sprintf
(
"v%d"
,
i
)
keys
=
append
(
keys
,
[]
byte
(
string
(
key
)
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
string
(
key
)),
Value
:
[]
byte
(
string
(
value
)
)})
keys
=
append
(
keys
,
[]
byte
(
key
))
kv
=
append
(
kv
,
&
types
.
KeyValue
{
Key
:
[]
byte
(
key
),
Value
:
[]
byte
(
value
)})
}
datas
:=
&
types
.
StoreSet
{
StateHash
:
drivers
.
EmptyRoot
[
:
],
...
...
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