-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add possible testing framework for harpoon
- Loading branch information
1 parent
b5011e3
commit 172df24
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM ubuntu:latest | ||
|
||
WORKDIR /root | ||
|
||
RUN apt update -yq && apt install -yq tmux curl wget git && cd \ | ||
&& git clone https://github.com/junegunn/fzf.git --depth 1 | ||
RUN cd /root/fzf && ./install --all | ||
RUN apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/log/dmesg.* && \ | ||
cat /dev/null > /var/log/dmesg | ||
|
||
COPY ./harpoon /bin/harpoon | ||
COPY ./test/driver.sh /bin/driver | ||
|
||
ENTRYPOINT [ "driver" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
|
||
! type harpoon >/dev/null && echo "Could not find harpoon" && exit 1 | ||
|
||
setup() { | ||
mkdir /root/.cache | ||
TERM="${TERM:-screen256color}" | ||
tmux new -ds home | ||
cachefile=/root/.cache/.tmux-harpoon-sessions | ||
harpoon -h >/dev/null | ||
} | ||
|
||
failed() { | ||
echo "$LINENO Failed" | ||
exit 1 | ||
} | ||
|
||
setup | ||
|
||
! [ "$(cat "$cachefile")" = "" ] && failed | ||
echo pass | ||
|
||
tmux ls | ||
tmux -V | ||
tmux send-keys -t "home" Enter "harpoon -a" Enter | ||
sleep 1 | ||
|
||
! [ "$(cat "$cachefile")" = "home=/root" ] && failed | ||
echo "pass" |