Skip to content

Commit c79d569

Browse files
committed
Fix java error on travis
1 parent 99229ac commit c79d569

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

tests/environment/testenv.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,17 @@
4747
print('General environment test succeeded.')
4848

4949
# Ensures that the environment can run a basic game where a bot wins. Confirm that the bot expected to win does indeed win.
50-
splines = subprocess.Popen('../../environment/halite -d "10 10" -q "../../airesources/C++/MyBot" "cd ../../airesources/Java; java MyBot" "python3 ../../airesources/Python/MyBot.py" "../../airesources/Rust/target/release/MyBot" -s 1000', stdout=subprocess.PIPE, shell = True).stdout.read().decode('utf-8').split('\n')
50+
splines = subprocess.Popen('../../environment/halite -d "10 10" -q "../../airesources/C++/MyBot" "java -cp ../../airesources/Java MyBot" "python3 ../../airesources/Python/MyBot.py" "../../airesources/Rust/target/release/MyBot" -s 1000', stdout=subprocess.PIPE, shell = True).stdout.read().decode('utf-8').split('\n')
5151
if splines[9] != " " or splines[10] != " ":
5252
print('Starter package test failed. Environment output:\n#######################################################')
5353
print('\n'.join(splines) + '\n#######################################################')
5454
isGood = False
5555
else:
5656
print('Starter package test succeeded.')
5757

58+
splines = subprocess.Popen('cat *.log', stdout=subprocess.PIPE, shell = True).stdout.read().decode('utf-8').split('\n')
59+
print('\n'.join(splines))
60+
5861
# Ensures that tie evaluation is correct. Confirm that the bot expected to win does indeed win.
5962
tielines = subprocess.Popen('../../environment/halite -d "10 10" -q "python3 ModBot.py" "python3 ModBot.py" -s 998', stdout=subprocess.PIPE, shell = True).stdout.read().decode('utf-8').split('\n')
6063
if tielines[3].split()[1] != "2" or tielines[4].split()[1] != "1" or tielines[5] != " " or tielines[6] != " ":

tests/install.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ add-apt-repository -y ppa:ubuntu-toolchain-r/test
22
apt-get update
33

44
# Python
5-
apt-get install -y python3
5+
apt-get install -y python3
66

77
# Java
8-
apt-get install -y openjdk-7-jdk libjansi-java
8+
apt-get install -y openjdk-8-jdk libjansi-java
99

1010
# Rust
11-
curl -sSf https://static.rust-lang.org/rustup.sh | sh
11+
curl -sSf https://static.rust-lang.org/rustup.sh | sh
1212

1313
# C++
1414
apt-get install -y g++-4.9
@@ -32,3 +32,10 @@ mv phpunit.phar /usr/local/bin/phpunit
3232
php -v
3333
mysql -V
3434
phpunit --version
35+
36+
update-alternatives --set java $(update-alternatives --list java | grep java-8-openjdk)
37+
update-alternatives --set javac $(update-alternatives --list javac | grep java-8-openjdk)
38+
update-alternatives --display java
39+
update-alternatives --display javac
40+
java -version
41+
javac -version

0 commit comments

Comments
 (0)