Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
140aac0d
Y
YTBP
项目概览
YottaChain
/
YTBP
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
YTBP
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
140aac0d
编写于
1月 20, 2018
作者:
C
Ciju John
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix script options in travis script. Bring over script updates from noon branch.
上级
4778d64e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
47 addition
and
13 deletion
+47
-13
.travis.yml
.travis.yml
+2
-2
tests/eosd_run_test.py
tests/eosd_run_test.py
+10
-2
tests/testUtils.py
tests/testUtils.py
+35
-9
未找到文件。
.travis.yml
浏览文件 @
140aac0d
...
...
@@ -77,10 +77,10 @@ script:
-
mkdir build && cd build
-
${CMAKE_DIR}cmake -G Ninja -DWASM_LLVM_CONFIG=$TRAVIS_BUILD_DIR/ext/wasm-compiler/bin/llvm-config -DSecp256k1_ROOT_DIR=$TRAVIS_BUILD_DIR/ext -DBINARYEN_ROOT=$TRAVIS_BUILD_DIR/ext/wasm-compiler -DCMAKE_PREFIX_PATH=$TRAVIS_BUILD_DIR/ext -DCMAKE_BUILD_TYPE=Release $EOS_CMAKE_OPTIONS ..
-
ninja -j4
-
tests/eosd_run_test.py --host=localhost --port=8888 --dump
ErrorDetails'
-
tests/eosd_run_test.py --host=localhost --port=8888 --dump
-error-details
-
'
[
"$TRAVIS_OS_NAME"
==
"osx"
]
||
tests/p2p_tests/sync/test.sh'
-
'
[
"$TRAVIS_OS_NAME"
==
"osx"
]
||
tests/p2p_tests/sync/test.sh
-p
2
-d
10'
-
'
[
"$TRAVIS_OS_NAME"
==
"osx"
]
||
tests/run_tests.sh'
-
'
[
"$TRAVIS_OS_NAME"
==
"osx"
]
||
tests/eosd_run_test.py
--mongo
Db
--dumpErrorD
etails'
-
'
[
"$TRAVIS_OS_NAME"
==
"osx"
]
||
tests/eosd_run_test.py
--mongo
db
--dump-error-d
etails'
-
ctest --output-on-failure
-
cpack
tests/eosd_run_test.py
浏览文件 @
140aac0d
...
...
@@ -74,6 +74,7 @@ killEosInstances=True
if
amINoon
:
testUtils
.
Utils
.
iAmNoon
()
testUtils
.
Utils
.
setMongoSyncTime
(
50
)
try
:
Print
(
"BEGIN"
)
...
...
@@ -332,7 +333,10 @@ try:
if
not
enableMongo
:
transaction
=
node
.
getTransaction
(
transId
)
else
:
transaction
=
node
.
getMessageFromDb
(
transId
,
retry
=
False
)
if
amINoon
:
transaction
=
node
.
getActionFromDb
(
transId
)
else
:
transaction
=
node
.
getMessageFromDb
(
transId
)
if
transaction
is
None
:
cmdError
(
"eosc get transaction trans_id"
)
errorExit
(
"Failed to retrieve transaction details %s"
%
(
transId
))
...
...
@@ -397,7 +401,11 @@ try:
Print
(
"verify abi is set"
)
account
=
node
.
getEosAccountFromDb
(
currencyAccount
.
name
)
abiName
=
account
[
"abi"
][
"structs"
][
0
][
"name"
]
abiActionName
=
account
[
"abi"
][
"actions"
][
0
][
"action_name"
]
abiActionName
=
None
if
not
amINoon
:
abiActionName
=
account
[
"abi"
][
"actions"
][
0
][
"action_name"
]
else
:
abiActionName
=
account
[
"abi"
][
"actions"
][
0
][
"name"
]
abiType
=
account
[
"abi"
][
"actions"
][
0
][
"type"
]
if
abiName
!=
"transfer"
or
abiActionName
!=
"transfer"
or
abiType
!=
"transfer"
:
errorExit
(
"FAILURE - get table currency account failed"
,
raw
=
True
)
...
...
tests/testUtils.py
浏览文件 @
140aac0d
...
...
@@ -43,9 +43,12 @@ class Utils:
SigKillTag
=
"kill"
SigTermTag
=
"term"
# mongoSyncTime: eosiod mongodb plugin seems to sync with a 10-15 seconds delay. This will inject
# a wait period before the 2nd DB check (if first check fails)
mongoSyncTime
=
25
amINoon
=
False
#
I am in
the NOON branch
#
Configure for
the NOON branch
@
staticmethod
def
iAmNoon
():
Utils
.
amINoon
=
True
...
...
@@ -53,6 +56,10 @@ class Utils:
Utils
.
EosWalletPath
=
"programs/eosio-walletd/eosio-walletd"
Utils
.
EosServerName
=
"eosiod"
Utils
.
EosServerPath
=
"programs/eosiod/%s"
%
(
Utils
.
EosServerName
)
@
staticmethod
def
setMongoSyncTime
(
syncTime
):
Utils
.
mongoSyncTime
=
syncTime
@
staticmethod
def
getChainStrategies
():
...
...
@@ -101,16 +108,14 @@ class Account(object):
###########################################################################################
class
Node
(
object
):
# mongoSyncTime: eosiod mongodb plugin seems to sync with a 10-15 seconds delay. This will inject
# a wait period before the 2nd DB check (if first check fails)
def
__init__
(
self
,
host
,
port
,
pid
=
None
,
cmd
=
None
,
alive
=
None
,
mongoSyncTime
=
25
,
enableMongo
=
False
,
mongoHost
=
"localhost"
,
mongoPort
=
27017
,
mongoDb
=
"EOStest"
):
def
__init__
(
self
,
host
,
port
,
pid
=
None
,
cmd
=
None
,
alive
=
None
,
enableMongo
=
False
,
mongoHost
=
"localhost"
,
mongoPort
=
27017
,
mongoDb
=
"EOStest"
):
self
.
host
=
host
self
.
port
=
port
self
.
pid
=
pid
self
.
cmd
=
cmd
self
.
alive
=
alive
self
.
enableMongo
=
enableMongo
self
.
mongoSyncTime
=
None
if
mongoSyncTime
<
1
else
mongoSyncTime
self
.
mongoSyncTime
=
None
if
Utils
.
mongoSyncTime
<
1
else
Utils
.
mongoSyncTime
self
.
mongoHost
=
mongoHost
self
.
mongoPort
=
mongoPort
self
.
mongoDb
=
mongoDb
...
...
@@ -326,10 +331,33 @@ class Node(object):
return
None
def
getActionFromDb
(
self
,
transId
,
retry
=
True
,
silentErrors
=
False
):
for
i
in
range
(
2
):
cmd
=
"%s %s"
%
(
Utils
.
MongoPath
,
self
.
mongoEndpointArgs
)
subcommand
=
'db.Actions.findOne( { "transaction_id": "%s" } )'
%
(
transId
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: echo '%s' | %s"
%
(
subcommand
,
cmd
))
try
:
trans
=
Node
.
runMongoCmdReturnJson
(
cmd
.
split
(),
subcommand
)
if
trans
is
not
None
:
return
trans
except
subprocess
.
CalledProcessError
as
ex
:
if
not
silentErrors
:
msg
=
ex
.
output
.
decode
(
"utf-8"
)
Utils
.
Print
(
"ERROR: Exception during get db node get message. %s"
%
(
msg
))
return
None
if
not
retry
:
break
if
self
.
mongoSyncTime
is
not
None
:
time
.
sleep
(
self
.
mongoSyncTime
)
return
None
def
getMessageFromDb
(
self
,
transId
,
retry
=
True
,
silentErrors
=
False
):
for
i
in
range
(
2
):
cmd
=
"%s %s"
%
(
Utils
.
MongoPath
,
self
.
mongoEndpointArgs
)
subcommand
=
'db.Messages.findOne( {
transaction_id
: "%s" } )'
%
(
transId
)
subcommand
=
'db.Messages.findOne( {
"transaction_id"
: "%s" } )'
%
(
transId
)
Utils
.
Debug
and
Utils
.
Print
(
"cmd: echo '%s' | %s"
%
(
subcommand
,
cmd
))
try
:
trans
=
Node
.
runMongoCmdReturnJson
(
cmd
.
split
(),
subcommand
)
...
...
@@ -951,7 +979,6 @@ class Cluster(object):
__chainSyncStrategies
=
Utils
.
getChainStrategies
()
__WalletName
=
"MyWallet"
__localHost
=
"localhost"
#__portStart=8888
__lastTrans
=
None
# init accounts
...
...
@@ -983,9 +1010,8 @@ class Cluster(object):
self
.
mongoUri
=
""
if
self
.
enableMongo
:
self
.
mongoUri
=
"mongodb://%s:%d/%s"
%
(
mongoHost
,
mongoPort
,
mongoDb
)
#self.mongoEndpointArgs += "mongodb://%s:%d/%s" % (mongoHost, mongoPort, mongoDb)
self
.
mongoEndpointArgs
+=
"--host %s --port %d %s"
%
(
mongoHost
,
mongoPort
,
mongoDb
)
self
.
endpointArgs
=
""
#
self.endpointArgs=""
def
setChainStrategy
(
self
,
chainSyncStrategy
=
Utils
.
SyncReplayTag
):
self
.
__chainSyncStrategy
=
self
.
__chainSyncStrategies
.
get
(
chainSyncStrategy
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录