Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.

Commit 34ea6a4

Browse files
committed
fix(regression): Fix failed send_trytes test suite
Fixes #717. Since "tips/pair" API is removed, we can no longer depend on the original API. However, the original modification to send_trytes test suite depends on the proxy_passthrough feature. Therefore, I removed proxy_passthrough from build options and enable it everytime we run the regression test.
1 parent 8ef4605 commit 34ea6a4

File tree

4 files changed

+5
-13
lines changed

4 files changed

+5
-13
lines changed

tests/regression/common.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ setup_build_opts() {
99
"|--ta_host ${TA_HOST}"
1010
"|--db_host ${DB_HOST}"
1111
"|--quiet"
12-
"|--proxy_passthrough"
1312
"--define db=enable|"
1413
"--define build_type=debug|"
1514
"--define build_type=profile|"

tests/regression/run-api-with-mqtt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ for ((i = 0; i < ${#OPTIONS[@]}; i++)); do
2222
cli_arg=${option} | cut -d '|' -f 1
2323
build_arg=${option} | cut -d '|' -f 2
2424

25-
bazel run accelerator --define mqtt=enable ${build_arg} -- --quiet --ta_port=${TA_PORT} ${cli_arg} &
25+
bazel run accelerator --define mqtt=enable ${build_arg} -- --quiet --ta_port=${TA_PORT} ${cli_arg} --proxy_passthrough &
2626
TA=$!
2727
trap "kill -9 ${TA};" INT # Trap SIGINT from Ctrl-C to stop TA
2828

tests/regression/run-api.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ for ((i = 0; i < ${#OPTIONS[@]}; i++)); do
2222
cli_arg=$(echo ${option} | cut -d '|' -f 2)
2323
build_arg=$(echo ${option} | cut -d '|' -f 1)
2424

25-
bazel run accelerator ${build_arg} -- --ta_port=${TA_PORT} ${cli_arg} &
25+
bazel run accelerator ${build_arg} -- --ta_port=${TA_PORT} ${cli_arg} --proxy_passthrough &
2626
TA=$!
2727
trap "kill -9 ${TA};" INT # Trap SIGINT from Ctrl-C to stop TA
2828

@@ -38,11 +38,6 @@ for ((i = 0; i < ${#OPTIONS[@]}; i++)); do
3838
python3 tests/regression/runner.py ${remaining_args} --url localhost:${TA_PORT}
3939
rc=$?
4040

41-
trap "kill -9 ${TA};" INT # Trap SIGINT from Ctrl-C to stop TA
42-
43-
python3 tests/regression/runner.py ${remaining_args} --url localhost:${TA_PORT}
44-
rc=$?
45-
4641
if [ $rc -ne 0 ]; then
4742
echo "Build option '${option}' failed"
4843
fail+=("${option}")

tests/regression/test_suite/send_trytes.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import unittest
44
import time
55
import logging
6+
from urllib import request
67
import urllib3
78

89
class SendTrytes(unittest.TestCase):
@@ -80,16 +81,13 @@ def setUpClass(cls):
8081
"command": "getTransactionsToApprove",
8182
"depth": 4,
8283
}
83-
84-
stringified = json.dumps(command)
85-
8684
headers = {
8785
'content-type': 'application/json',
8886
'X-IOTA-API-Version': '1'
8987
}
9088
global URL
91-
request = urllib3.Request(url=URL, data=stringified, headers=headers)
92-
returnData = urllib3.urlopen(request).read()
89+
req = request.Request(url=URL, data=json.dumps(command).encode(), headers=headers)
90+
returnData = request.urlopen(req).read()
9391

9492
jsonData = json.loads(returnData)
9593
rand_trytes.append(all_9_context + jsonData["trunkTransaction"] +

0 commit comments

Comments
 (0)