Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[eclipse] Use pre-downloaded Luna (address #66). #141

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion script/install_ubuntu_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,18 @@ tmux_setup() {
ln -sf $CI_SOURCE_PATH/conf/$FILENAME_TMUX_CONF_DEFAULT ~/$FILENAME_TMUX_CONF_TOBE_READ
}

install_eclipse() {
#######################################
# We decided to stick to Eclipse Luna https://github.com/130s/hut_10sqft/issues/66,
# and its binary is shared on Dropbox so that there's no need to fetch tarball.
# Once we'll choose to use newer version then we can utilize the logic here agian. Until then, this method shouldn't be used.
# Globals:
# (None)
# Arguments:
# (None)
# Returns:
# (None)
#######################################
_install_eclipse_web() {
TARBALL_ECLIPSE_URL=http://eclipse.mirror.rafal.ca/technology/epp/downloads/release/mars/2/eclipse-cpp-mars-2-linux-gtk-x86_64.tar.gz # This needs to be updated whenever we want to use new version.
TARBALL_ECLIPSE_NAME="${TARBALL_ECLIPSE_URL##*/}"
NICKNAME_ECLIPSE="${TARBALL_ECLIPSE_NAME%.*}"
Expand All @@ -85,6 +96,14 @@ install_eclipse() {
cd $CI_SOURCE_PATH # At the end of whatever the operation, we always go back to home.
}

install_eclipse() {
PATH_ECLIPSE_BIN="/usr/bin"

# Even though path under Dropbox might not exist, especially upon new installation, it's ok as long as symlink is created and the data will be synced later.
(sudo ln -sf ~/data/Dropbox/pg/eclipse/eclipse_luna/eclipse ${PATH_ECLIPSE_BIN}/eclipse) || error $LINENO "Failed to create eclipse symlink ${PATH_ECLIPSE_BIN}. Skipping Eclipse installation." -1
cd $CI_SOURCE_PATH # At the end of whatever the operation, we always go back to home.
}

#######################################
# This func copies ssh public and private keys from dropbox folder to ~/.ssh.
# With the potential of multiple key pairs on a single host, we're using specific name for pairs so that the commonly used default { id_rsa, id_rsa.pub } name is not encouraged (but still valid).
Expand Down
35 changes: 32 additions & 3 deletions test/test_util.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
#!/usr/bin/env python

# Copyright 2017 Isaac I. Y. Saito.
Expand All @@ -16,6 +17,7 @@

import os
import shutil
from subprocess import call, Popen, PIPE
import tarfile
import unittest
import urllib
Expand Down Expand Up @@ -51,8 +53,12 @@ def tearDown(self):
print('tearDown: chdir-ed to {}'.format(TestUtil._pwd_beginning))
#os.chdir(self.pwd_beginning)
os.chdir(TestUtil._pwd_beginning)

def _setup_testdata(self):

def _setup_testdata_find_replace(self):
'''
Prepare test data for { find_all_files, replaceAll, replace } methods.
'''

# this is where testdata files are. So do this every time.
os.chdir(TestUtil._pwd_beginning)

Expand Down Expand Up @@ -92,6 +98,10 @@ def _setup_testdata(self):

print('After copying files into {}: {}\nCurrent dir: {}'.format(TestUtil._TEST_DIR, os.listdir(TestUtil._TEST_DIR), os.path.abspath(os.path.curdir)))

def _setup_testdata(self):
'''backward compatibility only'''
self._setup_testdata_find_replace()

def test_find_all_files_noarg_absolutepath(self):
# Test without argument passed to find_all_files.
# Test absolute paths.
Expand Down Expand Up @@ -168,10 +178,29 @@ def test_replace_str_infile_nospecify(self):

def _test_measure_performance(self):
'''Prefixed since this testcase is NOT functional yet. '''
from subprocess import Popen, PIPE
process = Popen(['measure_performance', 'ls', '10'], stdout=PIPE, stderr=PIPE)
stdout, stderr = process.communicate()
self.assertTrue(stderr, '')

def test_conv_pngtojpg(self):
'''
'''
LIST_FILES_A = ["aa.jpg",
"bb.png",
"cc (conflicted copy).png",
"dd 日本語 space.png",
"日本語 ee .png" # Includes a multi-byte space char.
]

# Create a dummy folder to mimic real environment
FOLDER_TEST = "~/data/Dropbox/tmp";
if not os.path.exists(FOLDER_TEST):
os.makedirs(FOLDER_TEST)
# Populate dummy image files
for f in LIST_FILES_A:
call('touch {}'.format(f))
# TODO impl


if __name__ == '__main__':
unittest.main()