Update system test scripts
This commit is contained in:
1 parent
6c5429b353
commit
2b51bda3e7
5 files changed
+64
-15
No files matched your search
@@ -104,7 +104,7 @@ namespace bts.tests
|
||||
var all_securities = await all_futures(test_symbol);
|
||||
List<SecurityImmutable> security_list = all_securities.ToList();
|
||||
|
||||
Assert.IsTrue(all_securities.Count() >= 2);
|
||||
Assert.IsTrue(all_securities.Count() >= 2, "At least two securities are needed");
|
||||
SecurityImmutable first_sec = security_list[0];
|
||||
SecurityImmutable second_sec = security_list[1];
|
||||
|
||||
|
||||
File renamed without changes.
@@ -2,6 +2,24 @@
|
||||
|
||||
rm -r ~/sparkdata/data/databases/ > /dev/null
|
||||
|
||||
|
||||
mv ~/sparkdata/conf/spark.conf ~/sparkdata/conf/spark.conf.bak
|
||||
cat << EOF > ~/sparkdata/conf/spark.conf
|
||||
ExchangeSim {
|
||||
value {
|
||||
merge_with_md:true
|
||||
}
|
||||
}
|
||||
Logging {
|
||||
value {
|
||||
console { default_level: "Error" }
|
||||
syslog { default_level: "Error" }
|
||||
file { default_level: "Error" }
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
|
||||
nohup ./sparkd run &
|
||||
pid=$!
|
||||
echo "sparkd pid: " $pid
|
||||
@@ -11,4 +29,5 @@ sleep 120
|
||||
|
||||
dotnet sparkcmd.dll test test_clip_limits
|
||||
|
||||
kill $pid
|
||||
kill $pid
|
||||
mv ~/sparkdata/conf/spark.conf.bak ~/sparkdata/conf/spark.conf
|
||||
@@ -55,7 +55,7 @@ say_verbose() {
|
||||
|
||||
is_merge_with_md_on() {
|
||||
eval $invocation
|
||||
|
||||
|
||||
if [ $(./sparkd configcheck ExchangeSim | grep merge_with_md: | cut -d " " -f 2) == "false" ]; then
|
||||
return 0
|
||||
else
|
||||
@@ -65,14 +65,14 @@ is_merge_with_md_on() {
|
||||
|
||||
set_merge_with_md_off() {
|
||||
eval $invocation
|
||||
|
||||
|
||||
if [ -f $config_file_path ]; then
|
||||
say_verbose "config file exists ... removing"
|
||||
rm $config_file_path
|
||||
fi
|
||||
|
||||
|
||||
echo "$merge_with_md_key" >> $config_file_path && test_config_file_created=true
|
||||
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -81,29 +81,37 @@ set_merge_with_md_off() {
|
||||
# class_name - $2
|
||||
get_tests_in_class() {
|
||||
eval $invocation
|
||||
|
||||
|
||||
local return_var=$1
|
||||
local class_name=$2
|
||||
local arr=($(dotnet sparkcmd.dll test --system --list | perl -ne '/^( *)/; $i = length $1; $j && $i >= $j and print, next; $j = 0; /'"$class_name"'/ and $j = $i + 1, print' | tail -n +2))
|
||||
local arr=($(dotnet sparkcmd.dll test --type System --list | perl -ne '/^( *)/; $i = length $1; $j && $i >= $j and print, next; $j = 0; /'"$class_name"'/ and $j = $i + 1, print' | tail -n +2))
|
||||
eval $return_var='("${arr[@]}")'
|
||||
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# Start sparkd
|
||||
nohup ./sparkd run &
|
||||
pid=$!
|
||||
echo "sparkd pid: " $pid
|
||||
echo "sleeping for 120 seconds..."
|
||||
sleep 120
|
||||
|
||||
|
||||
# args
|
||||
# class_name - $1
|
||||
run_bts_test() {
|
||||
eval $invocation
|
||||
|
||||
|
||||
class_name=$1
|
||||
|
||||
|
||||
local test_names_tuple=()
|
||||
get_tests_in_class test_names_tuple $class_name
|
||||
for test_name in ${test_names_tuple[@]}; do
|
||||
for test_name in ${test_names_tuple[@]}; do
|
||||
say_verbose "running test with name: $test_name ...";
|
||||
dotnet sparkcmd.dll test $test_name
|
||||
done
|
||||
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -127,7 +135,7 @@ if is_merge_with_md_on; then
|
||||
say_err "Please investigate manually"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
else
|
||||
say_verbose "merge with md is already off"
|
||||
fi
|
||||
|
||||
@@ -137,4 +145,7 @@ if [ "$test_config_file_created" = true ]; then
|
||||
rm $config_file_path
|
||||
fi
|
||||
|
||||
# Kill sparkd
|
||||
kill $pid
|
||||
|
||||
say "Test has finished."
|
||||
@@ -2,6 +2,24 @@
|
||||
|
||||
rm -r ~/sparkdata/data/databases/ > /dev/null
|
||||
|
||||
|
||||
mv ~/sparkdata/conf/spark.conf ~/sparkdata/conf/spark.conf.bak
|
||||
cat << EOF > ~/sparkdata/conf/spark.conf
|
||||
ExchangeSim {
|
||||
value {
|
||||
merge_with_md:true
|
||||
}
|
||||
}
|
||||
Logging {
|
||||
value {
|
||||
console { default_level: "Error" }
|
||||
syslog { default_level: "Error" }
|
||||
file { default_level: "Error" }
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
|
||||
nohup ./sparkd run &
|
||||
pid=$!
|
||||
echo "sparkd pid: " $pid
|
||||
@@ -10,4 +28,5 @@ echo "sleeping for 120 seconds..."
|
||||
sleep 120
|
||||
dotnet sparkcmd.dll test test_position_limits
|
||||
|
||||
kill $pid
|
||||
kill $pid
|
||||
mv ~/sparkdata/conf/spark.conf.bak ~/sparkdata/conf/spark.conf
|
||||
Reference in new issue
Block a user