Skip to content

Commit

Permalink
PR to exercise Jenkins CI Python3 issue (panda-re#757)
Browse files Browse the repository at this point in the history
* Blank line - just want to reproduce CI error

* Python 2to3 on ptest files

* Syncup to current docker file

* Another 2to3 conversion

* Fix Jenkins type error
  • Loading branch information
tnballo authored Sep 10, 2020
1 parent 4e49648 commit 7fff9f4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 17 deletions.
7 changes: 5 additions & 2 deletions panda/scripts/install_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,16 @@ EOF
fi
else
progress "Installing pycparser..."
sudo -H pip install pycparser
sudo -H pip3 install pycparser
fi
fi

# PyPanda misc
pip3 install colorama cffi

# Upgrading protocol buffers python support
if [ "$version" -le "19" ]; then
sudo pip install --upgrade protobuf
sudo pip3 install --upgrade protobuf
fi
progress "Trying to install LLVM 3.3..."
if ! sudo apt-get -y install llvm-3.3-dev clang-3.3
Expand Down
8 changes: 4 additions & 4 deletions panda/scripts/run_debian.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def run_and_create_recording():
qcow = join(dot_dir, arch_data.qcow)

if not os.path.isfile(qcow):
print("\nQcow %s doesn't exist. Downloading from moyix. Thanks moyix!\n" % qcow)
print(("\nQcow %s doesn't exist. Downloading from moyix. Thanks moyix!\n" % qcow))
sp.check_call(["wget", "http://panda.moyix.net/~moyix/" + arch_data.qcow, "-O", qcow])
for extra_file in arch_data.extra_files or []:
extra_file_path = join(dot_dir, extra_file)
Expand All @@ -182,9 +182,9 @@ def run_and_create_recording():
new_guest_cmd = list(map(transform_arg_copy, guest_cmd))
exename = basename(new_guest_cmd[0])

print("args =", guest_cmd)
print("new_guest_cmd =", new_guest_cmd)
print("env = ", env)
print(("args =", guest_cmd))
print(("new_guest_cmd =", new_guest_cmd))
print(("env = ", env))

if args.replaybase is None:
replay_base = join(binary_dir, binary_basename)
Expand Down
2 changes: 1 addition & 1 deletion panda/testing/irccat.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def main():
try:
c = reactor.server().connect(args.server, args.port, args.nickname)
except irc.client.ServerConnectionError:
print(sys.exc_info()[1])
print((sys.exc_info()[1]))
raise SystemExit(1)

c.add_global_handler("welcome", on_connect)
Expand Down
7 changes: 4 additions & 3 deletions panda/testing/ptest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/python


USAGE = """
NB: you need to set the PANDA_REGRESSION_DIR env variable for any
Expand Down Expand Up @@ -74,7 +75,7 @@ def setup(testname):
return True
except Exception as e:
error ("Setup %s failed" % testname)
print e
print(e)
return False

def bless(testname):
Expand All @@ -97,7 +98,7 @@ def bless(testname):
return True
except Exception as e:
error ("Bless %s failed" % testname)
print e
print(e)
return False

def test(testname):
Expand Down Expand Up @@ -132,7 +133,7 @@ def test(testname):
return True
except Exception as e:
error ("Test %s failed" % testname)
print e
print(e)
return False

def do_all(do_fn):
Expand Down
12 changes: 6 additions & 6 deletions panda/testing/ptest_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
debug = False

def progress(msg):
print Fore.GREEN + '[ptest.py] ' + Fore.RESET + Style.BRIGHT + msg + Style.RESET_ALL
print
print(Fore.GREEN + '[ptest.py] ' + Fore.RESET + Style.BRIGHT + msg + Style.RESET_ALL)
print()

def error(msg):
print Fore.RED + '[ptest.py] ' + Fore.RESET + Style.BRIGHT + msg + Style.RESET_ALL
print
print(Fore.RED + '[ptest.py] ' + Fore.RESET + Style.BRIGHT + msg + Style.RESET_ALL)
print()

def dir_exists(dirname):
return os.path.exists(dirname) and os.path.isdir(dirname)
Expand Down Expand Up @@ -43,7 +43,7 @@ def file_required(filename):
sys.exit(1)

def moveit(base1, base2, suff):
print "moving %s%s to %s%s" % (base1, suff, base2, suff)
print("moving %s%s to %s%s" % (base1, suff, base2, suff))
shutil.move(base1 + suff, base2 + suff)

def run(cmd):
Expand Down Expand Up @@ -132,7 +132,7 @@ def run_test_debian(replay_args, replayname, arch, rdir = replaydir, clear_tmpou
os.chdir(tmpoutdir)
output = sp.check_output(cmd.split())
# full output of replay goes here
with open (tmpfulloutfile, "a") as out:
with open (tmpfulloutfile, "ab") as out:
out.write(output)
msg = ("Test %s succeeded" % testname)
progress(msg)
Expand Down
2 changes: 1 addition & 1 deletion panda/testing/tests/scissors/scissors-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def progress_fullout(msg):

os.chdir(tmpoutdir)
with open(tmpoutfile, "w") as f:
print "scissors-test results: %d pass %d fail\n" % (num_pass, num_fail)
print("scissors-test results: %d pass %d fail\n" % (num_pass, num_fail))
f.write("scissors-test results: %d pass %d fail\n" % (num_pass, num_fail))
if num_pass == num_tests * (len(binaries)):
f.write("Scissors PASS\n")
Expand Down

0 comments on commit 7fff9f4

Please sign in to comment.