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

Commit

Permalink
fix(regression): Fix failed send_trytes test suite
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
afcidk committed Jul 17, 2020
1 parent 8ef4605 commit 34ea6a4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
1 change: 0 additions & 1 deletion tests/regression/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ setup_build_opts() {
"|--ta_host ${TA_HOST}"
"|--db_host ${DB_HOST}"
"|--quiet"
"|--proxy_passthrough"
"--define db=enable|"
"--define build_type=debug|"
"--define build_type=profile|"
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/run-api-with-mqtt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ for ((i = 0; i < ${#OPTIONS[@]}; i++)); do
cli_arg=${option} | cut -d '|' -f 1
build_arg=${option} | cut -d '|' -f 2

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

Expand Down
7 changes: 1 addition & 6 deletions tests/regression/run-api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ for ((i = 0; i < ${#OPTIONS[@]}; i++)); do
cli_arg=$(echo ${option} | cut -d '|' -f 2)
build_arg=$(echo ${option} | cut -d '|' -f 1)

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

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

trap "kill -9 ${TA};" INT # Trap SIGINT from Ctrl-C to stop TA

python3 tests/regression/runner.py ${remaining_args} --url localhost:${TA_PORT}
rc=$?

if [ $rc -ne 0 ]; then
echo "Build option '${option}' failed"
fail+=("${option}")
Expand Down
8 changes: 3 additions & 5 deletions tests/regression/test_suite/send_trytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import unittest
import time
import logging
from urllib import request
import urllib3

class SendTrytes(unittest.TestCase):
Expand Down Expand Up @@ -80,16 +81,13 @@ def setUpClass(cls):
"command": "getTransactionsToApprove",
"depth": 4,
}

stringified = json.dumps(command)

headers = {
'content-type': 'application/json',
'X-IOTA-API-Version': '1'
}
global URL
request = urllib3.Request(url=URL, data=stringified, headers=headers)
returnData = urllib3.urlopen(request).read()
req = request.Request(url=URL, data=json.dumps(command).encode(), headers=headers)
returnData = request.urlopen(req).read()

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

0 comments on commit 34ea6a4

Please sign in to comment.