Skip to content

Commit

Permalink
test: remove empty print() functions
Browse files Browse the repository at this point in the history
Python tests are based on a reference output: on every run output produced by a
test compared to reference output and test become passed when both output are
equal. Perhaps empty print()'s were added as a delimeter for testscases in a
produced output, so the main purpose of these empty print() functions is a
reader's convenience. The problem with empty print's is that code become ugly.
  • Loading branch information
ligurio committed Dec 6, 2020
1 parent 3b3cc3b commit 5bd99e4
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 44 deletions.
4 changes: 0 additions & 4 deletions test/box-py/call.result
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ call box.error (33333, 'Hey!')
"reason": "Unknown error"
}
}

# A test case for Bug#103491
# server CALL processing bug with name path longer than two
# https://bugs.launchpad.net/tarantool/+bug/1034912

f = function() return 'OK' end
---
...
Expand All @@ -81,11 +79,9 @@ call test.f ()
- 'OK'
call test.test.f ()
- 'OK'

# Test for Bug #955226
# Lua Numbers are passed back wrongly as strings
#

function foo() return 1, 2, '1', '2' end
---
...
Expand Down
4 changes: 0 additions & 4 deletions test/box-py/call.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ def call(name, *args):
# IPROTO required!
call("box.error", 33333, "Hey!")

print("")
print("# A test case for Bug#103491")
print("# server CALL processing bug with name path longer than two")
print("# https://bugs.launchpad.net/tarantool/+bug/1034912")
print("")
admin("f = function() return 'OK' end")
admin("test = {}")
admin("test.f = f")
Expand All @@ -37,11 +35,9 @@ def call(name, *args):
call("test.f")
call("test.test.f")

print("")
print("# Test for Bug #955226")
print("# Lua Numbers are passed back wrongly as strings")
print("#")
print("")
admin("function foo() return 1, 2, '1', '2' end")
call("foo")

Expand Down
6 changes: 0 additions & 6 deletions test/replication-py/multi.result
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,21 @@ _ = box.space.test:create_index('primary')
server 1 is ok
server 2 is ok
server 3 is ok

Insert records
inserted 60 records

Synchronize
server 1 done
server 2 done
server 3 done
done

Check data
server 1 is ok
server 2 is ok
server 3 is ok
Done


----------------------------------------------------------------------
Cleanup
----------------------------------------------------------------------
server 1 done
server 2 done
server 3 done

6 changes: 0 additions & 6 deletions test/replication-py/multi.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,39 +72,33 @@
for server in cluster:
server.wait_lsn(master.id, master_lsn)
print("server {} is ok".format(server.id))
print("")

print("Insert records")
for i in range(ROW_N):
server = cluster[i % REPLICA_N]
server.admin("box.space.test:insert{{{}, {}}}".format(i, server.id), silent = True)
print("inserted {} records".format(ROW_N))
print("")

print("Synchronize")
for server1 in cluster:
for server2 in cluster:
server1.wait_lsn(server2.id, server2.get_lsn(server2.id))
print("server {} done".format(server1.id))
print("done")
print("")

print("Check data")
for server in cluster:
cnt = yaml.safe_load(server.admin("box.space.test:len()", silent = True))[0]
print("server {} is {}".format(server.id, cnt == ROW_N and "ok" or "not ok"))
print("Done")
print("")

print("")
print("----------------------------------------------------------------------")
print("Cleanup")
print("----------------------------------------------------------------------")

for server in cluster:
server.stop()
print("server {} done".format(server.id))
print("")

master.cleanup()
master.deploy()
2 changes: 0 additions & 2 deletions test/xlog-py/dup_key.result
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ box.space.test:insert{2, 'fourth tuple'}
...
.xlog does not exist
check log line for 'Duplicate key'

'Duplicate key' exists in server log

box.space.test:get{1}
---
- [1, 'first tuple']
Expand Down
2 changes: 0 additions & 2 deletions test/xlog-py/dup_key.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@
server.start()
line = "Duplicate key"
print("check log line for '{}'".format(line))
print("")
if server.logfile_pos.seek_once(line) >= 0:
print("'{}' exists in server log".format(line))
print("")

server.admin("box.space.test:get{1}")
server.admin("box.space.test:get{2}")
Expand Down
2 changes: 0 additions & 2 deletions test/xlog-py/lsn_gap.result
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ box.space.test:insert{4, 'fourth tuple'}
- [4, 'fourth tuple']
...
check log line for 'ignoring a gap in LSN'

'ignoring a gap in LSN' exists in server log

box.space.test:select{}
---
- - [1, 'first tuple']
Expand Down
2 changes: 0 additions & 2 deletions test/xlog-py/lsn_gap.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@
server.start()
line="ignoring a gap in LSN"
print("check log line for '{}'".format(line))
print("")
if server.logfile_pos.seek_once(line) >= 0:
print("'{}' exists in server log".format(line))
print("")

# missing tuple from removed xlog
server.admin("box.space.test:select{}")
6 changes: 0 additions & 6 deletions test/xlog-py/misc.result
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@

# xlog file must exist after inserts.

space = box.schema.space.create('tweedledum')
---
...
.xlog exists
index = space:create_index('primary', { type = 'hash' })
---
...

# a new xlog must be opened after regular termination.

box.space.tweedledum:insert{3, 'third tuple'}
---
- [3, 'third tuple']
...

# An xlog file with one record during recovery.

box.space.tweedledum:insert{4, 'fourth tuple'}
---
- [4, 'fourth tuple']
Expand Down
6 changes: 0 additions & 6 deletions test/xlog-py/misc.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@

data_path = os.path.join(server.vardir, server.name)

print("")
print("# xlog file must exist after inserts.")
print("")
filename = str(lsn).zfill(20) + ".xlog"
wal = os.path.join(data_path, filename)

Expand All @@ -30,9 +28,7 @@
server.stop()
lsn += 2

print("")
print("# a new xlog must be opened after regular termination.")
print("")
filename = str(lsn).zfill(20) + ".xlog"
server.start()

Expand All @@ -49,9 +45,7 @@
print(".xlog stays around after shutdown")
lsn += 1

print("")
print("# An xlog file with one record during recovery.")
print("")
server.start()
filename = str(lsn).zfill(20) + ".xlog"
wal = os.path.join(data_path, filename)
Expand Down
2 changes: 0 additions & 2 deletions test/xlog-py/missing.result
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ box.space.test:delete{3}
- [3, 'third tuple']
...
check log line for 'ignoring a gap in LSN'

'ignoring a gap in LSN' exists in server log

box.space.test:select{}
---
- []
Expand Down
2 changes: 0 additions & 2 deletions test/xlog-py/missing.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@
server.start()
line="ignoring a gap in LSN"
print("check log line for '{}'".format(line))
print("")
if server.logfile_pos.seek_once(line) >= 0:
print("'{}' exists in server log".format(line))
print("")

# missing tuples from removed xlog
server.admin("box.space.test:select{}")
Expand Down

0 comments on commit 5bd99e4

Please sign in to comment.