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

Tweak bashrc #1363

Merged
merged 3 commits into from
Jul 6, 2022
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
Expand Down Expand Up @@ -120,3 +120,33 @@ if ! shopt -oq posix; then
fi

. /opt/conda/etc/profile.d/conda.sh && conda activate base

# add nicer bash prompt
conda config --set changeps1 True

parse_git_branch() {
git branch --color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/'
}

BASE03=$(tput setaf 234)
BASE02=$(tput setaf 235)
BASE01=$(tput setaf 240)
BASE00=$(tput setaf 241)
BASE0=$(tput setaf 244)
BASE1=$(tput setaf 245)
BASE2=$(tput setaf 254)
BASE3=$(tput setaf 230)
YELLOW=$(tput setaf 136)
ORANGE=$(tput setaf 166)
RED=$(tput setaf 160)
MAGENTA=$(tput setaf 125)
VIOLET=$(tput setaf 61)
BLUE=$(tput setaf 33)
CYAN=$(tput setaf 37)
GREEN=$(tput setaf 64)
BOLD=$(tput bold)
RESET=$(tput sgr0)

NAME=`whoami | cut -d'@' -f1`

PS1="\[$CYAN\]$NAME:\w\[$RESET\]\$(parse_git_branch) \n\[$GREEN\]\A \$ \[$RESET\]"
10 changes: 6 additions & 4 deletions tests_deployment/test_jupyterhub_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

monkeypatch_ssl_context()

TIMEOUT_SECS = 300


@pytest.fixture
def paramiko_object():
Expand Down Expand Up @@ -57,12 +59,12 @@ def run_command(command, stdin, stdout, stderr):
return "".join(output).strip()


@pytest.mark.timeout(120)
@pytest.mark.timeout(TIMEOUT_SECS)
def test_simple_jupyterhub_ssh(paramiko_object):
stdin, stdout, stderr = paramiko_object.exec_command("")


@pytest.mark.timeout(120)
@pytest.mark.timeout(TIMEOUT_SECS)
def test_print_jupyterhub_ssh(paramiko_object):
stdin, stdout, stderr = paramiko_object.exec_command("")

Expand All @@ -81,7 +83,7 @@ def test_print_jupyterhub_ssh(paramiko_object):
print(run_command(command, stdin, stdout, stderr))


@pytest.mark.timeout(120)
@pytest.mark.timeout(TIMEOUT_SECS)
def test_exact_jupyterhub_ssh(paramiko_object):
stdin, stdout, stderr = paramiko_object.exec_command("")

Expand All @@ -100,7 +102,7 @@ def test_exact_jupyterhub_ssh(paramiko_object):
assert output == run_command(command, stdin, stdout, stderr)


@pytest.mark.timeout(120)
@pytest.mark.timeout(TIMEOUT_SECS)
def test_contains_jupyterhub_ssh(paramiko_object):
stdin, stdout, stderr = paramiko_object.exec_command("")

Expand Down